diff options
-rw-r--r-- | drivers/acpi/acpi_processor.c | 4 | ||||
-rw-r--r-- | drivers/acpi/processor_core.c | 26 | ||||
-rw-r--r-- | include/acpi/processor.h | 3 |
3 files changed, 27 insertions, 6 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index f29e06efa479..f89f914cb97e 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c | |||
@@ -270,7 +270,9 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
270 | device_declaration = 1; | 270 | device_declaration = 1; |
271 | pr->acpi_id = value; | 271 | pr->acpi_id = value; |
272 | } | 272 | } |
273 | cpu_index = acpi_get_cpuid(pr->handle, device_declaration, pr->acpi_id); | 273 | pr->apic_id = acpi_get_apicid(pr->handle, device_declaration, |
274 | pr->acpi_id); | ||
275 | cpu_index = acpi_map_cpuid(pr->apic_id, pr->acpi_id); | ||
274 | 276 | ||
275 | /* Handle UP system running SMP kernel, with no LAPIC in MADT */ | 277 | /* Handle UP system running SMP kernel, with no LAPIC in MADT */ |
276 | if (!cpu0_initialized && (cpu_index == -1) && | 278 | if (!cpu0_initialized && (cpu_index == -1) && |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index cf34d903f4fb..b3171f30b319 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -162,16 +162,23 @@ exit: | |||
162 | return apic_id; | 162 | return apic_id; |
163 | } | 163 | } |
164 | 164 | ||
165 | int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id) | 165 | int acpi_get_apicid(acpi_handle handle, int type, u32 acpi_id) |
166 | { | 166 | { |
167 | #ifdef CONFIG_SMP | 167 | int apic_id; |
168 | int i; | ||
169 | #endif | ||
170 | int apic_id = -1; | ||
171 | 168 | ||
172 | apic_id = map_mat_entry(handle, type, acpi_id); | 169 | apic_id = map_mat_entry(handle, type, acpi_id); |
173 | if (apic_id == -1) | 170 | if (apic_id == -1) |
174 | apic_id = map_madt_entry(type, acpi_id); | 171 | apic_id = map_madt_entry(type, acpi_id); |
172 | |||
173 | return apic_id; | ||
174 | } | ||
175 | |||
176 | int acpi_map_cpuid(int apic_id, u32 acpi_id) | ||
177 | { | ||
178 | #ifdef CONFIG_SMP | ||
179 | int i; | ||
180 | #endif | ||
181 | |||
175 | if (apic_id == -1) { | 182 | if (apic_id == -1) { |
176 | /* | 183 | /* |
177 | * On UP processor, there is no _MAT or MADT table. | 184 | * On UP processor, there is no _MAT or MADT table. |
@@ -211,6 +218,15 @@ int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id) | |||
211 | #endif | 218 | #endif |
212 | return -1; | 219 | return -1; |
213 | } | 220 | } |
221 | |||
222 | int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id) | ||
223 | { | ||
224 | int apic_id; | ||
225 | |||
226 | apic_id = acpi_get_apicid(handle, type, acpi_id); | ||
227 | |||
228 | return acpi_map_cpuid(apic_id, acpi_id); | ||
229 | } | ||
214 | EXPORT_SYMBOL_GPL(acpi_get_cpuid); | 230 | EXPORT_SYMBOL_GPL(acpi_get_cpuid); |
215 | 231 | ||
216 | static bool __init processor_physically_present(acpi_handle handle) | 232 | static bool __init processor_physically_present(acpi_handle handle) |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 66096d06925e..7816e45f5d5a 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -199,6 +199,7 @@ struct acpi_processor_flags { | |||
199 | struct acpi_processor { | 199 | struct acpi_processor { |
200 | acpi_handle handle; | 200 | acpi_handle handle; |
201 | u32 acpi_id; | 201 | u32 acpi_id; |
202 | u32 apic_id; | ||
202 | u32 id; | 203 | u32 id; |
203 | u32 pblk; | 204 | u32 pblk; |
204 | int performance_platform_limit; | 205 | int performance_platform_limit; |
@@ -314,6 +315,8 @@ static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) | |||
314 | 315 | ||
315 | /* in processor_core.c */ | 316 | /* in processor_core.c */ |
316 | void acpi_processor_set_pdc(acpi_handle handle); | 317 | void acpi_processor_set_pdc(acpi_handle handle); |
318 | int acpi_get_apicid(acpi_handle, int type, u32 acpi_id); | ||
319 | int acpi_map_cpuid(int apic_id, u32 acpi_id); | ||
317 | int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id); | 320 | int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id); |
318 | 321 | ||
319 | /* in processor_throttling.c */ | 322 | /* in processor_throttling.c */ |