Commit adff093d authored by Avi Kivity's avatar Avi Kivity Committed by Paul Mackerras

[POWERPC] Allow smp_call_function_single() to current cpu

This removes the requirement for callers to get_cpu() to check in simple
cases.  i386 and x86_64 already received a similar treatment.
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 08ae6cc1
...@@ -284,7 +284,7 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int ...@@ -284,7 +284,7 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
int wait) int wait)
{ {
cpumask_t map = CPU_MASK_NONE; cpumask_t map = CPU_MASK_NONE;
int ret = -EBUSY; int ret = 0;
if (!cpu_online(cpu)) if (!cpu_online(cpu))
return -EINVAL; return -EINVAL;
...@@ -292,6 +292,11 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int ...@@ -292,6 +292,11 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
cpu_set(cpu, map); cpu_set(cpu, map);
if (cpu != get_cpu()) if (cpu != get_cpu())
ret = smp_call_function_map(func,info,nonatomic,wait,map); ret = smp_call_function_map(func,info,nonatomic,wait,map);
else {
local_irq_disable();
func(info);
local_irq_enable();
}
put_cpu(); put_cpu();
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment