diff options
author | Andrew Morton <akpm@osdl.org> | 2004-05-09 23:55:27 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-09 23:55:27 -0700 |
commit | a7c8a1d320ff544a044f6fac5c7fda557f5ef60c (patch) | |
tree | b1ab64fe86b137b1548c6e8d9cdb650d8c85c17c /kernel | |
parent | e736428d8be55699f3d9626f5196402a3702575b (diff) | |
download | history-a7c8a1d320ff544a044f6fac5c7fda557f5ef60c.tar.gz |
[PATCH] sched: in_sched_functions() cleanup
From: Rusty Russell <rusty@rustcorp.com.au>
1) Create an in_sched_functions() function in sched.c and make the
archs use it. (Two archs have wchan #if 0'd out: left them alone).
2) Move __sched from linux/init.h to linux/sched.h and add comment.
3) Rename __scheduling_functions_start_here/end_here to __sched_text_start/end.
Thanks to wli and Sam Ravnborg for clue donation.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index d083166dd3f0a6..ad9bf33f11c672 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -252,13 +252,6 @@ static DEFINE_PER_CPU(struct runqueue, runqueues); #define task_rq(p) cpu_rq(task_cpu(p)) #define cpu_curr(cpu) (cpu_rq(cpu)->curr) -extern unsigned long __scheduling_functions_start_here; -extern unsigned long __scheduling_functions_end_here; -const unsigned long scheduling_functions_start_here = - (unsigned long)&__scheduling_functions_start_here; -const unsigned long scheduling_functions_end_here = - (unsigned long)&__scheduling_functions_end_here; - /* * Default context-switch locking: */ @@ -3852,6 +3845,14 @@ void __init sched_init_smp(void) } #endif /* CONFIG_SMP */ +int in_sched_functions(unsigned long addr) +{ + /* Linker adds these: start and end of __sched functions */ + extern char __sched_text_start[], __sched_text_end[]; + return addr >= (unsigned long)__sched_text_start + && addr < (unsigned long)__sched_text_end; +} + void __init sched_init(void) { runqueue_t *rq; |