diff options
author | Keir Fraser <keir@xensource.com> | 2007-10-11 13:32:41 +0100 |
---|---|---|
committer | Keir Fraser <keir@xensource.com> | 2007-10-11 13:32:41 +0100 |
commit | 73fc0df663bc365d4e9ee4c6abf7fece8c870b5b (patch) | |
tree | 510793e8e7d9bbd3d8012a73810ff23f70bbfb72 /xen/include/xen/smp.h | |
parent | 10d033429120a553b0a913f8c15483dbfa7672f5 (diff) | |
download | xen-73fc0df663bc365d4e9ee4c6abf7fece8c870b5b.tar.gz xen-73fc0df663bc365d4e9ee4c6abf7fece8c870b5b.tar.bz2 xen-73fc0df663bc365d4e9ee4c6abf7fece8c870b5b.zip |
Clean up SMP macros and always have IRQs disabled when executing an
'smp_call_function' callback function.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/xen/smp.h')
-rw-r--r-- | xen/include/xen/smp.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/xen/include/xen/smp.h b/xen/include/xen/smp.h index cefce3ff3f..c02ecd4dc3 100644 --- a/xen/include/xen/smp.h +++ b/xen/include/xen/smp.h @@ -61,20 +61,6 @@ extern int on_selected_cpus( int wait); /* - * Call a function on all processors - */ -static inline int on_each_cpu( - void (*func) (void *info), - void *info, - int retry, - int wait) -{ - int ret = smp_call_function(func, info, retry, wait); - func(info); - return ret; -} - -/* * Mark the boot cpu "online" so that it can call console drivers in * printk() and can access its per-cpu storage. */ @@ -91,7 +77,6 @@ void smp_prepare_boot_cpu(void); #define raw_smp_processor_id() 0 #define hard_smp_processor_id() 0 #define smp_call_function(func,info,retry,wait) ({ do {} while (0); 0; }) -#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) #define num_booting_cpus() 1 #define smp_prepare_boot_cpu() do {} while (0) @@ -103,12 +88,28 @@ static inline int on_selected_cpus( int wait) { if ( cpu_isset(0, selected) ) + { + local_irq_disable(); func(info); + local_irq_enable(); + } return 0; } #endif +/* + * Call a function on all processors + */ +static inline int on_each_cpu( + void (*func) (void *info), + void *info, + int retry, + int wait) +{ + return on_selected_cpus(cpu_online_map, func, info, retry, wait); +} + #define smp_processor_id() raw_smp_processor_id() #endif |