ia64/xen-unstable

changeset 16095:034df2dca608

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>
author Keir Fraser <keir@xensource.com>
date Thu Oct 11 13:32:41 2007 +0100 (2007-10-11)
parents cab326925ea6
children 313ab23f05db
files xen/include/xen/smp.h
line diff
     1.1 --- a/xen/include/xen/smp.h	Thu Oct 11 13:27:38 2007 +0100
     1.2 +++ b/xen/include/xen/smp.h	Thu Oct 11 13:32:41 2007 +0100
     1.3 @@ -61,20 +61,6 @@ extern int on_selected_cpus(
     1.4      int wait);
     1.5  
     1.6  /*
     1.7 - * Call a function on all processors
     1.8 - */
     1.9 -static inline int on_each_cpu(
    1.10 -    void (*func) (void *info),
    1.11 -    void *info,
    1.12 -    int retry,
    1.13 -    int wait)
    1.14 -{
    1.15 -    int ret = smp_call_function(func, info, retry, wait);
    1.16 -    func(info);
    1.17 -    return ret;
    1.18 -}
    1.19 -
    1.20 -/*
    1.21   * Mark the boot cpu "online" so that it can call console drivers in
    1.22   * printk() and can access its per-cpu storage.
    1.23   */
    1.24 @@ -91,7 +77,6 @@ void smp_prepare_boot_cpu(void);
    1.25  #define raw_smp_processor_id()			0
    1.26  #define hard_smp_processor_id()			0
    1.27  #define smp_call_function(func,info,retry,wait)	({ do {} while (0); 0; })
    1.28 -#define on_each_cpu(func,info,retry,wait)	({ func(info); 0; })
    1.29  #define num_booting_cpus()			1
    1.30  #define smp_prepare_boot_cpu()			do {} while (0)
    1.31  
    1.32 @@ -103,12 +88,28 @@ static inline int on_selected_cpus(
    1.33      int wait)
    1.34  {
    1.35      if ( cpu_isset(0, selected) )
    1.36 +    {
    1.37 +        local_irq_disable();
    1.38          func(info);
    1.39 +        local_irq_enable();
    1.40 +    }
    1.41      return 0;
    1.42  }
    1.43  
    1.44  #endif
    1.45  
    1.46 +/*
    1.47 + * Call a function on all processors
    1.48 + */
    1.49 +static inline int on_each_cpu(
    1.50 +    void (*func) (void *info),
    1.51 +    void *info,
    1.52 +    int retry,
    1.53 +    int wait)
    1.54 +{
    1.55 +    return on_selected_cpus(cpu_online_map, func, info, retry, wait);
    1.56 +}
    1.57 +
    1.58  #define smp_processor_id() raw_smp_processor_id()
    1.59  
    1.60  #endif