blob: 9620165d3b78d3c12f864d193cd6dc6445399d20 [file] [log] [blame]
Glauber Costac27cfef2008-03-03 14:12:29 -03001#ifndef _ASM_X86_SMP_H_
2#define _ASM_X86_SMP_H_
3#ifndef __ASSEMBLY__
Glauber Costa53ebef42008-03-03 14:12:31 -03004#include <linux/cpumask.h>
5
6extern cpumask_t cpu_callout_map;
7
8extern int smp_num_siblings;
9extern unsigned int num_processors;
Glauber Costac27cfef2008-03-03 14:12:29 -030010
Glauber Costa16694022008-03-03 14:12:32 -030011struct 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 Costac76cb362008-03-03 14:12:33 -030024#ifdef CONFIG_SMP
25extern struct smp_ops smp_ops;
Glauber Costa86789692008-03-03 14:12:34 -030026
Glauber Costa1e3fac82008-03-03 14:12:37 -030027static inline void smp_prepare_boot_cpu(void)
28{
29 smp_ops.smp_prepare_boot_cpu();
30}
31
Glauber Costa7557da62008-03-03 14:12:38 -030032static inline void smp_prepare_cpus(unsigned int max_cpus)
33{
34 smp_ops.smp_prepare_cpus(max_cpus);
35}
36
Glauber Costac5597642008-03-03 14:12:39 -030037static inline void smp_cpus_done(unsigned int max_cpus)
38{
39 smp_ops.smp_cpus_done(max_cpus);
40}
41
Glauber Costa71d19542008-03-03 14:12:36 -030042static inline int __cpu_up(unsigned int cpu)
43{
44 return smp_ops.cpu_up(cpu);
45}
46
Glauber Costa86789692008-03-03 14:12:34 -030047static inline void smp_send_reschedule(int cpu)
48{
49 smp_ops.smp_send_reschedule(cpu);
50}
Glauber Costa64b1a21e02008-03-03 14:12:35 -030051
52static 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}
Glauber Costa71d19542008-03-03 14:12:36 -030058
Glauber Costa1e3fac82008-03-03 14:12:37 -030059void native_smp_prepare_boot_cpu(void);
Glauber Costa7557da62008-03-03 14:12:38 -030060void native_smp_prepare_cpus(unsigned int max_cpus);
Glauber Costac5597642008-03-03 14:12:39 -030061void native_smp_cpus_done(unsigned int max_cpus);
Glauber Costa71d19542008-03-03 14:12:36 -030062int native_cpu_up(unsigned int cpunum);
Glauber Costac76cb362008-03-03 14:12:33 -030063#endif
Glauber Costa16694022008-03-03 14:12:32 -030064
Thomas Gleixner96a388d2007-10-11 11:20:03 +020065#ifdef CONFIG_X86_32
66# include "smp_32.h"
67#else
68# include "smp_64.h"
69#endif
Glauber Costac27cfef2008-03-03 14:12:29 -030070
Glauber Costa639acb12008-03-03 14:12:30 -030071extern void smp_alloc_memory(void);
72extern void lock_ipi_call_lock(void);
73extern void unlock_ipi_call_lock(void);
Glauber Costac27cfef2008-03-03 14:12:29 -030074#endif /* __ASSEMBLY__ */
75#endif