blob: c800b815d378c9fd014cb1cf4162b39da1ca1d49 [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>
Glauber Costa93b016f2008-03-03 14:12:40 -03005#include <linux/init.h>
Glauber Costa53ebef42008-03-03 14:12:31 -03006
7extern cpumask_t cpu_callout_map;
8
9extern int smp_num_siblings;
10extern unsigned int num_processors;
Glauber Costac27cfef2008-03-03 14:12:29 -030011
Glauber Costa16694022008-03-03 14:12:32 -030012struct 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 Costa14522072008-03-03 14:12:59 -030025/* Globals due to paravirt */
26extern void set_cpu_sibling_map(int cpu);
27
Glauber Costac76cb362008-03-03 14:12:33 -030028#ifdef CONFIG_SMP
29extern struct smp_ops smp_ops;
Glauber Costa86789692008-03-03 14:12:34 -030030
Glauber Costa377d6982008-03-03 14:12:51 -030031static inline void smp_send_stop(void)
32{
33 smp_ops.smp_send_stop();
34}
35
Glauber Costa1e3fac82008-03-03 14:12:37 -030036static inline void smp_prepare_boot_cpu(void)
37{
38 smp_ops.smp_prepare_boot_cpu();
39}
40
Glauber Costa7557da62008-03-03 14:12:38 -030041static inline void smp_prepare_cpus(unsigned int max_cpus)
42{
43 smp_ops.smp_prepare_cpus(max_cpus);
44}
45
Glauber Costac5597642008-03-03 14:12:39 -030046static inline void smp_cpus_done(unsigned int max_cpus)
47{
48 smp_ops.smp_cpus_done(max_cpus);
49}
50
Glauber Costa71d19542008-03-03 14:12:36 -030051static inline int __cpu_up(unsigned int cpu)
52{
53 return smp_ops.cpu_up(cpu);
54}
55
Glauber Costa86789692008-03-03 14:12:34 -030056static inline void smp_send_reschedule(int cpu)
57{
58 smp_ops.smp_send_reschedule(cpu);
59}
Glauber Costa64b1a21e02008-03-03 14:12:35 -030060
61static inline int smp_call_function_mask(cpumask_t mask,
62 void (*func) (void *info), void *info,
63 int wait)
64{
65 return smp_ops.smp_call_function_mask(mask, func, info, wait);
66}
Glauber Costa71d19542008-03-03 14:12:36 -030067
Glauber Costa1e3fac82008-03-03 14:12:37 -030068void native_smp_prepare_boot_cpu(void);
Glauber Costa7557da62008-03-03 14:12:38 -030069void native_smp_prepare_cpus(unsigned int max_cpus);
Glauber Costac5597642008-03-03 14:12:39 -030070void native_smp_cpus_done(unsigned int max_cpus);
Glauber Costa71d19542008-03-03 14:12:36 -030071int native_cpu_up(unsigned int cpunum);
Glauber Costa93b016f2008-03-03 14:12:40 -030072
73extern unsigned disabled_cpus;
Glauber Costa68a1c3f2008-03-03 14:12:42 -030074extern void prefill_possible_map(void);
Glauber Costac76cb362008-03-03 14:12:33 -030075#endif
Glauber Costa16694022008-03-03 14:12:32 -030076
Thomas Gleixner96a388d2007-10-11 11:20:03 +020077#ifdef CONFIG_X86_32
78# include "smp_32.h"
79#else
80# include "smp_64.h"
81#endif
Glauber Costac27cfef2008-03-03 14:12:29 -030082
Glauber Costa1dbb4722008-03-03 14:13:01 -030083#ifdef CONFIG_HOTPLUG_CPU
84extern void cpu_exit_clear(void);
85extern void cpu_uninit(void);
86extern void remove_siblinginfo(int cpu);
87#endif
88
Glauber Costa639acb12008-03-03 14:12:30 -030089extern void smp_alloc_memory(void);
90extern void lock_ipi_call_lock(void);
91extern void unlock_ipi_call_lock(void);
Glauber Costac27cfef2008-03-03 14:12:29 -030092#endif /* __ASSEMBLY__ */
93#endif