New helper: deactivate_locked_super()
[safe/jmp/linux-2.6] / include / linux / smp.h
index 0d5770c..a69db82 100644 (file)
@@ -24,6 +24,9 @@ struct call_single_data {
 /* total number of cpus in this system (may exceed NR_CPUS) */
 extern unsigned int total_cpus;
 
+int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
+                               int wait);
+
 #ifdef CONFIG_SMP
 
 #include <linux/preempt.h>
@@ -35,7 +38,7 @@ extern unsigned int total_cpus;
 /*
  * main cross-CPU interfaces, handles INIT, TLB flush, STOP, etc.
  * (defined in asm header):
- */ 
+ */
 
 /*
  * stops all CPUs but the current one:
@@ -67,20 +70,20 @@ extern void smp_cpus_done(unsigned int max_cpus);
  * Call a function on all other processors
  */
 int smp_call_function(void(*func)(void *info), void *info, int wait);
-/* Deprecated: use smp_call_function_many() which uses a cpumask ptr. */
-int smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info,
-                               int wait);
+void smp_call_function_many(const struct cpumask *mask,
+                           void (*func)(void *info), void *info, bool wait);
 
-static inline void smp_call_function_many(const struct cpumask *mask,
-                                         void (*func)(void *info), void *info,
-                                         int wait)
+/* Deprecated: Use smp_call_function_many which takes a pointer to the mask. */
+static inline int
+smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info,
+                      int wait)
 {
-       smp_call_function_mask(*mask, func, info, wait);
+       smp_call_function_many(&mask, func, info, wait);
+       return 0;
 }
 
-int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
+void __smp_call_function_single(int cpuid, struct call_single_data *data,
                                int wait);
-void __smp_call_function_single(int cpuid, struct call_single_data *data);
 
 /*
  * Generic and arch helpers
@@ -119,6 +122,8 @@ extern unsigned int setup_max_cpus;
 
 #else /* !SMP */
 
+static inline void smp_send_stop(void) { }
+
 /*
  *     These macros fold the SMP functionality into a single CPU system
  */
@@ -139,16 +144,10 @@ static inline int up_smp_call_function(void (*func)(void *), void *info)
 static inline void smp_send_reschedule(int cpu) { }
 #define num_booting_cpus()                     1
 #define smp_prepare_boot_cpu()                 do {} while (0)
-#define smp_call_function_single(cpuid, func, info, wait) \
-({ \
-       WARN_ON(cpuid != 0);    \
-       local_irq_disable();    \
-       (func)(info);           \
-       local_irq_enable();     \
-       0;                      \
-})
 #define smp_call_function_mask(mask, func, info, wait) \
                        (up_smp_call_function(func, info))
+#define smp_call_function_many(mask, func, info, wait) \
+                       (up_smp_call_function(func, info))
 static inline void init_call_single_data(void)
 {
 }
@@ -180,6 +179,12 @@ static inline void init_call_single_data(void)
 #define put_cpu()              preempt_enable()
 #define put_cpu_no_resched()   preempt_enable_no_resched()
 
+/*
+ * Callback to arch code if there's nosmp or maxcpus=0 on the
+ * boot command line:
+ */
+extern void arch_disable_smp_support(void);
+
 void smp_setup_processor_id(void);
 
 #endif /* __LINUX_SMP_H */