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 | ||
c76cb368 GC |
25 | #ifdef CONFIG_SMP |
26 | extern struct smp_ops smp_ops; | |
8678969e | 27 | |
1e3fac83 GC |
28 | static inline void smp_prepare_boot_cpu(void) |
29 | { | |
30 | smp_ops.smp_prepare_boot_cpu(); | |
31 | } | |
32 | ||
7557da67 GC |
33 | static inline void smp_prepare_cpus(unsigned int max_cpus) |
34 | { | |
35 | smp_ops.smp_prepare_cpus(max_cpus); | |
36 | } | |
37 | ||
c5597649 GC |
38 | static inline void smp_cpus_done(unsigned int max_cpus) |
39 | { | |
40 | smp_ops.smp_cpus_done(max_cpus); | |
41 | } | |
42 | ||
71d19549 GC |
43 | static inline int __cpu_up(unsigned int cpu) |
44 | { | |
45 | return smp_ops.cpu_up(cpu); | |
46 | } | |
47 | ||
8678969e GC |
48 | static inline void smp_send_reschedule(int cpu) |
49 | { | |
50 | smp_ops.smp_send_reschedule(cpu); | |
51 | } | |
64b1a21e GC |
52 | |
53 | static inline int smp_call_function_mask(cpumask_t mask, | |
54 | void (*func) (void *info), void *info, | |
55 | int wait) | |
56 | { | |
57 | return smp_ops.smp_call_function_mask(mask, func, info, wait); | |
58 | } | |
71d19549 | 59 | |
1e3fac83 | 60 | void native_smp_prepare_boot_cpu(void); |
7557da67 | 61 | void native_smp_prepare_cpus(unsigned int max_cpus); |
c5597649 | 62 | void native_smp_cpus_done(unsigned int max_cpus); |
71d19549 | 63 | int native_cpu_up(unsigned int cpunum); |
93b016f8 GC |
64 | |
65 | extern unsigned disabled_cpus; | |
c76cb368 | 66 | #endif |
16694024 | 67 | |
96a388de TG |
68 | #ifdef CONFIG_X86_32 |
69 | # include "smp_32.h" | |
70 | #else | |
71 | # include "smp_64.h" | |
72 | #endif | |
c27cfeff | 73 | |
639acb16 GC |
74 | extern void smp_alloc_memory(void); |
75 | extern void lock_ipi_call_lock(void); | |
76 | extern void unlock_ipi_call_lock(void); | |
c27cfeff GC |
77 | #endif /* __ASSEMBLY__ */ |
78 | #endif |