Glauber Costa | c27cfef | 2008-03-03 14:12:29 -0300 | [diff] [blame] | 1 | #ifndef _ASM_X86_SMP_H_ |
| 2 | #define _ASM_X86_SMP_H_ |
| 3 | #ifndef __ASSEMBLY__ |
Glauber Costa | 53ebef4 | 2008-03-03 14:12:31 -0300 | [diff] [blame] | 4 | #include <linux/cpumask.h> |
Glauber Costa | 93b016f | 2008-03-03 14:12:40 -0300 | [diff] [blame^] | 5 | #include <linux/init.h> |
Glauber Costa | 53ebef4 | 2008-03-03 14:12:31 -0300 | [diff] [blame] | 6 | |
| 7 | extern cpumask_t cpu_callout_map; |
| 8 | |
| 9 | extern int smp_num_siblings; |
| 10 | extern unsigned int num_processors; |
Glauber Costa | c27cfef | 2008-03-03 14:12:29 -0300 | [diff] [blame] | 11 | |
Glauber Costa | 1669402 | 2008-03-03 14:12:32 -0300 | [diff] [blame] | 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 | |
Glauber Costa | c76cb36 | 2008-03-03 14:12:33 -0300 | [diff] [blame] | 25 | #ifdef CONFIG_SMP |
| 26 | extern struct smp_ops smp_ops; |
Glauber Costa | 8678969 | 2008-03-03 14:12:34 -0300 | [diff] [blame] | 27 | |
Glauber Costa | 1e3fac8 | 2008-03-03 14:12:37 -0300 | [diff] [blame] | 28 | static inline void smp_prepare_boot_cpu(void) |
| 29 | { |
| 30 | smp_ops.smp_prepare_boot_cpu(); |
| 31 | } |
| 32 | |
Glauber Costa | 7557da6 | 2008-03-03 14:12:38 -0300 | [diff] [blame] | 33 | static inline void smp_prepare_cpus(unsigned int max_cpus) |
| 34 | { |
| 35 | smp_ops.smp_prepare_cpus(max_cpus); |
| 36 | } |
| 37 | |
Glauber Costa | c559764 | 2008-03-03 14:12:39 -0300 | [diff] [blame] | 38 | static inline void smp_cpus_done(unsigned int max_cpus) |
| 39 | { |
| 40 | smp_ops.smp_cpus_done(max_cpus); |
| 41 | } |
| 42 | |
Glauber Costa | 71d1954 | 2008-03-03 14:12:36 -0300 | [diff] [blame] | 43 | static inline int __cpu_up(unsigned int cpu) |
| 44 | { |
| 45 | return smp_ops.cpu_up(cpu); |
| 46 | } |
| 47 | |
Glauber Costa | 8678969 | 2008-03-03 14:12:34 -0300 | [diff] [blame] | 48 | static inline void smp_send_reschedule(int cpu) |
| 49 | { |
| 50 | smp_ops.smp_send_reschedule(cpu); |
| 51 | } |
Glauber Costa | 64b1a21e0 | 2008-03-03 14:12:35 -0300 | [diff] [blame] | 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 | } |
Glauber Costa | 71d1954 | 2008-03-03 14:12:36 -0300 | [diff] [blame] | 59 | |
Glauber Costa | 1e3fac8 | 2008-03-03 14:12:37 -0300 | [diff] [blame] | 60 | void native_smp_prepare_boot_cpu(void); |
Glauber Costa | 7557da6 | 2008-03-03 14:12:38 -0300 | [diff] [blame] | 61 | void native_smp_prepare_cpus(unsigned int max_cpus); |
Glauber Costa | c559764 | 2008-03-03 14:12:39 -0300 | [diff] [blame] | 62 | void native_smp_cpus_done(unsigned int max_cpus); |
Glauber Costa | 71d1954 | 2008-03-03 14:12:36 -0300 | [diff] [blame] | 63 | int native_cpu_up(unsigned int cpunum); |
Glauber Costa | 93b016f | 2008-03-03 14:12:40 -0300 | [diff] [blame^] | 64 | |
| 65 | extern unsigned disabled_cpus; |
Glauber Costa | c76cb36 | 2008-03-03 14:12:33 -0300 | [diff] [blame] | 66 | #endif |
Glauber Costa | 1669402 | 2008-03-03 14:12:32 -0300 | [diff] [blame] | 67 | |
Thomas Gleixner | 96a388d | 2007-10-11 11:20:03 +0200 | [diff] [blame] | 68 | #ifdef CONFIG_X86_32 |
| 69 | # include "smp_32.h" |
| 70 | #else |
| 71 | # include "smp_64.h" |
| 72 | #endif |
Glauber Costa | c27cfef | 2008-03-03 14:12:29 -0300 | [diff] [blame] | 73 | |
Glauber Costa | 639acb1 | 2008-03-03 14:12:30 -0300 | [diff] [blame] | 74 | extern void smp_alloc_memory(void); |
| 75 | extern void lock_ipi_call_lock(void); |
| 76 | extern void unlock_ipi_call_lock(void); |
Glauber Costa | c27cfef | 2008-03-03 14:12:29 -0300 | [diff] [blame] | 77 | #endif /* __ASSEMBLY__ */ |
| 78 | #endif |