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
;
31 /* Static state in head.S used to set up a CPU */
39 void (*smp_prepare_boot_cpu
)(void);
40 void (*smp_prepare_cpus
)(unsigned max_cpus
);
41 int (*cpu_up
)(unsigned cpu
);
42 void (*smp_cpus_done
)(unsigned max_cpus
);
44 void (*smp_send_stop
)(void);
45 void (*smp_send_reschedule
)(int cpu
);
46 int (*smp_call_function_mask
)(cpumask_t mask
,
47 void (*func
)(void *info
), void *info
,
51 /* Globals due to paravirt */
52 extern void set_cpu_sibling_map(int cpu
);
55 #ifndef CONFIG_PARAVIRT
56 #define startup_ipi_hook(phys_apicid, start_eip, start_esp) do { } while (0)
58 extern struct smp_ops smp_ops
;
60 static inline void smp_send_stop(void)
62 smp_ops
.smp_send_stop();
65 static inline void smp_prepare_boot_cpu(void)
67 smp_ops
.smp_prepare_boot_cpu();
70 static inline void smp_prepare_cpus(unsigned int max_cpus
)
72 smp_ops
.smp_prepare_cpus(max_cpus
);
75 static inline void smp_cpus_done(unsigned int max_cpus
)
77 smp_ops
.smp_cpus_done(max_cpus
);
80 static inline int __cpu_up(unsigned int cpu
)
82 return smp_ops
.cpu_up(cpu
);
85 static inline void smp_send_reschedule(int cpu
)
87 smp_ops
.smp_send_reschedule(cpu
);
90 static inline int smp_call_function_mask(cpumask_t mask
,
91 void (*func
) (void *info
), void *info
,
94 return smp_ops
.smp_call_function_mask(mask
, func
, info
, wait
);
97 void native_smp_prepare_boot_cpu(void);
98 void native_smp_prepare_cpus(unsigned int max_cpus
);
99 void native_smp_cpus_done(unsigned int max_cpus
);
100 int native_cpu_up(unsigned int cpunum
);
102 extern int __cpu_disable(void);
103 extern void __cpu_die(unsigned int cpu
);
105 extern unsigned disabled_cpus
;
106 extern void prefill_possible_map(void);
108 #define SMP_TRAMPOLINE_BASE 0x6000
109 extern unsigned long setup_trampoline(void);
111 void smp_store_cpu_info(int id
);
112 #define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu)
114 #define cpu_physical_id(cpu) boot_cpu_physical_apicid
123 #ifdef CONFIG_HOTPLUG_CPU
124 extern void cpu_exit_clear(void);
125 extern void cpu_uninit(void);
126 extern void remove_siblinginfo(int cpu
);
129 extern void smp_alloc_memory(void);
130 extern void lock_ipi_call_lock(void);
131 extern void unlock_ipi_call_lock(void);
132 #endif /* __ASSEMBLY__ */