Commit | Line | Data |
---|---|---|
c27cfeff GC |
1 | #ifndef _ASM_X86_SMP_H_ |
2 | #define _ASM_X86_SMP_H_ | |
3 | #ifndef __ASSEMBLY__ | |
53ebef49 GC |
4 | #include <linux/cpumask.h> |
5 | ||
6 | extern cpumask_t cpu_callout_map; | |
7 | ||
8 | extern int smp_num_siblings; | |
9 | extern unsigned int num_processors; | |
c27cfeff | 10 | |
16694024 GC |
11 | struct smp_ops { |
12 | void (*smp_prepare_boot_cpu)(void); | |
13 | void (*smp_prepare_cpus)(unsigned max_cpus); | |
14 | int (*cpu_up)(unsigned cpu); | |
15 | void (*smp_cpus_done)(unsigned max_cpus); | |
16 | ||
17 | void (*smp_send_stop)(void); | |
18 | void (*smp_send_reschedule)(int cpu); | |
19 | int (*smp_call_function_mask)(cpumask_t mask, | |
20 | void (*func)(void *info), void *info, | |
21 | int wait); | |
22 | }; | |
23 | ||
c76cb368 GC |
24 | #ifdef CONFIG_SMP |
25 | extern struct smp_ops smp_ops; | |
8678969e | 26 | |
1e3fac83 GC |
27 | static inline void smp_prepare_boot_cpu(void) |
28 | { | |
29 | smp_ops.smp_prepare_boot_cpu(); | |
30 | } | |
31 | ||
7557da67 GC |
32 | static inline void smp_prepare_cpus(unsigned int max_cpus) |
33 | { | |
34 | smp_ops.smp_prepare_cpus(max_cpus); | |
35 | } | |
36 | ||
71d19549 GC |
37 | static inline int __cpu_up(unsigned int cpu) |
38 | { | |
39 | return smp_ops.cpu_up(cpu); | |
40 | } | |
41 | ||
8678969e GC |
42 | static inline void smp_send_reschedule(int cpu) |
43 | { | |
44 | smp_ops.smp_send_reschedule(cpu); | |
45 | } | |
64b1a21e GC |
46 | |
47 | static inline int smp_call_function_mask(cpumask_t mask, | |
48 | void (*func) (void *info), void *info, | |
49 | int wait) | |
50 | { | |
51 | return smp_ops.smp_call_function_mask(mask, func, info, wait); | |
52 | } | |
71d19549 | 53 | |
1e3fac83 | 54 | void native_smp_prepare_boot_cpu(void); |
7557da67 | 55 | void native_smp_prepare_cpus(unsigned int max_cpus); |
71d19549 | 56 | int native_cpu_up(unsigned int cpunum); |
c76cb368 | 57 | #endif |
16694024 | 58 | |
96a388de TG |
59 | #ifdef CONFIG_X86_32 |
60 | # include "smp_32.h" | |
61 | #else | |
62 | # include "smp_64.h" | |
63 | #endif | |
c27cfeff | 64 | |
639acb16 GC |
65 | extern void smp_alloc_memory(void); |
66 | extern void lock_ipi_call_lock(void); | |
67 | extern void unlock_ipi_call_lock(void); | |
c27cfeff GC |
68 | #endif /* __ASSEMBLY__ */ |
69 | #endif |