Commit | Line | Data |
---|---|---|
c27cfeff GC |
1 | #ifndef _ASM_X86_SMP_H_ |
2 | #define _ASM_X86_SMP_H_ | |
3 | #ifndef __ASSEMBLY__ | |
53ebef49 | 4 | #include <linux/cpumask.h> |
93b016f8 | 5 | #include <linux/init.h> |
53ebef49 GC |
6 | |
7 | extern cpumask_t cpu_callout_map; | |
8 | ||
9 | extern int smp_num_siblings; | |
10 | extern unsigned int num_processors; | |
c27cfeff | 11 | |
42068829 GC |
12 | /* |
13 | * Trampoline 80x86 program as an array. | |
14 | */ | |
15 | extern const unsigned char trampoline_data []; | |
16 | extern const unsigned char trampoline_end []; | |
91718e8d | 17 | extern unsigned char *trampoline_base; |
42068829 | 18 | |
16694024 GC |
19 | struct smp_ops { |
20 | void (*smp_prepare_boot_cpu)(void); | |
21 | void (*smp_prepare_cpus)(unsigned max_cpus); | |
22 | int (*cpu_up)(unsigned cpu); | |
23 | void (*smp_cpus_done)(unsigned max_cpus); | |
24 | ||
25 | void (*smp_send_stop)(void); | |
26 | void (*smp_send_reschedule)(int cpu); | |
27 | int (*smp_call_function_mask)(cpumask_t mask, | |
28 | void (*func)(void *info), void *info, | |
29 | int wait); | |
30 | }; | |
31 | ||
14522076 GC |
32 | /* Globals due to paravirt */ |
33 | extern void set_cpu_sibling_map(int cpu); | |
34 | ||
c76cb368 | 35 | #ifdef CONFIG_SMP |
d0173aea GOC |
36 | #ifndef CONFIG_PARAVIRT |
37 | #define startup_ipi_hook(phys_apicid, start_eip, start_esp) do { } while (0) | |
38 | #endif | |
c76cb368 | 39 | extern struct smp_ops smp_ops; |
8678969e | 40 | |
377d6984 GC |
41 | static inline void smp_send_stop(void) |
42 | { | |
43 | smp_ops.smp_send_stop(); | |
44 | } | |
45 | ||
1e3fac83 GC |
46 | static inline void smp_prepare_boot_cpu(void) |
47 | { | |
48 | smp_ops.smp_prepare_boot_cpu(); | |
49 | } | |
50 | ||
7557da67 GC |
51 | static inline void smp_prepare_cpus(unsigned int max_cpus) |
52 | { | |
53 | smp_ops.smp_prepare_cpus(max_cpus); | |
54 | } | |
55 | ||
c5597649 GC |
56 | static inline void smp_cpus_done(unsigned int max_cpus) |
57 | { | |
58 | smp_ops.smp_cpus_done(max_cpus); | |
59 | } | |
60 | ||
71d19549 GC |
61 | static inline int __cpu_up(unsigned int cpu) |
62 | { | |
63 | return smp_ops.cpu_up(cpu); | |
64 | } | |
65 | ||
8678969e GC |
66 | static inline void smp_send_reschedule(int cpu) |
67 | { | |
68 | smp_ops.smp_send_reschedule(cpu); | |
69 | } | |
64b1a21e GC |
70 | |
71 | static inline int smp_call_function_mask(cpumask_t mask, | |
72 | void (*func) (void *info), void *info, | |
73 | int wait) | |
74 | { | |
75 | return smp_ops.smp_call_function_mask(mask, func, info, wait); | |
76 | } | |
71d19549 | 77 | |
1e3fac83 | 78 | void native_smp_prepare_boot_cpu(void); |
7557da67 | 79 | void native_smp_prepare_cpus(unsigned int max_cpus); |
c5597649 | 80 | void native_smp_cpus_done(unsigned int max_cpus); |
71d19549 | 81 | int native_cpu_up(unsigned int cpunum); |
93b016f8 | 82 | |
69c18c15 GC |
83 | extern int __cpu_disable(void); |
84 | extern void __cpu_die(unsigned int cpu); | |
85 | ||
93b016f8 | 86 | extern unsigned disabled_cpus; |
68a1c3f8 | 87 | extern void prefill_possible_map(void); |
91718e8d GC |
88 | |
89 | #define SMP_TRAMPOLINE_BASE 0x6000 | |
90 | extern unsigned long setup_trampoline(void); | |
1d89a7f0 GOC |
91 | |
92 | void smp_store_cpu_info(int id); | |
c76cb368 | 93 | #endif |
16694024 | 94 | |
96a388de TG |
95 | #ifdef CONFIG_X86_32 |
96 | # include "smp_32.h" | |
97 | #else | |
98 | # include "smp_64.h" | |
99 | #endif | |
c27cfeff | 100 | |
1dbb4726 GC |
101 | #ifdef CONFIG_HOTPLUG_CPU |
102 | extern void cpu_exit_clear(void); | |
103 | extern void cpu_uninit(void); | |
104 | extern void remove_siblinginfo(int cpu); | |
105 | #endif | |
106 | ||
639acb16 GC |
107 | extern void smp_alloc_memory(void); |
108 | extern void lock_ipi_call_lock(void); | |
109 | extern void unlock_ipi_call_lock(void); | |
c27cfeff GC |
110 | #endif /* __ASSEMBLY__ */ |
111 | #endif |