]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/linux/smp.h
cpumask: remove the deprecated smp_call_function_mask()
[linux-2.6.git] / include / linux / smp.h
index c25e66bcecf335cfead012f4fd8feeff8834e5aa..39c64bae776d86069518e4e00017bc75e6aae53c 100644 (file)
@@ -7,9 +7,26 @@
  */
 
 #include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/list.h>
+#include <linux/cpumask.h>
 
 extern void cpu_idle(void);
 
+struct call_single_data {
+       struct list_head list;
+       void (*func) (void *info);
+       void *info;
+       u16 flags;
+       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>
@@ -21,7 +38,7 @@ extern void cpu_idle(void);
 /*
  * main cross-CPU interfaces, handles INIT, TLB flush, STOP, etc.
  * (defined in asm header):
- */ 
+ */
 
 /*
  * stops all CPUs but the current one:
@@ -52,15 +69,29 @@ 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 retry, int wait);
+int smp_call_function(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);
 
-int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
-                               int retry, int wait);
+void __smp_call_function_single(int cpuid, struct call_single_data *data,
+                               int wait);
+
+/*
+ * Generic and arch helpers
+ */
+#ifdef CONFIG_USE_GENERIC_SMP_HELPERS
+void generic_smp_call_function_single_interrupt(void);
+void generic_smp_call_function_interrupt(void);
+void ipi_call_lock(void);
+void ipi_call_unlock(void);
+void ipi_call_lock_irq(void);
+void ipi_call_unlock_irq(void);
+#endif
 
 /*
  * Call a function on all processors
  */
-int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait);
+int on_each_cpu(void (*func) (void *info), void *info, int wait);
 
 #define MSG_ALL_BUT_SELF       0x8000  /* Assume <32768 CPU's */
 #define MSG_ALL                        0x8001
@@ -78,8 +109,12 @@ int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait);
  */
 void smp_prepare_boot_cpu(void);
 
+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
  */
@@ -88,9 +123,9 @@ static inline int up_smp_call_function(void (*func)(void *), void *info)
 {
        return 0;
 }
-#define smp_call_function(func, info, retry, wait) \
+#define smp_call_function(func, info, wait) \
                        (up_smp_call_function(func, info))
-#define on_each_cpu(func,info,retry,wait)      \
+#define on_each_cpu(func,info,wait)            \
        ({                                      \
                local_irq_disable();            \
                func(info);                     \
@@ -100,17 +135,11 @@ 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, retry, wait) \
-({ \
-       WARN_ON(cpuid != 0);    \
-       local_irq_disable();    \
-       (func)(info);           \
-       local_irq_enable();     \
-       0;                      \
-})
-#define smp_call_function_mask(mask, func, info, wait) \
+#define smp_call_function_many(mask, func, info, wait) \
                        (up_smp_call_function(func, info))
-
+static inline void init_call_single_data(void)
+{
+}
 #endif /* !SMP */
 
 /*
@@ -137,7 +166,12 @@ static inline void smp_send_reschedule(int cpu) { }
 
 #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);