]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-x86/smp.h
x86: unify extern masks declaration
[linux-2.6-omap-h63xx.git] / include / asm-x86 / smp.h
1 #ifndef _ASM_X86_SMP_H_
2 #define _ASM_X86_SMP_H_
3 #ifndef __ASSEMBLY__
4 #include <linux/cpumask.h>
5 #include <linux/init.h>
6 #include <asm/percpu.h>
7
8 extern cpumask_t cpu_callout_map;
9
10 extern int smp_num_siblings;
11 extern unsigned int num_processors;
12
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;
17
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);
23
24 /*
25  * Trampoline 80x86 program as an array.
26  */
27 extern const unsigned char trampoline_data [];
28 extern const unsigned char trampoline_end  [];
29 extern unsigned char *trampoline_base;
30
31 struct smp_ops {
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);
36
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,
41                                       int wait);
42 };
43
44 /* Globals due to paravirt */
45 extern void set_cpu_sibling_map(int cpu);
46
47 #ifdef CONFIG_SMP
48 #ifndef CONFIG_PARAVIRT
49 #define startup_ipi_hook(phys_apicid, start_eip, start_esp) do { } while (0)
50 #endif
51 extern struct smp_ops smp_ops;
52
53 static inline void smp_send_stop(void)
54 {
55         smp_ops.smp_send_stop();
56 }
57
58 static inline void smp_prepare_boot_cpu(void)
59 {
60         smp_ops.smp_prepare_boot_cpu();
61 }
62
63 static inline void smp_prepare_cpus(unsigned int max_cpus)
64 {
65         smp_ops.smp_prepare_cpus(max_cpus);
66 }
67
68 static inline void smp_cpus_done(unsigned int max_cpus)
69 {
70         smp_ops.smp_cpus_done(max_cpus);
71 }
72
73 static inline int __cpu_up(unsigned int cpu)
74 {
75         return smp_ops.cpu_up(cpu);
76 }
77
78 static inline void smp_send_reschedule(int cpu)
79 {
80         smp_ops.smp_send_reschedule(cpu);
81 }
82
83 static inline int smp_call_function_mask(cpumask_t mask,
84                                          void (*func) (void *info), void *info,
85                                          int wait)
86 {
87         return smp_ops.smp_call_function_mask(mask, func, info, wait);
88 }
89
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);
94
95 extern int __cpu_disable(void);
96 extern void __cpu_die(unsigned int cpu);
97
98 extern unsigned disabled_cpus;
99 extern void prefill_possible_map(void);
100
101 #define SMP_TRAMPOLINE_BASE 0x6000
102 extern unsigned long setup_trampoline(void);
103
104 void smp_store_cpu_info(int id);
105 #endif
106
107 #ifdef CONFIG_X86_32
108 # include "smp_32.h"
109 #else
110 # include "smp_64.h"
111 #endif
112
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);
117 #endif
118
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__ */
123 #endif