Skip to content

Commit

Permalink
smp_call_function_single() should be a macro on UP
Browse files Browse the repository at this point in the history
... or we end up with header include order problems from hell.

E.g. on m68k this is 100% fatal - local_irq_enable() there
wants preempt_count(), which wants task_struct fields, which
we won't have when we are in smp.h pulled from sched.h.

Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jul 17, 2007
1 parent 44052e0 commit 8dfd588
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions include/linux/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

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

extern void cpu_idle(void);

Expand Down Expand Up @@ -100,15 +99,14 @@ static inline int up_smp_call_function(void)
static inline void smp_send_reschedule(int cpu) { }
#define num_booting_cpus() 1
#define smp_prepare_boot_cpu() do {} while (0)
static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
void *info, int retry, int wait)
{
WARN_ON(cpuid != 0);
local_irq_disable();
func(info);
local_irq_enable();
return 0;
}
#define smp_call_function_single(cpuid, func, info, retry, wait) \
({ \
WARN_ON(cpuid != 0); \
local_irq_disable(); \
(func)(info); \
local_irq_enable(); \
0; \
})

#endif /* !SMP */

Expand Down

0 comments on commit 8dfd588

Please sign in to comment.