]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-x86/smp.h
9620165d3b78d3c12f864d193cd6dc6445399d20
[linux-2.6-omap-h63xx.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
6 extern cpumask_t cpu_callout_map;
7
8 extern int smp_num_siblings;
9 extern unsigned int num_processors;
10
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
24 #ifdef CONFIG_SMP
25 extern struct smp_ops smp_ops;
26
27 static inline void smp_prepare_boot_cpu(void)
28 {
29         smp_ops.smp_prepare_boot_cpu();
30 }
31
32 static inline void smp_prepare_cpus(unsigned int max_cpus)
33 {
34         smp_ops.smp_prepare_cpus(max_cpus);
35 }
36
37 static inline void smp_cpus_done(unsigned int max_cpus)
38 {
39         smp_ops.smp_cpus_done(max_cpus);
40 }
41
42 static inline int __cpu_up(unsigned int cpu)
43 {
44         return smp_ops.cpu_up(cpu);
45 }
46
47 static inline void smp_send_reschedule(int cpu)
48 {
49         smp_ops.smp_send_reschedule(cpu);
50 }
51
52 static inline int smp_call_function_mask(cpumask_t mask,
53                                          void (*func) (void *info), void *info,
54                                          int wait)
55 {
56         return smp_ops.smp_call_function_mask(mask, func, info, wait);
57 }
58
59 void native_smp_prepare_boot_cpu(void);
60 void native_smp_prepare_cpus(unsigned int max_cpus);
61 void native_smp_cpus_done(unsigned int max_cpus);
62 int native_cpu_up(unsigned int cpunum);
63 #endif
64
65 #ifdef CONFIG_X86_32
66 # include "smp_32.h"
67 #else
68 # include "smp_64.h"
69 #endif
70
71 extern void smp_alloc_memory(void);
72 extern void lock_ipi_call_lock(void);
73 extern void unlock_ipi_call_lock(void);
74 #endif /* __ASSEMBLY__ */
75 #endif