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 | |
16694024 GC |
12 | struct smp_ops { |
13 | void (*smp_prepare_boot_cpu)(void); | |
14 | void (*smp_prepare_cpus)(unsigned max_cpus); | |
15 | int (*cpu_up)(unsigned cpu); | |
16 | void (*smp_cpus_done)(unsigned max_cpus); | |
17 | ||
18 | void (*smp_send_stop)(void); | |
19 | void (*smp_send_reschedule)(int cpu); | |
20 | int (*smp_call_function_mask)(cpumask_t mask, | |
21 | void (*func)(void *info), void *info, | |
22 | int wait); | |
23 | }; | |
24 | ||
14522076 GC |
25 | /* Globals due to paravirt */ |
26 | extern void set_cpu_sibling_map(int cpu); | |
27 | ||
c76cb368 GC |
28 | #ifdef CONFIG_SMP |
29 | extern struct smp_ops smp_ops; | |
8678969e | 30 | |
377d6984 GC |
31 | static inline void smp_send_stop(void) |
32 | { | |
33 | smp_ops.smp_send_stop(); | |
34 | } | |
35 | ||
1e3fac83 GC |
36 | static inline void smp_prepare_boot_cpu(void) |
37 | { | |
38 | smp_ops.smp_prepare_boot_cpu(); | |
39 | } | |
40 | ||
7557da67 GC |
41 | static inline void smp_prepare_cpus(unsigned int max_cpus) |
42 | { | |
43 | smp_ops.smp_prepare_cpus(max_cpus); | |
44 | } | |
45 | ||
c5597649 GC |
46 | static inline void smp_cpus_done(unsigned int max_cpus) |
47 | { | |
48 | smp_ops.smp_cpus_done(max_cpus); | |
49 | } | |
50 | ||
71d19549 GC |
51 | static inline int __cpu_up(unsigned int cpu) |
52 | { | |
53 | return smp_ops.cpu_up(cpu); | |
54 | } | |
55 | ||
8678969e GC |
56 | static inline void smp_send_reschedule(int cpu) |
57 | { | |
58 | smp_ops.smp_send_reschedule(cpu); | |
59 | } | |
64b1a21e GC |
60 | |
61 | static inline int smp_call_function_mask(cpumask_t mask, | |
62 | void (*func) (void *info), void *info, | |
63 | int wait) | |
64 | { | |
65 | return smp_ops.smp_call_function_mask(mask, func, info, wait); | |
66 | } | |
71d19549 | 67 | |
1e3fac83 | 68 | void native_smp_prepare_boot_cpu(void); |
7557da67 | 69 | void native_smp_prepare_cpus(unsigned int max_cpus); |
c5597649 | 70 | void native_smp_cpus_done(unsigned int max_cpus); |
71d19549 | 71 | int native_cpu_up(unsigned int cpunum); |
93b016f8 | 72 | |
69c18c15 GC |
73 | extern int __cpu_disable(void); |
74 | extern void __cpu_die(unsigned int cpu); | |
75 | ||
93b016f8 | 76 | extern unsigned disabled_cpus; |
68a1c3f8 | 77 | extern void prefill_possible_map(void); |
c76cb368 | 78 | #endif |
16694024 | 79 | |
96a388de TG |
80 | #ifdef CONFIG_X86_32 |
81 | # include "smp_32.h" | |
82 | #else | |
83 | # include "smp_64.h" | |
84 | #endif | |
c27cfeff | 85 | |
1dbb4726 GC |
86 | #ifdef CONFIG_HOTPLUG_CPU |
87 | extern void cpu_exit_clear(void); | |
88 | extern void cpu_uninit(void); | |
89 | extern void remove_siblinginfo(int cpu); | |
90 | #endif | |
91 | ||
639acb16 GC |
92 | extern void smp_alloc_memory(void); |
93 | extern void lock_ipi_call_lock(void); | |
94 | extern void unlock_ipi_call_lock(void); | |
c27cfeff GC |
95 | #endif /* __ASSEMBLY__ */ |
96 | #endif |