- 2.6.17 port work build breaks, but the patch set is relativly stable
[linux-flexiantxendom0-3.2.10.git] / include / linux / smp.h
index 44153fd..e2fa3ab 100644 (file)
@@ -52,23 +52,12 @@ extern void smp_cpus_done(unsigned int max_cpus);
 /*
  * Call a function on all other processors
  */
-extern int smp_call_function (void (*func) (void *info), void *info,
-                             int retry, int wait);
+int smp_call_function(void(*func)(void *info), void *info, int retry, int wait);
 
 /*
  * Call a function on all processors
  */
-static inline int on_each_cpu(void (*func) (void *info), void *info,
-                             int retry, int wait)
-{
-       int ret = 0;
-
-       preempt_disable();
-       ret = smp_call_function(func, info, retry, wait);
-       func(info);
-       preempt_enable();
-       return ret;
-}
+int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait);
 
 #define MSG_ALL_BUT_SELF       0x8000  /* Assume <32768 CPU's */
 #define MSG_ALL                        0x8001
@@ -93,8 +82,18 @@ void smp_prepare_boot_cpu(void);
  */
 #define raw_smp_processor_id()                 0
 #define hard_smp_processor_id()                        0
-#define smp_call_function(func,info,retry,wait)        ({ 0; })
-#define on_each_cpu(func,info,retry,wait)      ({ func(info); 0; })
+static inline int up_smp_call_function(void)
+{
+       return 0;
+}
+#define smp_call_function(func,info,retry,wait)        (up_smp_call_function())
+#define on_each_cpu(func,info,retry,wait)      \
+       ({                                      \
+               local_irq_disable();            \
+               func(info);                     \
+               local_irq_enable();             \
+               0;                              \
+       })
 static inline void smp_send_reschedule(int cpu) { }
 #define num_booting_cpus()                     1
 #define smp_prepare_boot_cpu()                 do {} while (0)