blob: 2ab8ed4e99e0619a043062a7a440041ef4f98b6d [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 Costa377d6982008-03-03 14:12:51 -030028static inline void smp_send_stop(void)
29{
30 smp_ops.smp_send_stop();
31}
32
Glauber Costa1e3fac82008-03-03 14:12:37 -030033static inline void smp_prepare_boot_cpu(void)
34{
35 smp_ops.smp_prepare_boot_cpu();
36}
37
Glauber Costa7557da62008-03-03 14:12:38 -030038static inline void smp_prepare_cpus(unsigned int max_cpus)
39{
40 smp_ops.smp_prepare_cpus(max_cpus);
41}
42
Glauber Costac5597642008-03-03 14:12:39 -030043static inline void smp_cpus_done(unsigned int max_cpus)
44{
45 smp_ops.smp_cpus_done(max_cpus);
46}
47
Glauber Costa71d19542008-03-03 14:12:36 -030048static inline int __cpu_up(unsigned int cpu)
49{
50 return smp_ops.cpu_up(cpu);
51}
52
Glauber Costa86789692008-03-03 14:12:34 -030053static inline void smp_send_reschedule(int cpu)
54{
55 smp_ops.smp_send_reschedule(cpu);
56}
Glauber Costa64b1a21e02008-03-03 14:12:35 -030057
58static inline int smp_call_function_mask(cpumask_t mask,
59 void (*func) (void *info), void *info,
60 int wait)
61{
62 return smp_ops.smp_call_function_mask(mask, func, info, wait);
63}
Glauber Costa71d19542008-03-03 14:12:36 -030064
Glauber Costa1e3fac82008-03-03 14:12:37 -030065void native_smp_prepare_boot_cpu(void);
Glauber Costa7557da62008-03-03 14:12:38 -030066void native_smp_prepare_cpus(unsigned int max_cpus);
Glauber Costac5597642008-03-03 14:12:39 -030067void native_smp_cpus_done(unsigned int max_cpus);
Glauber Costa71d19542008-03-03 14:12:36 -030068int native_cpu_up(unsigned int cpunum);
Glauber Costa93b016f2008-03-03 14:12:40 -030069
70extern unsigned disabled_cpus;
Glauber Costa68a1c3f2008-03-03 14:12:42 -030071extern void prefill_possible_map(void);
Glauber Costac76cb362008-03-03 14:12:33 -030072#endif
Glauber Costa16694022008-03-03 14:12:32 -030073
Thomas Gleixner96a388d2007-10-11 11:20:03 +020074#ifdef CONFIG_X86_32
75# include "smp_32.h"
76#else
77# include "smp_64.h"
78#endif
Glauber Costac27cfef2008-03-03 14:12:29 -030079
Glauber Costa639acb12008-03-03 14:12:30 -030080extern void smp_alloc_memory(void);
81extern void lock_ipi_call_lock(void);
82extern void unlock_ipi_call_lock(void);
Glauber Costac27cfef2008-03-03 14:12:29 -030083#endif /* __ASSEMBLY__ */
84#endif