x86: merge __cpu_disable and cpu_die
[linux-2.6] / 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
7 extern cpumask_t cpu_callout_map;
8
9 extern int smp_num_siblings;
10 extern unsigned int num_processors;
11
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
25 /* Globals due to paravirt */
26 extern void set_cpu_sibling_map(int cpu);
27
28 #ifdef CONFIG_SMP
29 extern struct smp_ops smp_ops;
30
31 static inline void smp_send_stop(void)
32 {
33         smp_ops.smp_send_stop();
34 }
35
36 static inline void smp_prepare_boot_cpu(void)
37 {
38         smp_ops.smp_prepare_boot_cpu();
39 }
40
41 static inline void smp_prepare_cpus(unsigned int max_cpus)
42 {
43         smp_ops.smp_prepare_cpus(max_cpus);
44 }
45
46 static inline void smp_cpus_done(unsigned int max_cpus)
47 {
48         smp_ops.smp_cpus_done(max_cpus);
49 }
50
51 static inline int __cpu_up(unsigned int cpu)
52 {
53         return smp_ops.cpu_up(cpu);
54 }
55
56 static inline void smp_send_reschedule(int cpu)
57 {
58         smp_ops.smp_send_reschedule(cpu);
59 }
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 }
67
68 void native_smp_prepare_boot_cpu(void);
69 void native_smp_prepare_cpus(unsigned int max_cpus);
70 void native_smp_cpus_done(unsigned int max_cpus);
71 int native_cpu_up(unsigned int cpunum);
72
73 extern int __cpu_disable(void);
74 extern void __cpu_die(unsigned int cpu);
75
76 extern unsigned disabled_cpus;
77 extern void prefill_possible_map(void);
78 #endif
79
80 #ifdef CONFIG_X86_32
81 # include "smp_32.h"
82 #else
83 # include "smp_64.h"
84 #endif
85
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
92 extern void smp_alloc_memory(void);
93 extern void lock_ipi_call_lock(void);
94 extern void unlock_ipi_call_lock(void);
95 #endif /* __ASSEMBLY__ */
96 #endif