diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-02-13 18:30:12 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-02-13 18:30:12 +0000 |
commit | f280af038a947b67694780f999e06e05d11de1cf (patch) | |
tree | 4a135406c76376c7e9a013034144985a619a7580 /xen/include/xen/smp.h | |
parent | 5dfa26a76cefd4220962ac1dfbf9028081c0ac5a (diff) | |
download | xen-f280af038a947b67694780f999e06e05d11de1cf.tar.gz xen-f280af038a947b67694780f999e06e05d11de1cf.tar.bz2 xen-f280af038a947b67694780f999e06e05d11de1cf.zip |
xen: Clean up SMP/hotplug headers and implementation a bit.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/include/xen/smp.h')
-rw-r--r-- | xen/include/xen/smp.h | 72 |
1 files changed, 7 insertions, 65 deletions
diff --git a/xen/include/xen/smp.h b/xen/include/xen/smp.h index 3e7de77ec8..6ab913a430 100644 --- a/xen/include/xen/smp.h +++ b/xen/include/xen/smp.h @@ -1,23 +1,10 @@ -#ifndef __LINUX_SMP_H -#define __LINUX_SMP_H - -/* - * Generic SMP support - * Alan Cox. <alan@redhat.com> - */ +#ifndef __XEN_SMP_H__ +#define __XEN_SMP_H__ #include <xen/config.h> - -#ifdef CONFIG_SMP - #include <asm/smp.h> /* - * main cross-CPU interfaces, handles INIT, TLB flush, STOP, etc. - * (defined in asm header): - */ - -/* * stops all CPUs but the current one: */ extern void smp_send_stop(void); @@ -66,38 +53,6 @@ extern int on_selected_cpus( */ void smp_prepare_boot_cpu(void); -#else - -/* - * These macros fold the SMP functionality into a single CPU system - */ - -#define smp_send_event_check_mask(m) ((void)0) -#define smp_send_event_check_cpu(p) ((void)0) -#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 num_booting_cpus() 1 -#define smp_prepare_boot_cpu() do {} while (0) - -static inline int on_selected_cpus( - cpumask_t selected, - void (*func) (void *info), - void *info, - int retry, - int wait) -{ - if ( cpu_isset(0, selected) ) - { - local_irq_disable(); - func(info); - local_irq_enable(); - } - return 0; -} - -#endif - /* * Call a function on all processors */ @@ -112,21 +67,8 @@ static inline int on_each_cpu( #define smp_processor_id() raw_smp_processor_id() -#ifdef CONFIG_HOTPLUG_CPU -extern spinlock_t cpu_add_remove_lock; -/* - * FIXME: need a better lock mechanism when real cpu hotplug is later - * supported, since spinlock may cause dead lock: - * cpu0: in stop_machine with lock held. Wait for cpu1 to respond - * to stop request - * cpu1: spin loop on lock upon cpu hotplug request from guest, - * without chance to handle softirq - * ... - */ -#define lock_cpu_hotplug() spin_lock(&cpu_add_remove_lock); -#define unlock_cpu_hotplug() spin_unlock(&cpu_add_remove_lock); -#else -#define lock_cpu_hotplug() do { } while ( 0 ) -#define unlock_cpu_hotplug() do { } while ( 0 ) -#endif -#endif +/* No Xen contexts can be preempted by CPU hotplug. */ +#define lock_cpu_hotplug() ((void)0) +#define unlock_cpu_hotplug() ((void)0) + +#endif /* __XEN_SMP_H__ */ |