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> |
| 5 | |
| 6 | extern cpumask_t cpu_callout_map; |
| 7 | |
| 8 | extern int smp_num_siblings; |
| 9 | extern unsigned int num_processors; |
Glauber Costa | c27cfef | 2008-03-03 14:12:29 -0300 | [diff] [blame] | 10 | |
Glauber Costa | 1669402 | 2008-03-03 14:12:32 -0300 | [diff] [blame] | 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 | |
Glauber Costa | c76cb36 | 2008-03-03 14:12:33 -0300 | [diff] [blame] | 24 | #ifdef CONFIG_SMP |
| 25 | extern struct smp_ops smp_ops; |
Glauber Costa | 8678969 | 2008-03-03 14:12:34 -0300 | [diff] [blame] | 26 | |
Glauber Costa | 1e3fac8 | 2008-03-03 14:12:37 -0300 | [diff] [blame^] | 27 | static inline void smp_prepare_boot_cpu(void) |
| 28 | { |
| 29 | smp_ops.smp_prepare_boot_cpu(); |
| 30 | } |
| 31 | |
Glauber Costa | 71d1954 | 2008-03-03 14:12:36 -0300 | [diff] [blame] | 32 | static inline int __cpu_up(unsigned int cpu) |
| 33 | { |
| 34 | return smp_ops.cpu_up(cpu); |
| 35 | } |
| 36 | |
Glauber Costa | 8678969 | 2008-03-03 14:12:34 -0300 | [diff] [blame] | 37 | static inline void smp_send_reschedule(int cpu) |
| 38 | { |
| 39 | smp_ops.smp_send_reschedule(cpu); |
| 40 | } |
Glauber Costa | 64b1a21 | 2008-03-03 14:12:35 -0300 | [diff] [blame] | 41 | |
| 42 | static inline int smp_call_function_mask(cpumask_t mask, |
| 43 | void (*func) (void *info), void *info, |
| 44 | int wait) |
| 45 | { |
| 46 | return smp_ops.smp_call_function_mask(mask, func, info, wait); |
| 47 | } |
Glauber Costa | 71d1954 | 2008-03-03 14:12:36 -0300 | [diff] [blame] | 48 | |
Glauber Costa | 1e3fac8 | 2008-03-03 14:12:37 -0300 | [diff] [blame^] | 49 | void native_smp_prepare_boot_cpu(void); |
Glauber Costa | 71d1954 | 2008-03-03 14:12:36 -0300 | [diff] [blame] | 50 | int native_cpu_up(unsigned int cpunum); |
Glauber Costa | c76cb36 | 2008-03-03 14:12:33 -0300 | [diff] [blame] | 51 | #endif |
Glauber Costa | 1669402 | 2008-03-03 14:12:32 -0300 | [diff] [blame] | 52 | |
Thomas Gleixner | 96a388d | 2007-10-11 11:20:03 +0200 | [diff] [blame] | 53 | #ifdef CONFIG_X86_32 |
| 54 | # include "smp_32.h" |
| 55 | #else |
| 56 | # include "smp_64.h" |
| 57 | #endif |
Glauber Costa | c27cfef | 2008-03-03 14:12:29 -0300 | [diff] [blame] | 58 | |
Glauber Costa | 639acb1 | 2008-03-03 14:12:30 -0300 | [diff] [blame] | 59 | extern void smp_alloc_memory(void); |
| 60 | extern void lock_ipi_call_lock(void); |
| 61 | extern void unlock_ipi_call_lock(void); |
Glauber Costa | c27cfef | 2008-03-03 14:12:29 -0300 | [diff] [blame] | 62 | #endif /* __ASSEMBLY__ */ |
| 63 | #endif |