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