ia64/xen-unstable

view xen/include/asm-x86/smp.h @ 19848:5839491bbf20

[IA64] replace MAX_VCPUS with d->max_vcpus where necessary.

don't use MAX_VCPUS, and use vcpu::max_vcpus.
The changeset of 2f9e1348aa98 introduced max_vcpus to allow more vcpus
per guest. This patch is ia64 counter part.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 11:26:05 2009 +0900 (2009-06-29)
parents 822ea2bf0c54
children
line source
1 #ifndef __ASM_SMP_H
2 #define __ASM_SMP_H
4 /*
5 * We need the APIC definitions automatically as part of 'smp.h'
6 */
7 #ifndef __ASSEMBLY__
8 #include <xen/config.h>
9 #include <xen/kernel.h>
10 #include <xen/cpumask.h>
11 #include <asm/current.h>
12 #endif
14 #ifdef CONFIG_X86_LOCAL_APIC
15 #ifndef __ASSEMBLY__
16 #include <asm/bitops.h>
17 #include <asm/mpspec.h>
18 #ifdef CONFIG_X86_IO_APIC
19 #include <asm/io_apic.h>
20 #endif
21 #include <asm/apic.h>
22 #endif
23 #endif
25 #define BAD_APICID -1U
26 #ifdef CONFIG_SMP
27 #ifndef __ASSEMBLY__
29 /*
30 * Private routines/data
31 */
33 extern void smp_alloc_memory(void);
34 extern int pic_mode;
35 extern cpumask_t cpu_sibling_map[];
36 extern cpumask_t cpu_core_map[];
38 void smp_send_nmi_allbutself(void);
40 extern void (*mtrr_hook) (void);
42 #ifdef CONFIG_X86_64
43 extern void zap_low_mappings(void);
44 #else
45 extern void zap_low_mappings(l2_pgentry_t *base);
46 #endif
48 #define MAX_APICID 256
49 extern u32 x86_cpu_to_apicid[];
51 #define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
53 /* State of each CPU. */
54 #define CPU_ONLINE 0x0002 /* CPU is up */
55 #define CPU_DEAD 0x0004 /* CPU is dead */
56 DECLARE_PER_CPU(int, cpu_state);
58 #ifdef CONFIG_HOTPLUG_CPU
59 #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
60 extern int cpu_down(unsigned int cpu);
61 extern int cpu_up(unsigned int cpu);
62 extern void cpu_exit_clear(void);
63 extern void cpu_uninit(void);
64 extern void disable_nonboot_cpus(void);
65 extern void enable_nonboot_cpus(void);
66 #else
67 static inline int cpu_is_offline(int cpu) {return 0;}
68 static inline void disable_nonboot_cpus(void) {}
69 static inline void enable_nonboot_cpus(void) {}
70 #endif
72 /*
73 * This function is needed by all SMP systems. It must _always_ be valid
74 * from the initial startup. We map APIC_BASE very early in page_setup(),
75 * so this is correct in the x86 case.
76 */
77 #define raw_smp_processor_id() (get_processor_id())
79 extern cpumask_t cpu_callout_map;
80 extern cpumask_t cpu_callin_map;
81 extern cpumask_t cpu_possible_map;
83 /* We don't mark CPUs online until __cpu_up(), so we need another measure */
84 static inline int num_booting_cpus(void)
85 {
86 return cpus_weight(cpu_callout_map);
87 }
89 #ifdef CONFIG_X86_LOCAL_APIC
91 static inline int hard_smp_processor_id(void)
92 {
93 /* we don't want to mark this access volatile - bad code generation */
94 return get_apic_id();
95 }
97 static __inline int logical_smp_processor_id(void)
98 {
99 /* we don't want to mark this access volatile - bad code generation */
100 return get_logical_apic_id();
101 }
103 #endif
105 extern int __cpu_disable(void);
106 extern void __cpu_die(unsigned int cpu);
107 #endif /* !__ASSEMBLY__ */
109 #else /* CONFIG_SMP */
111 #define cpu_physical_id(cpu) boot_cpu_physical_apicid
113 #define NO_PROC_ID 0xFF /* No processor magic marker */
115 #endif
116 #endif