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
Kirill Smelkov
linux
Commits
51983eb2
Commit
51983eb2
authored
Dec 03, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC64]: Un-macroify get_wchan.
parent
eba0daf3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
30 deletions
+39
-30
arch/sparc64/kernel/process.c
arch/sparc64/kernel/process.c
+38
-0
include/asm-sparc64/processor.h
include/asm-sparc64/processor.h
+1
-30
No files found.
arch/sparc64/kernel/process.c
View file @
51983eb2
...
...
@@ -814,3 +814,41 @@ asmlinkage int sparc_execve(struct pt_regs *regs)
out:
return
error
;
}
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
thread_info_base
;
struct
reg_window
*
rw
;
unsigned
long
ret
=
0
;
int
count
=
0
;
if
(
!
task
||
task
==
current
||
task
->
state
==
TASK_RUNNING
)
goto
out
;
thread_info_base
=
(
unsigned
long
)
task
->
thread_info
;
bias
=
STACK_BIAS
;
fp
=
task
->
thread_info
->
ksp
+
bias
;
do
{
/* Bogus frame pointer? */
if
(
fp
<
(
thread_info_base
+
sizeof
(
struct
thread_info
))
||
fp
>=
(
thread_info_base
+
THREAD_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-sparc64/processor.h
View file @
51983eb2
...
...
@@ -187,36 +187,7 @@ do { \
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 thread_info_base; \
struct reg_window *rw; \
unsigned long __ret = 0; \
int count = 0; \
if (!(__TSK) || (__TSK) == current || \
(__TSK)->state == TASK_RUNNING) \
goto __out; \
thread_info_base = (unsigned long) ((__TSK)->thread_info); \
bias = STACK_BIAS; \
fp = (__TSK)->thread_info->ksp + bias; \
do { \
/* Bogus frame pointer? */
\
if (fp < (thread_info_base + sizeof(struct thread_info)) || \
fp >= (thread_info_base + THREAD_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
*
task
);
#define KSTK_EIP(tsk) ((tsk)->thread_info->kregs->tpc)
#define KSTK_ESP(tsk) ((tsk)->thread_info->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