18 void (*func) (void *info); |
18 void (*func) (void *info); |
19 void *info; |
19 void *info; |
20 u16 flags; |
20 u16 flags; |
21 u16 priv; |
21 u16 priv; |
22 }; |
22 }; |
|
23 |
|
24 /* total number of cpus in this system (may exceed NR_CPUS) */ |
|
25 extern unsigned int total_cpus; |
|
26 |
|
27 int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, |
|
28 int wait); |
23 |
29 |
24 #ifdef CONFIG_SMP |
30 #ifdef CONFIG_SMP |
25 |
31 |
26 #include <linux/preempt.h> |
32 #include <linux/preempt.h> |
27 #include <linux/kernel.h> |
33 #include <linux/kernel.h> |
62 |
68 |
63 /* |
69 /* |
64 * Call a function on all other processors |
70 * Call a function on all other processors |
65 */ |
71 */ |
66 int smp_call_function(void(*func)(void *info), void *info, int wait); |
72 int smp_call_function(void(*func)(void *info), void *info, int wait); |
67 /* Deprecated: use smp_call_function_many() which uses a cpumask ptr. */ |
73 void smp_call_function_many(const struct cpumask *mask, |
68 int smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info, |
74 void (*func)(void *info), void *info, bool wait); |
69 int wait); |
|
70 |
75 |
71 static inline void smp_call_function_many(const struct cpumask *mask, |
76 /* Deprecated: Use smp_call_function_many which takes a pointer to the mask. */ |
72 void (*func)(void *info), void *info, |
77 static inline int |
73 int wait) |
78 smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info, |
|
79 int wait) |
74 { |
80 { |
75 smp_call_function_mask(*mask, func, info, wait); |
81 smp_call_function_many(&mask, func, info, wait); |
|
82 return 0; |
76 } |
83 } |
77 |
84 |
78 int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, |
|
79 int wait); |
|
80 void __smp_call_function_single(int cpuid, struct call_single_data *data); |
85 void __smp_call_function_single(int cpuid, struct call_single_data *data); |
81 |
86 |
82 /* |
87 /* |
83 * Generic and arch helpers |
88 * Generic and arch helpers |
84 */ |
89 */ |
134 0; \ |
139 0; \ |
135 }) |
140 }) |
136 static inline void smp_send_reschedule(int cpu) { } |
141 static inline void smp_send_reschedule(int cpu) { } |
137 #define num_booting_cpus() 1 |
142 #define num_booting_cpus() 1 |
138 #define smp_prepare_boot_cpu() do {} while (0) |
143 #define smp_prepare_boot_cpu() do {} while (0) |
139 #define smp_call_function_single(cpuid, func, info, wait) \ |
|
140 ({ \ |
|
141 WARN_ON(cpuid != 0); \ |
|
142 local_irq_disable(); \ |
|
143 (func)(info); \ |
|
144 local_irq_enable(); \ |
|
145 0; \ |
|
146 }) |
|
147 #define smp_call_function_mask(mask, func, info, wait) \ |
144 #define smp_call_function_mask(mask, func, info, wait) \ |
148 (up_smp_call_function(func, info)) |
145 (up_smp_call_function(func, info)) |
149 #define smp_call_function_many(mask, func, info, wait) \ |
146 #define smp_call_function_many(mask, func, info, wait) \ |
150 (up_smp_call_function(func, info)) |
147 (up_smp_call_function(func, info)) |
151 static inline void init_call_single_data(void) |
148 static inline void init_call_single_data(void) |