Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
eba0daf3
Commit
eba0daf3
authored
Dec 02, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC32]: Move get_wchan into processor.c
parent
a807608b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
28 deletions
+37
-28
arch/sparc/kernel/process.c
arch/sparc/kernel/process.c
+36
-0
include/asm-sparc/processor.h
include/asm-sparc/processor.h
+1
-28
No files found.
arch/sparc/kernel/process.c
View file @
eba0daf3
...
...
@@ -725,3 +725,39 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
"g1"
,
"g2"
,
"g3"
,
"o0"
,
"o1"
,
"memory"
,
"cc"
);
return
retval
;
}
extern
void
scheduling_functions_start_here
(
void
);
extern
void
scheduling_functions_end_here
(
void
);
unsigned
long
get_wchan
(
struct
task_struct
*
task
)
{
unsigned
long
pc
,
fp
,
bias
=
0
;
unsigned
long
task_base
=
(
unsigned
long
)
task
;
unsigned
long
ret
=
0
;
struct
reg_window
*
rw
;
int
count
=
0
;
if
(
!
task
||
task
==
current
||
task
->
state
==
TASK_RUNNING
)
goto
out
;
fp
=
task
->
thread_info
->
ksp
+
bias
;
do
{
/* Bogus frame pointer? */
if
(
fp
<
(
task_base
+
sizeof
(
struct
task_struct
))
||
fp
>=
(
task_base
+
(
2
*
PAGE_SIZE
)))
break
;
rw
=
(
struct
reg_window
*
)
fp
;
pc
=
rw
->
ins
[
7
];
if
(
pc
<
((
unsigned
long
)
scheduling_functions_start_here
)
||
pc
>=
((
unsigned
long
)
scheduling_functions_end_here
))
{
ret
=
pc
;
goto
out
;
}
fp
=
rw
->
ins
[
6
]
+
bias
;
}
while
(
++
count
<
16
);
out:
return
ret
;
}
include/asm-sparc/processor.h
View file @
eba0daf3
...
...
@@ -139,34 +139,7 @@ extern __inline__ void start_thread(struct pt_regs * regs, unsigned long pc,
#define release_thread(tsk) do { } while(0)
extern
pid_t
kernel_thread
(
int
(
*
fn
)(
void
*
),
void
*
arg
,
unsigned
long
flags
);
#define get_wchan(__TSK) \
({ extern void scheduling_functions_start_here(void); \
extern void scheduling_functions_end_here(void); \
unsigned long pc, fp, bias = 0; \
unsigned long task_base = (unsigned long) (__TSK); \
unsigned long __ret = 0; \
struct reg_window *rw; \
int count = 0; \
if (!(__TSK) || (__TSK) == current || \
(__TSK)->state == TASK_RUNNING) \
goto __out; \
fp = (__TSK)->thread_info->ksp + bias; \
do { \
/* Bogus frame pointer? */
\
if (fp < (task_base + sizeof(struct task_struct)) || \
fp >= (task_base + (2 * PAGE_SIZE))) \
break; \
rw = (struct reg_window *) fp; \
pc = rw->ins[7]; \
if (pc < ((unsigned long) scheduling_functions_start_here) || \
pc >= ((unsigned long) scheduling_functions_end_here)) { \
__ret = pc; \
goto __out; \
} \
fp = rw->ins[6] + bias; \
} while (++count < 16); \
__out: __ret; \
})
extern
unsigned
long
get_wchan
(
struct
task_struct
*
);
#define KSTK_EIP(tsk) ((tsk)->thread.kregs->pc)
#define KSTK_ESP(tsk) ((tsk)->thread.kregs->u_regs[UREG_FP])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment