diff options
Diffstat (limited to 'include/asm-x86_64/smp.h')
-rw-r--r-- | include/asm-x86_64/smp.h | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h index 6805e1feb300..d6b7c057edba 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86_64/smp.h | |||
@@ -4,27 +4,18 @@ | |||
4 | /* | 4 | /* |
5 | * We need the APIC definitions automatically as part of 'smp.h' | 5 | * We need the APIC definitions automatically as part of 'smp.h' |
6 | */ | 6 | */ |
7 | #ifndef __ASSEMBLY__ | ||
8 | #include <linux/threads.h> | 7 | #include <linux/threads.h> |
9 | #include <linux/cpumask.h> | 8 | #include <linux/cpumask.h> |
10 | #include <linux/bitops.h> | 9 | #include <linux/bitops.h> |
11 | extern int disable_apic; | 10 | extern int disable_apic; |
12 | #endif | ||
13 | 11 | ||
14 | #ifdef CONFIG_X86_LOCAL_APIC | ||
15 | #ifndef __ASSEMBLY__ | ||
16 | #include <asm/fixmap.h> | 12 | #include <asm/fixmap.h> |
17 | #include <asm/mpspec.h> | 13 | #include <asm/mpspec.h> |
18 | #ifdef CONFIG_X86_IO_APIC | ||
19 | #include <asm/io_apic.h> | 14 | #include <asm/io_apic.h> |
20 | #endif | ||
21 | #include <asm/apic.h> | 15 | #include <asm/apic.h> |
22 | #include <asm/thread_info.h> | 16 | #include <asm/thread_info.h> |
23 | #endif | ||
24 | #endif | ||
25 | 17 | ||
26 | #ifdef CONFIG_SMP | 18 | #ifdef CONFIG_SMP |
27 | #ifndef ASSEMBLY | ||
28 | 19 | ||
29 | #include <asm/pda.h> | 20 | #include <asm/pda.h> |
30 | 21 | ||
@@ -42,14 +33,11 @@ extern cpumask_t cpu_initialized; | |||
42 | 33 | ||
43 | extern void smp_alloc_memory(void); | 34 | extern void smp_alloc_memory(void); |
44 | extern volatile unsigned long smp_invalidate_needed; | 35 | extern volatile unsigned long smp_invalidate_needed; |
45 | extern int pic_mode; | ||
46 | extern void lock_ipi_call_lock(void); | 36 | extern void lock_ipi_call_lock(void); |
47 | extern void unlock_ipi_call_lock(void); | 37 | extern void unlock_ipi_call_lock(void); |
48 | extern int smp_num_siblings; | 38 | extern int smp_num_siblings; |
49 | extern void smp_send_reschedule(int cpu); | 39 | extern void smp_send_reschedule(int cpu); |
50 | void smp_stop_cpu(void); | 40 | void smp_stop_cpu(void); |
51 | extern int smp_call_function_single(int cpuid, void (*func) (void *info), | ||
52 | void *info, int retry, int wait); | ||
53 | 41 | ||
54 | extern cpumask_t cpu_sibling_map[NR_CPUS]; | 42 | extern cpumask_t cpu_sibling_map[NR_CPUS]; |
55 | extern cpumask_t cpu_core_map[NR_CPUS]; | 43 | extern cpumask_t cpu_core_map[NR_CPUS]; |
@@ -76,20 +64,16 @@ static inline int hard_smp_processor_id(void) | |||
76 | return GET_APIC_ID(*(unsigned int *)(APIC_BASE+APIC_ID)); | 64 | return GET_APIC_ID(*(unsigned int *)(APIC_BASE+APIC_ID)); |
77 | } | 65 | } |
78 | 66 | ||
79 | extern int safe_smp_processor_id(void); | ||
80 | extern int __cpu_disable(void); | 67 | extern int __cpu_disable(void); |
81 | extern void __cpu_die(unsigned int cpu); | 68 | extern void __cpu_die(unsigned int cpu); |
82 | extern void prefill_possible_map(void); | 69 | extern void prefill_possible_map(void); |
83 | extern unsigned num_processors; | 70 | extern unsigned num_processors; |
84 | extern unsigned disabled_cpus; | 71 | extern unsigned disabled_cpus; |
85 | 72 | ||
86 | #endif /* !ASSEMBLY */ | ||
87 | |||
88 | #define NO_PROC_ID 0xFF /* No processor magic marker */ | 73 | #define NO_PROC_ID 0xFF /* No processor magic marker */ |
89 | 74 | ||
90 | #endif | 75 | #endif |
91 | 76 | ||
92 | #ifndef ASSEMBLY | ||
93 | /* | 77 | /* |
94 | * Some lowlevel functions might want to know about | 78 | * Some lowlevel functions might want to know about |
95 | * the real APIC ID <-> CPU # mapping. | 79 | * the real APIC ID <-> CPU # mapping. |
@@ -111,11 +95,8 @@ static inline int cpu_present_to_apicid(int mps_cpu) | |||
111 | return BAD_APICID; | 95 | return BAD_APICID; |
112 | } | 96 | } |
113 | 97 | ||
114 | #endif /* !ASSEMBLY */ | ||
115 | |||
116 | #ifndef CONFIG_SMP | 98 | #ifndef CONFIG_SMP |
117 | #define stack_smp_processor_id() 0 | 99 | #define stack_smp_processor_id() 0 |
118 | #define safe_smp_processor_id() 0 | ||
119 | #define cpu_logical_map(x) (x) | 100 | #define cpu_logical_map(x) (x) |
120 | #else | 101 | #else |
121 | #include <asm/thread_info.h> | 102 | #include <asm/thread_info.h> |
@@ -127,19 +108,23 @@ static inline int cpu_present_to_apicid(int mps_cpu) | |||
127 | }) | 108 | }) |
128 | #endif | 109 | #endif |
129 | 110 | ||
130 | #ifndef __ASSEMBLY__ | ||
131 | static __inline int logical_smp_processor_id(void) | 111 | static __inline int logical_smp_processor_id(void) |
132 | { | 112 | { |
133 | /* we don't want to mark this access volatile - bad code generation */ | 113 | /* we don't want to mark this access volatile - bad code generation */ |
134 | return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR)); | 114 | return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR)); |
135 | } | 115 | } |
136 | #endif | ||
137 | 116 | ||
138 | #ifdef CONFIG_SMP | 117 | #ifdef CONFIG_SMP |
139 | #define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] | 118 | #define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] |
140 | #else | 119 | #else |
141 | #define cpu_physical_id(cpu) boot_cpu_id | 120 | #define cpu_physical_id(cpu) boot_cpu_id |
142 | #endif | 121 | static inline int smp_call_function_single(int cpuid, void (*func) (void *info), |
143 | 122 | void *info, int retry, int wait) | |
123 | { | ||
124 | /* Disable interrupts here? */ | ||
125 | func(info); | ||
126 | return 0; | ||
127 | } | ||
128 | #endif /* !CONFIG_SMP */ | ||
144 | #endif | 129 | #endif |
145 | 130 | ||