aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/smp.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 8cc38d3bab0c..d0adb7898d54 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -102,6 +102,13 @@ static inline void call_function_init(void) { }
102int on_each_cpu(smp_call_func_t func, void *info, int wait); 102int on_each_cpu(smp_call_func_t func, void *info, int wait);
103 103
104/* 104/*
105 * Call a function on processors specified by mask, which might include
106 * the local one.
107 */
108void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func,
109 void *info, bool wait);
110
111/*
105 * Mark the boot cpu "online" so that it can call console drivers in 112 * Mark the boot cpu "online" so that it can call console drivers in
106 * printk() and can access its per-cpu storage. 113 * printk() and can access its per-cpu storage.
107 */ 114 */
@@ -132,6 +139,21 @@ static inline int up_smp_call_function(smp_call_func_t func, void *info)
132 local_irq_enable(); \ 139 local_irq_enable(); \
133 0; \ 140 0; \
134 }) 141 })
142/*
143 * Note we still need to test the mask even for UP
144 * because we actually can get an empty mask from
145 * code that on SMP might call us without the local
146 * CPU in the mask.
147 */
148#define on_each_cpu_mask(mask, func, info, wait) \
149 do { \
150 if (cpumask_test_cpu(0, (mask))) { \
151 local_irq_disable(); \
152 (func)(info); \
153 local_irq_enable(); \
154 } \
155 } while (0)
156
135static inline void smp_send_reschedule(int cpu) { } 157static inline void smp_send_reschedule(int cpu) { }
136#define num_booting_cpus() 1 158#define num_booting_cpus() 1
137#define smp_prepare_boot_cpu() do {} while (0) 159#define smp_prepare_boot_cpu() do {} while (0)