1 #ifndef _ASM_X86_SMP_H_
2 #define _ASM_X86_SMP_H_
4 #include <linux/cpumask.h>
5 #include <linux/init.h>
6 #include <asm/percpu.h>
8 extern cpumask_t cpu_callout_map;
10 extern int smp_num_siblings;
11 extern unsigned int num_processors;
13 extern u16 x86_cpu_to_apicid_init[];
14 extern u16 x86_bios_cpu_apicid_init[];
15 extern void *x86_cpu_to_apicid_early_ptr;
16 extern void *x86_bios_cpu_apicid_early_ptr;
18 DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
19 DECLARE_PER_CPU(cpumask_t, cpu_core_map);
20 DECLARE_PER_CPU(u16, cpu_llc_id);
21 DECLARE_PER_CPU(u16, x86_cpu_to_apicid);
22 DECLARE_PER_CPU(u16, x86_bios_cpu_apicid);
25 * Trampoline 80x86 program as an array.
27 extern const unsigned char trampoline_data [];
28 extern const unsigned char trampoline_end [];
29 extern unsigned char *trampoline_base;
32 void (*smp_prepare_boot_cpu)(void);
33 void (*smp_prepare_cpus)(unsigned max_cpus);
34 int (*cpu_up)(unsigned cpu);
35 void (*smp_cpus_done)(unsigned max_cpus);
37 void (*smp_send_stop)(void);
38 void (*smp_send_reschedule)(int cpu);
39 int (*smp_call_function_mask)(cpumask_t mask,
40 void (*func)(void *info), void *info,
44 /* Globals due to paravirt */
45 extern void set_cpu_sibling_map(int cpu);
48 #ifndef CONFIG_PARAVIRT
49 #define startup_ipi_hook(phys_apicid, start_eip, start_esp) do { } while (0)
51 extern struct smp_ops smp_ops;
53 static inline void smp_send_stop(void)
55 smp_ops.smp_send_stop();
58 static inline void smp_prepare_boot_cpu(void)
60 smp_ops.smp_prepare_boot_cpu();
63 static inline void smp_prepare_cpus(unsigned int max_cpus)
65 smp_ops.smp_prepare_cpus(max_cpus);
68 static inline void smp_cpus_done(unsigned int max_cpus)
70 smp_ops.smp_cpus_done(max_cpus);
73 static inline int __cpu_up(unsigned int cpu)
75 return smp_ops.cpu_up(cpu);
78 static inline void smp_send_reschedule(int cpu)
80 smp_ops.smp_send_reschedule(cpu);
83 static inline int smp_call_function_mask(cpumask_t mask,
84 void (*func) (void *info), void *info,
87 return smp_ops.smp_call_function_mask(mask, func, info, wait);
90 void native_smp_prepare_boot_cpu(void);
91 void native_smp_prepare_cpus(unsigned int max_cpus);
92 void native_smp_cpus_done(unsigned int max_cpus);
93 int native_cpu_up(unsigned int cpunum);
95 extern int __cpu_disable(void);
96 extern void __cpu_die(unsigned int cpu);
98 extern unsigned disabled_cpus;
99 extern void prefill_possible_map(void);
101 #define SMP_TRAMPOLINE_BASE 0x6000
102 extern unsigned long setup_trampoline(void);
104 void smp_store_cpu_info(int id);
113 #ifdef CONFIG_HOTPLUG_CPU
114 extern void cpu_exit_clear(void);
115 extern void cpu_uninit(void);
116 extern void remove_siblinginfo(int cpu);
119 extern void smp_alloc_memory(void);
120 extern void lock_ipi_call_lock(void);
121 extern void unlock_ipi_call_lock(void);
122 #endif /* __ASSEMBLY__ */