mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
kernel: clean up USE_GENERIC_SMP_HELPERS
For arch which needs USE_GENERIC_SMP_HELPERS, it has to select USE_GENERIC_SMP_HELPERS, rather than leaving a choice to user, since they don't provide their own implementions. Also, move on_each_cpu() to kernel/smp.c, it is strange to put it in kernel/softirq.c. For arch which doesn't use USE_GENERIC_SMP_HELPERS, e.g. blackfin, only on_each_cpu() is compiled. Signed-off-by: Amerigo Wang <[email protected]> Cc: David Howells <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Yinghai Lu <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b8cb464e4a
commit
351f8f8e64
5 changed files with 22 additions and 29 deletions
19
kernel/smp.c
19
kernel/smp.c
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/smp.h>
|
||||
#include <linux/cpu.h>
|
||||
|
||||
#ifdef CONFIG_USE_GENERIC_SMP_HELPERS
|
||||
static struct {
|
||||
struct list_head queue;
|
||||
raw_spinlock_t lock;
|
||||
|
|
@ -529,3 +530,21 @@ void ipi_call_unlock_irq(void)
|
|||
{
|
||||
raw_spin_unlock_irq(&call_function.lock);
|
||||
}
|
||||
#endif /* USE_GENERIC_SMP_HELPERS */
|
||||
|
||||
/*
|
||||
* Call a function on all processors
|
||||
*/
|
||||
int on_each_cpu(void (*func) (void *info), void *info, int wait)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
preempt_disable();
|
||||
ret = smp_call_function(func, info, wait);
|
||||
local_irq_disable();
|
||||
func(info);
|
||||
local_irq_enable();
|
||||
preempt_enable();
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(on_each_cpu);
|
||||
|
|
|
|||
Loading…
Reference in a new issue