diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-12 10:59:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-12 10:59:21 -0400 |
commit | 1df5c10a5b40d1ad747e3de3caf28764153c5c8e (patch) | |
tree | 87cda6983653d73a3ba4d24b1c8ba257254ac26b | |
parent | c3ff8ec31c1249d268cd11390649768a12bec1b9 (diff) |
Mark ia64-specific MCA/INIT scheduler hooks as dangerous
..and only enable them for ia64. The functions are only valid
when the whole system has been totally stopped and no scheduler
activity is ongoing on any CPU, and interrupts are globally
disabled.
In other words, they aren't useful for anything else. So make
sure that nobody can use them by mistake.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | kernel/sched.c | 70 |
1 files changed, 44 insertions, 26 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index e9ff04a9b56d..81b3a96ed2d0 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3577,32 +3577,6 @@ task_t *idle_task(int cpu) | |||
3577 | } | 3577 | } |
3578 | 3578 | ||
3579 | /** | 3579 | /** |
3580 | * curr_task - return the current task for a given cpu. | ||
3581 | * @cpu: the processor in question. | ||
3582 | */ | ||
3583 | task_t *curr_task(int cpu) | ||
3584 | { | ||
3585 | return cpu_curr(cpu); | ||
3586 | } | ||
3587 | |||
3588 | /** | ||
3589 | * set_curr_task - set the current task for a given cpu. | ||
3590 | * @cpu: the processor in question. | ||
3591 | * @p: the task pointer to set. | ||
3592 | * | ||
3593 | * Description: This function must only be used when non-maskable interrupts | ||
3594 | * are serviced on a separate stack. It allows the architecture to switch the | ||
3595 | * notion of the current task on a cpu in a non-blocking manner. This function | ||
3596 | * must be called with interrupts disabled, the caller must save the original | ||
3597 | * value of the current task (see curr_task() above) and restore that value | ||
3598 | * before reenabling interrupts. | ||
3599 | */ | ||
3600 | void set_curr_task(int cpu, task_t *p) | ||
3601 | { | ||
3602 | cpu_curr(cpu) = p; | ||
3603 | } | ||
3604 | |||
3605 | /** | ||
3606 | * find_process_by_pid - find a process with a matching PID value. | 3580 | * find_process_by_pid - find a process with a matching PID value. |
3607 | * @pid: the pid in question. | 3581 | * @pid: the pid in question. |
3608 | */ | 3582 | */ |
@@ -5628,3 +5602,47 @@ void normalize_rt_tasks(void) | |||
5628 | } | 5602 | } |
5629 | 5603 | ||
5630 | #endif /* CONFIG_MAGIC_SYSRQ */ | 5604 | #endif /* CONFIG_MAGIC_SYSRQ */ |
5605 | |||
5606 | #ifdef CONFIG_IA64 | ||
5607 | /* | ||
5608 | * These functions are only useful for the IA64 MCA handling. | ||
5609 | * | ||
5610 | * They can only be called when the whole system has been | ||
5611 | * stopped - every CPU needs to be quiescent, and no scheduling | ||
5612 | * activity can take place. Using them for anything else would | ||
5613 | * be a serious bug, and as a result, they aren't even visible | ||
5614 | * under any other configuration. | ||
5615 | */ | ||
5616 | |||
5617 | /** | ||
5618 | * curr_task - return the current task for a given cpu. | ||
5619 | * @cpu: the processor in question. | ||
5620 | * | ||
5621 | * ONLY VALID WHEN THE WHOLE SYSTEM IS STOPPED! | ||
5622 | */ | ||
5623 | task_t *curr_task(int cpu) | ||
5624 | { | ||
5625 | return cpu_curr(cpu); | ||
5626 | } | ||
5627 | |||
5628 | /** | ||
5629 | * set_curr_task - set the current task for a given cpu. | ||
5630 | * @cpu: the processor in question. | ||
5631 | * @p: the task pointer to set. | ||
5632 | * | ||
5633 | * Description: This function must only be used when non-maskable interrupts | ||
5634 | * are serviced on a separate stack. It allows the architecture to switch the | ||
5635 | * notion of the current task on a cpu in a non-blocking manner. This function | ||
5636 | * must be called with all CPU's synchronized, and interrupts disabled, the | ||
5637 | * and caller must save the original value of the current task (see | ||
5638 | * curr_task() above) and restore that value before reenabling interrupts and | ||
5639 | * re-starting the system. | ||
5640 | * | ||
5641 | * ONLY VALID WHEN THE WHOLE SYSTEM IS STOPPED! | ||
5642 | */ | ||
5643 | void set_curr_task(int cpu, task_t *p) | ||
5644 | { | ||
5645 | cpu_curr(cpu) = p; | ||
5646 | } | ||
5647 | |||
5648 | #endif | ||