Skip to content

Commit

Permalink
x86: acpi use cpu_physical_id
Browse files Browse the repository at this point in the history
This is from an earlier message from Christoph Lameter:

    processor_core.c currently tries to determine the apicid by special casing
    for IA64 and x86. The desired information is readily available via

	    cpu_physical_id()

    on IA64, i386 and x86_64.

    Signed-off-by: Christoph Lameter <clameter@sgi.com>

Additionally, boot_cpu_id needed to be exported to fix compile errors in
dma code when !CONFIG_SMP.

Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Mike Travis authored and Thomas Gleixner committed Oct 19, 2007
1 parent b627847 commit 71b3123
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions arch/x86/kernel/mpparse_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ unsigned long mp_lapic_addr = 0;

/* Processor that is doing the boot up */
unsigned int boot_cpu_id = -1U;
EXPORT_SYMBOL(boot_cpu_id);

/* Internal processor count */
unsigned int num_processors __cpuinitdata = 0;

Expand Down
8 changes: 1 addition & 7 deletions drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,6 @@ static int map_lsapic_id(struct acpi_subtable_header *entry,
return 0;
}

#ifdef CONFIG_IA64
#define arch_cpu_to_apicid ia64_cpu_to_sapicid
#else
#define arch_cpu_to_apicid x86_cpu_to_apicid
#endif

static int map_madt_entry(u32 acpi_id)
{
unsigned long madt_end, entry;
Expand Down Expand Up @@ -500,7 +494,7 @@ static int get_cpu_id(acpi_handle handle, u32 acpi_id)
return apic_id;

for (i = 0; i < NR_CPUS; ++i) {
if (arch_cpu_to_apicid[i] == apic_id)
if (cpu_physical_id(i) == apic_id)
return i;
}
return -1;
Expand Down

0 comments on commit 71b3123

Please sign in to comment.