Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
[safe/jmp/linux-2.6] / include / linux / smp.h
index 6e7ba16..7a0570e 100644 (file)
@@ -21,6 +21,12 @@ struct call_single_data {
        u16 priv;
 };
 
+/* 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>
@@ -32,7 +38,7 @@ struct call_single_data {
 /*
  * main cross-CPU interfaces, handles INIT, TLB flush, STOP, etc.
  * (defined in asm header):
- */ 
+ */
 
 /*
  * stops all CPUs but the current one:
@@ -64,20 +70,14 @@ 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);
-
-static inline void smp_call_function_many(const struct cpumask *mask,
-                                         void (*func)(void *info), void *info,
-                                         int wait)
-{
-       smp_call_function_mask(*mask, func, info, wait);
-}
+void smp_call_function_many(const struct cpumask *mask,
+                           void (*func)(void *info), void *info, bool wait);
 
-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);
+
+int smp_call_function_any(const struct cpumask *mask,
+                         void (*func)(void *info), void *info, int wait);
 
 /*
  * Generic and arch helpers
@@ -116,6 +116,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
  */
@@ -136,21 +138,17 @@ 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)
+static inline void init_call_single_data(void) { }
+
+static inline int
+smp_call_function_any(const struct cpumask *mask, void (*func)(void *info),
+                     void *info, int wait)
 {
+       return smp_call_function_single(0, func, info, wait);
 }
+
 #endif /* !SMP */
 
 /*
@@ -177,7 +175,12 @@ static inline void init_call_single_data(void)
 
 #define get_cpu()              ({ preempt_disable(); smp_processor_id(); })
 #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);