blob: 28cb1f8bb47e86f5903a8d54735730d9cf250abb [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 Costac76cb362008-03-03 14:12:33 -030025#ifdef CONFIG_SMP
26extern struct smp_ops smp_ops;
Glauber Costa86789692008-03-03 14:12:34 -030027
Glauber Costa1e3fac82008-03-03 14:12:37 -030028static inline void smp_prepare_boot_cpu(void)
29{
30 smp_ops.smp_prepare_boot_cpu();
31}
32
Glauber Costa7557da62008-03-03 14:12:38 -030033static inline void smp_prepare_cpus(unsigned int max_cpus)
34{
35 smp_ops.smp_prepare_cpus(max_cpus);
36}
37
Glauber Costac5597642008-03-03 14:12:39 -030038static inline void smp_cpus_done(unsigned int max_cpus)
39{
40 smp_ops.smp_cpus_done(max_cpus);
41}
42
Glauber Costa71d19542008-03-03 14:12:36 -030043static inline int __cpu_up(unsigned int cpu)
44{
45 return smp_ops.cpu_up(cpu);
46}
47
Glauber Costa86789692008-03-03 14:12:34 -030048static inline void smp_send_reschedule(int cpu)
49{
50 smp_ops.smp_send_reschedule(cpu);
51}
Glauber Costa64b1a212008-03-03 14:12:35 -030052
53static 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 Costa71d19542008-03-03 14:12:36 -030059
Glauber Costa1e3fac82008-03-03 14:12:37 -030060void native_smp_prepare_boot_cpu(void);
Glauber Costa7557da62008-03-03 14:12:38 -030061void native_smp_prepare_cpus(unsigned int max_cpus);
Glauber Costac5597642008-03-03 14:12:39 -030062void native_smp_cpus_done(unsigned int max_cpus);
Glauber Costa71d19542008-03-03 14:12:36 -030063int native_cpu_up(unsigned int cpunum);
Glauber Costa93b016f2008-03-03 14:12:40 -030064
65extern unsigned disabled_cpus;
Glauber Costa68a1c3f2008-03-03 14:12:42 -030066extern void prefill_possible_map(void);
Glauber Costac76cb362008-03-03 14:12:33 -030067#endif
Glauber Costa16694022008-03-03 14:12:32 -030068
Thomas Gleixner96a388d2007-10-11 11:20:03 +020069#ifdef CONFIG_X86_32
70# include "smp_32.h"
71#else
72# include "smp_64.h"
73#endif
Glauber Costac27cfef2008-03-03 14:12:29 -030074
Glauber Costa639acb12008-03-03 14:12:30 -030075extern void smp_alloc_memory(void);
76extern void lock_ipi_call_lock(void);
77extern void unlock_ipi_call_lock(void);
Glauber Costac27cfef2008-03-03 14:12:29 -030078#endif /* __ASSEMBLY__ */
79#endif