]> git.karo-electronics.de Git - karo-tx-linux.git/blob - include/asm-x86/smp.h
x86: move hotplug related extern definitions to smp.h
[karo-tx-linux.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
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 unsigned disabled_cpus;
74 extern void prefill_possible_map(void);
75 #endif
76
77 #ifdef CONFIG_X86_32
78 # include "smp_32.h"
79 #else
80 # include "smp_64.h"
81 #endif
82
83 #ifdef CONFIG_HOTPLUG_CPU
84 extern void cpu_exit_clear(void);
85 extern void cpu_uninit(void);
86 extern void remove_siblinginfo(int cpu);
87 #endif
88
89 extern void smp_alloc_memory(void);
90 extern void lock_ipi_call_lock(void);
91 extern void unlock_ipi_call_lock(void);
92 #endif /* __ASSEMBLY__ */
93 #endif