Skip to content

Commit

Permalink
SMP: Allow smp_call_function_single() to current cpu
Browse files Browse the repository at this point in the history
This removes the requirement for callers to get_cpu() to check in simple
cases.  This patch is for !CONFIG_SMP.

Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Avi Kivity committed Jul 16, 2007
1 parent de48935 commit a52b175
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/linux/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#include <linux/errno.h>
#include <asm/system.h>

extern void cpu_idle(void);

Expand Down Expand Up @@ -102,7 +103,11 @@ static inline void smp_send_reschedule(int cpu) { }
static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
void *info, int retry, int wait)
{
return -EBUSY;
WARN_ON(cpuid != 0);
local_irq_disable();
func(info);
local_irq_enable();
return 0;
}

#endif /* !SMP */
Expand Down

0 comments on commit a52b175

Please sign in to comment.