x86: move stack_start to smp.h
[deliverable/linux.git] / include / asm-x86 / smp.h
CommitLineData
c27cfeff
GC
1#ifndef _ASM_X86_SMP_H_
2#define _ASM_X86_SMP_H_
3#ifndef __ASSEMBLY__
53ebef49 4#include <linux/cpumask.h>
93b016f8 5#include <linux/init.h>
7e1efc0c 6#include <asm/percpu.h>
53ebef49
GC
7
8extern cpumask_t cpu_callout_map;
9
10extern int smp_num_siblings;
11extern unsigned int num_processors;
c27cfeff 12
7e1efc0c
GOC
13extern u16 x86_cpu_to_apicid_init[];
14extern u16 x86_bios_cpu_apicid_init[];
15extern void *x86_cpu_to_apicid_early_ptr;
16extern void *x86_bios_cpu_apicid_early_ptr;
17
18DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
19DECLARE_PER_CPU(cpumask_t, cpu_core_map);
20DECLARE_PER_CPU(u16, cpu_llc_id);
21DECLARE_PER_CPU(u16, x86_cpu_to_apicid);
22DECLARE_PER_CPU(u16, x86_bios_cpu_apicid);
23
42068829
GC
24/*
25 * Trampoline 80x86 program as an array.
26 */
27extern const unsigned char trampoline_data [];
28extern const unsigned char trampoline_end [];
91718e8d 29extern unsigned char *trampoline_base;
42068829 30
9d97d0da
GOC
31/* Static state in head.S used to set up a CPU */
32extern struct {
33 void *sp;
34 unsigned short ss;
35} stack_start;
36
37
16694024
GC
38struct smp_ops {
39 void (*smp_prepare_boot_cpu)(void);
40 void (*smp_prepare_cpus)(unsigned max_cpus);
41 int (*cpu_up)(unsigned cpu);
42 void (*smp_cpus_done)(unsigned max_cpus);
43
44 void (*smp_send_stop)(void);
45 void (*smp_send_reschedule)(int cpu);
46 int (*smp_call_function_mask)(cpumask_t mask,
47 void (*func)(void *info), void *info,
48 int wait);
49};
50
14522076
GC
51/* Globals due to paravirt */
52extern void set_cpu_sibling_map(int cpu);
53
c76cb368 54#ifdef CONFIG_SMP
d0173aea
GOC
55#ifndef CONFIG_PARAVIRT
56#define startup_ipi_hook(phys_apicid, start_eip, start_esp) do { } while (0)
57#endif
c76cb368 58extern struct smp_ops smp_ops;
8678969e 59
377d6984
GC
60static inline void smp_send_stop(void)
61{
62 smp_ops.smp_send_stop();
63}
64
1e3fac83
GC
65static inline void smp_prepare_boot_cpu(void)
66{
67 smp_ops.smp_prepare_boot_cpu();
68}
69
7557da67
GC
70static inline void smp_prepare_cpus(unsigned int max_cpus)
71{
72 smp_ops.smp_prepare_cpus(max_cpus);
73}
74
c5597649
GC
75static inline void smp_cpus_done(unsigned int max_cpus)
76{
77 smp_ops.smp_cpus_done(max_cpus);
78}
79
71d19549
GC
80static inline int __cpu_up(unsigned int cpu)
81{
82 return smp_ops.cpu_up(cpu);
83}
84
8678969e
GC
85static inline void smp_send_reschedule(int cpu)
86{
87 smp_ops.smp_send_reschedule(cpu);
88}
64b1a21e
GC
89
90static inline int smp_call_function_mask(cpumask_t mask,
91 void (*func) (void *info), void *info,
92 int wait)
93{
94 return smp_ops.smp_call_function_mask(mask, func, info, wait);
95}
71d19549 96
1e3fac83 97void native_smp_prepare_boot_cpu(void);
7557da67 98void native_smp_prepare_cpus(unsigned int max_cpus);
c5597649 99void native_smp_cpus_done(unsigned int max_cpus);
71d19549 100int native_cpu_up(unsigned int cpunum);
93b016f8 101
69c18c15
GC
102extern int __cpu_disable(void);
103extern void __cpu_die(unsigned int cpu);
104
93b016f8 105extern unsigned disabled_cpus;
68a1c3f8 106extern void prefill_possible_map(void);
91718e8d
GC
107
108#define SMP_TRAMPOLINE_BASE 0x6000
109extern unsigned long setup_trampoline(void);
1d89a7f0
GOC
110
111void smp_store_cpu_info(int id);
c76cb368 112#endif
16694024 113
96a388de
TG
114#ifdef CONFIG_X86_32
115# include "smp_32.h"
116#else
117# include "smp_64.h"
118#endif
c27cfeff 119
1dbb4726
GC
120#ifdef CONFIG_HOTPLUG_CPU
121extern void cpu_exit_clear(void);
122extern void cpu_uninit(void);
123extern void remove_siblinginfo(int cpu);
124#endif
125
639acb16
GC
126extern void smp_alloc_memory(void);
127extern void lock_ipi_call_lock(void);
128extern void unlock_ipi_call_lock(void);
c27cfeff
GC
129#endif /* __ASSEMBLY__ */
130#endif
This page took 0.095516 seconds and 5 git commands to generate.