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>

+44 -26
+44 -26
kernel/sched.c
··· 3577 } 3578 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. 3607 * @pid: the pid in question. 3608 */ ··· 5602 } 5603 5604 #endif /* CONFIG_MAGIC_SYSRQ */
··· 3577 } 3578 3579 /** 3580 * find_process_by_pid - find a process with a matching PID value. 3581 * @pid: the pid in question. 3582 */ ··· 5628 } 5629 5630 #endif /* CONFIG_MAGIC_SYSRQ */ 5631 + 5632 + #ifdef CONFIG_IA64 5633 + /* 5634 + * These functions are only useful for the IA64 MCA handling. 5635 + * 5636 + * They can only be called when the whole system has been 5637 + * stopped - every CPU needs to be quiescent, and no scheduling 5638 + * activity can take place. Using them for anything else would 5639 + * be a serious bug, and as a result, they aren't even visible 5640 + * under any other configuration. 5641 + */ 5642 + 5643 + /** 5644 + * curr_task - return the current task for a given cpu. 5645 + * @cpu: the processor in question. 5646 + * 5647 + * ONLY VALID WHEN THE WHOLE SYSTEM IS STOPPED! 5648 + */ 5649 + task_t *curr_task(int cpu) 5650 + { 5651 + return cpu_curr(cpu); 5652 + } 5653 + 5654 + /** 5655 + * set_curr_task - set the current task for a given cpu. 5656 + * @cpu: the processor in question. 5657 + * @p: the task pointer to set. 5658 + * 5659 + * Description: This function must only be used when non-maskable interrupts 5660 + * are serviced on a separate stack. It allows the architecture to switch the 5661 + * notion of the current task on a cpu in a non-blocking manner. This function 5662 + * must be called with all CPU's synchronized, and interrupts disabled, the 5663 + * and caller must save the original value of the current task (see 5664 + * curr_task() above) and restore that value before reenabling interrupts and 5665 + * re-starting the system. 5666 + * 5667 + * ONLY VALID WHEN THE WHOLE SYSTEM IS STOPPED! 5668 + */ 5669 + void set_curr_task(int cpu, task_t *p) 5670 + { 5671 + cpu_curr(cpu) = p; 5672 + } 5673 + 5674 + #endif