blob: b2a1697e4700a90babdbb60bcb490063eef7f858 [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 Costa42068822008-03-03 14:13:09 -030012/*
13 * Trampoline 80x86 program as an array.
14 */
15extern const unsigned char trampoline_data [];
16extern const unsigned char trampoline_end [];
17
Glauber Costa16694022008-03-03 14:12:32 -030018struct smp_ops {
19 void (*smp_prepare_boot_cpu)(void);
20 void (*smp_prepare_cpus)(unsigned max_cpus);
21 int (*cpu_up)(unsigned cpu);
22 void (*smp_cpus_done)(unsigned max_cpus);
23
24 void (*smp_send_stop)(void);
25 void (*smp_send_reschedule)(int cpu);
26 int (*smp_call_function_mask)(cpumask_t mask,
27 void (*func)(void *info), void *info,
28 int wait);
29};
30
Glauber Costa14522072008-03-03 14:12:59 -030031/* Globals due to paravirt */
32extern void set_cpu_sibling_map(int cpu);
33
Glauber Costac76cb362008-03-03 14:12:33 -030034#ifdef CONFIG_SMP
35extern struct smp_ops smp_ops;
Glauber Costa86789692008-03-03 14:12:34 -030036
Glauber Costa377d6982008-03-03 14:12:51 -030037static inline void smp_send_stop(void)
38{
39 smp_ops.smp_send_stop();
40}
41
Glauber Costa1e3fac82008-03-03 14:12:37 -030042static inline void smp_prepare_boot_cpu(void)
43{
44 smp_ops.smp_prepare_boot_cpu();
45}
46
Glauber Costa7557da62008-03-03 14:12:38 -030047static inline void smp_prepare_cpus(unsigned int max_cpus)
48{
49 smp_ops.smp_prepare_cpus(max_cpus);
50}
51
Glauber Costac5597642008-03-03 14:12:39 -030052static inline void smp_cpus_done(unsigned int max_cpus)
53{
54 smp_ops.smp_cpus_done(max_cpus);
55}
56
Glauber Costa71d19542008-03-03 14:12:36 -030057static inline int __cpu_up(unsigned int cpu)
58{
59 return smp_ops.cpu_up(cpu);
60}
61
Glauber Costa86789692008-03-03 14:12:34 -030062static inline void smp_send_reschedule(int cpu)
63{
64 smp_ops.smp_send_reschedule(cpu);
65}
Glauber Costa64b1a212008-03-03 14:12:35 -030066
67static inline int smp_call_function_mask(cpumask_t mask,
68 void (*func) (void *info), void *info,
69 int wait)
70{
71 return smp_ops.smp_call_function_mask(mask, func, info, wait);
72}
Glauber Costa71d19542008-03-03 14:12:36 -030073
Glauber Costa1e3fac82008-03-03 14:12:37 -030074void native_smp_prepare_boot_cpu(void);
Glauber Costa7557da62008-03-03 14:12:38 -030075void native_smp_prepare_cpus(unsigned int max_cpus);
Glauber Costac5597642008-03-03 14:12:39 -030076void native_smp_cpus_done(unsigned int max_cpus);
Glauber Costa71d19542008-03-03 14:12:36 -030077int native_cpu_up(unsigned int cpunum);
Glauber Costa93b016f2008-03-03 14:12:40 -030078
Glauber Costa69c18c12008-03-03 14:13:07 -030079extern int __cpu_disable(void);
80extern void __cpu_die(unsigned int cpu);
81
Glauber Costa93b016f2008-03-03 14:12:40 -030082extern unsigned disabled_cpus;
Glauber Costa68a1c3f2008-03-03 14:12:42 -030083extern void prefill_possible_map(void);
Glauber Costac76cb362008-03-03 14:12:33 -030084#endif
Glauber Costa16694022008-03-03 14:12:32 -030085
Thomas Gleixner96a388d2007-10-11 11:20:03 +020086#ifdef CONFIG_X86_32
87# include "smp_32.h"
88#else
89# include "smp_64.h"
90#endif
Glauber Costac27cfef2008-03-03 14:12:29 -030091
Glauber Costa1dbb4722008-03-03 14:13:01 -030092#ifdef CONFIG_HOTPLUG_CPU
93extern void cpu_exit_clear(void);
94extern void cpu_uninit(void);
95extern void remove_siblinginfo(int cpu);
96#endif
97
Glauber Costa639acb12008-03-03 14:12:30 -030098extern void smp_alloc_memory(void);
99extern void lock_ipi_call_lock(void);
100extern void unlock_ipi_call_lock(void);
Glauber Costac27cfef2008-03-03 14:12:29 -0300101#endif /* __ASSEMBLY__ */
102#endif