fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / linux / smp.h
index 44153fd..7ba23ec 100644 (file)
@@ -6,7 +6,6 @@
  *             Alan Cox. <alan@redhat.com>
  */
 
-#include <linux/config.h>
 
 extern void cpu_idle(void);
 
@@ -52,23 +51,15 @@ 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);
+
+int smp_call_function_single(int cpuid, 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,11 +84,28 @@ 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)
+static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
+                               void *info, int retry, int wait)
+{
+       /* Disable interrupts here? */
+       func(info);
+       return 0;
+}
 
 #endif /* !SMP */
 
@@ -127,4 +135,6 @@ static inline void smp_send_reschedule(int cpu) { }
 #define put_cpu()              preempt_enable()
 #define put_cpu_no_resched()   preempt_enable_no_resched()
 
+void smp_setup_processor_id(void);
+
 #endif /* __LINUX_SMP_H */