x86: move assignment of CPU_PREPARE before do_boot_cpu
[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>
53ebef49
GC
6
7extern cpumask_t cpu_callout_map;
8
9extern int smp_num_siblings;
10extern unsigned int num_processors;
c27cfeff 11
42068829
GC
12/*
13 * Trampoline 80x86 program as an array.
14 */
15extern const unsigned char trampoline_data [];
16extern const unsigned char trampoline_end [];
91718e8d 17extern unsigned char *trampoline_base;
42068829 18
16694024
GC
19struct smp_ops {
20 void (*smp_prepare_boot_cpu)(void);
21 void (*smp_prepare_cpus)(unsigned max_cpus);
22 int (*cpu_up)(unsigned cpu);
23 void (*smp_cpus_done)(unsigned max_cpus);
24
25 void (*smp_send_stop)(void);
26 void (*smp_send_reschedule)(int cpu);
27 int (*smp_call_function_mask)(cpumask_t mask,
28 void (*func)(void *info), void *info,
29 int wait);
30};
31
14522076
GC
32/* Globals due to paravirt */
33extern void set_cpu_sibling_map(int cpu);
34
c76cb368 35#ifdef CONFIG_SMP
d0173aea
GOC
36#ifndef CONFIG_PARAVIRT
37#define startup_ipi_hook(phys_apicid, start_eip, start_esp) do { } while (0)
38#endif
c76cb368 39extern struct smp_ops smp_ops;
8678969e 40
377d6984
GC
41static inline void smp_send_stop(void)
42{
43 smp_ops.smp_send_stop();
44}
45
1e3fac83
GC
46static inline void smp_prepare_boot_cpu(void)
47{
48 smp_ops.smp_prepare_boot_cpu();
49}
50
7557da67
GC
51static inline void smp_prepare_cpus(unsigned int max_cpus)
52{
53 smp_ops.smp_prepare_cpus(max_cpus);
54}
55
c5597649
GC
56static inline void smp_cpus_done(unsigned int max_cpus)
57{
58 smp_ops.smp_cpus_done(max_cpus);
59}
60
71d19549
GC
61static inline int __cpu_up(unsigned int cpu)
62{
63 return smp_ops.cpu_up(cpu);
64}
65
8678969e
GC
66static inline void smp_send_reschedule(int cpu)
67{
68 smp_ops.smp_send_reschedule(cpu);
69}
64b1a21e
GC
70
71static inline int smp_call_function_mask(cpumask_t mask,
72 void (*func) (void *info), void *info,
73 int wait)
74{
75 return smp_ops.smp_call_function_mask(mask, func, info, wait);
76}
71d19549 77
1e3fac83 78void native_smp_prepare_boot_cpu(void);
7557da67 79void native_smp_prepare_cpus(unsigned int max_cpus);
c5597649 80void native_smp_cpus_done(unsigned int max_cpus);
71d19549 81int native_cpu_up(unsigned int cpunum);
93b016f8 82
69c18c15
GC
83extern int __cpu_disable(void);
84extern void __cpu_die(unsigned int cpu);
85
93b016f8 86extern unsigned disabled_cpus;
68a1c3f8 87extern void prefill_possible_map(void);
91718e8d
GC
88
89#define SMP_TRAMPOLINE_BASE 0x6000
90extern unsigned long setup_trampoline(void);
1d89a7f0
GOC
91
92void smp_store_cpu_info(int id);
c76cb368 93#endif
16694024 94
96a388de
TG
95#ifdef CONFIG_X86_32
96# include "smp_32.h"
97#else
98# include "smp_64.h"
99#endif
c27cfeff 100
1dbb4726
GC
101#ifdef CONFIG_HOTPLUG_CPU
102extern void cpu_exit_clear(void);
103extern void cpu_uninit(void);
104extern void remove_siblinginfo(int cpu);
105#endif
106
639acb16
GC
107extern void smp_alloc_memory(void);
108extern void lock_ipi_call_lock(void);
109extern void unlock_ipi_call_lock(void);
c27cfeff
GC
110#endif /* __ASSEMBLY__ */
111#endif
This page took 0.096476 seconds and 5 git commands to generate.