diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-07-11 21:44:16 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-12 02:45:14 -0400 |
commit | 4c9961d56ec20c27ec5d02e49fd7427748312741 (patch) | |
tree | e3a0fd508aae031dcd06705a2ce77f7dd0a68c11 /arch | |
parent | 4696ca5bfd2697f5686f96d59cf0b6de14869b4e (diff) |
x86: make read_apic_id return final apicid
also remove GET_APIC_ID when read_apic_id is used.
need to apply after
[PATCH] x86: mach_apicdef.h need to include before smp.h
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic_32.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic_64.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/genapic_flat_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_32.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_64.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 6 |
7 files changed, 14 insertions, 15 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 8705262ddcda..b314bcd08406 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -761,7 +761,7 @@ static void __init acpi_register_lapic_address(unsigned long address) | |||
761 | 761 | ||
762 | set_fixmap_nocache(FIX_APIC_BASE, address); | 762 | set_fixmap_nocache(FIX_APIC_BASE, address); |
763 | if (boot_cpu_physical_apicid == -1U) { | 763 | if (boot_cpu_physical_apicid == -1U) { |
764 | boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); | 764 | boot_cpu_physical_apicid = read_apic_id(); |
765 | #ifdef CONFIG_X86_32 | 765 | #ifdef CONFIG_X86_32 |
766 | apic_version[boot_cpu_physical_apicid] = | 766 | apic_version[boot_cpu_physical_apicid] = |
767 | GET_APIC_VERSION(apic_read(APIC_LVR)); | 767 | GET_APIC_VERSION(apic_read(APIC_LVR)); |
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 7413354c9ffd..47ff978aecfd 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -1230,7 +1230,7 @@ void __init init_apic_mappings(void) | |||
1230 | * default configuration (or the MP table is broken). | 1230 | * default configuration (or the MP table is broken). |
1231 | */ | 1231 | */ |
1232 | if (boot_cpu_physical_apicid == -1U) | 1232 | if (boot_cpu_physical_apicid == -1U) |
1233 | boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); | 1233 | boot_cpu_physical_apicid = read_apic_id(); |
1234 | 1234 | ||
1235 | } | 1235 | } |
1236 | 1236 | ||
@@ -1270,7 +1270,7 @@ int __init APIC_init_uniprocessor(void) | |||
1270 | * might be zero if read from MP tables. Get it from LAPIC. | 1270 | * might be zero if read from MP tables. Get it from LAPIC. |
1271 | */ | 1271 | */ |
1272 | #ifdef CONFIG_CRASH_DUMP | 1272 | #ifdef CONFIG_CRASH_DUMP |
1273 | boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); | 1273 | boot_cpu_physical_apicid = read_apic_id(); |
1274 | #endif | 1274 | #endif |
1275 | physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); | 1275 | physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); |
1276 | 1276 | ||
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index dd0501039f09..c75f58a66d8e 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -1060,7 +1060,7 @@ void __init early_init_lapic_mapping(void) | |||
1060 | * Fetch the APIC ID of the BSP in case we have a | 1060 | * Fetch the APIC ID of the BSP in case we have a |
1061 | * default configuration (or the MP table is broken). | 1061 | * default configuration (or the MP table is broken). |
1062 | */ | 1062 | */ |
1063 | boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); | 1063 | boot_cpu_physical_apicid = read_apic_id(); |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | /** | 1066 | /** |
@@ -1069,7 +1069,7 @@ void __init early_init_lapic_mapping(void) | |||
1069 | void __init init_apic_mappings(void) | 1069 | void __init init_apic_mappings(void) |
1070 | { | 1070 | { |
1071 | if (x2apic) { | 1071 | if (x2apic) { |
1072 | boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); | 1072 | boot_cpu_physical_apicid = read_apic_id(); |
1073 | return; | 1073 | return; |
1074 | } | 1074 | } |
1075 | 1075 | ||
@@ -1092,7 +1092,7 @@ void __init init_apic_mappings(void) | |||
1092 | * Fetch the APIC ID of the BSP in case we have a | 1092 | * Fetch the APIC ID of the BSP in case we have a |
1093 | * default configuration (or the MP table is broken). | 1093 | * default configuration (or the MP table is broken). |
1094 | */ | 1094 | */ |
1095 | boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); | 1095 | boot_cpu_physical_apicid = read_apic_id(); |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | /* | 1098 | /* |
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c index 735586822135..7dac2f275fad 100644 --- a/arch/x86/kernel/genapic_flat_64.c +++ b/arch/x86/kernel/genapic_flat_64.c | |||
@@ -101,7 +101,7 @@ static unsigned int read_xapic_id(void) | |||
101 | { | 101 | { |
102 | unsigned int id; | 102 | unsigned int id; |
103 | 103 | ||
104 | id = GET_XAPIC_ID(apic_read(APIC_ID)); | 104 | id = GET_APIC_ID(apic_read(APIC_ID)); |
105 | return id; | 105 | return id; |
106 | } | 106 | } |
107 | 107 | ||
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index c50adb84ea6f..382208d11f8d 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -1501,7 +1501,7 @@ void /*__init*/ print_local_APIC(void *dummy) | |||
1501 | smp_processor_id(), hard_smp_processor_id()); | 1501 | smp_processor_id(), hard_smp_processor_id()); |
1502 | v = apic_read(APIC_ID); | 1502 | v = apic_read(APIC_ID); |
1503 | printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, | 1503 | printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, |
1504 | GET_APIC_ID(read_apic_id())); | 1504 | GET_APIC_ID(v)); |
1505 | v = apic_read(APIC_LVR); | 1505 | v = apic_read(APIC_LVR); |
1506 | printk(KERN_INFO "... APIC VERSION: %08x\n", v); | 1506 | printk(KERN_INFO "... APIC VERSION: %08x\n", v); |
1507 | ver = GET_APIC_VERSION(v); | 1507 | ver = GET_APIC_VERSION(v); |
@@ -1709,8 +1709,7 @@ void disable_IO_APIC(void) | |||
1709 | entry.dest_mode = 0; /* Physical */ | 1709 | entry.dest_mode = 0; /* Physical */ |
1710 | entry.delivery_mode = dest_ExtINT; /* ExtInt */ | 1710 | entry.delivery_mode = dest_ExtINT; /* ExtInt */ |
1711 | entry.vector = 0; | 1711 | entry.vector = 0; |
1712 | entry.dest.physical.physical_dest = | 1712 | entry.dest.physical.physical_dest = read_apic_id(); |
1713 | GET_APIC_ID(read_apic_id()); | ||
1714 | 1713 | ||
1715 | /* | 1714 | /* |
1716 | * Add it to the IO-APIC irq-routing table: | 1715 | * Add it to the IO-APIC irq-routing table: |
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c index 877aa2e9d7e8..2db0f98e2af5 100644 --- a/arch/x86/kernel/io_apic_64.c +++ b/arch/x86/kernel/io_apic_64.c | |||
@@ -1246,7 +1246,7 @@ void __apicdebuginit print_local_APIC(void * dummy) | |||
1246 | printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", | 1246 | printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", |
1247 | smp_processor_id(), hard_smp_processor_id()); | 1247 | smp_processor_id(), hard_smp_processor_id()); |
1248 | v = apic_read(APIC_ID); | 1248 | v = apic_read(APIC_ID); |
1249 | printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, GET_APIC_ID(read_apic_id())); | 1249 | printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id()); |
1250 | v = apic_read(APIC_LVR); | 1250 | v = apic_read(APIC_LVR); |
1251 | printk(KERN_INFO "... APIC VERSION: %08x\n", v); | 1251 | printk(KERN_INFO "... APIC VERSION: %08x\n", v); |
1252 | ver = GET_APIC_VERSION(v); | 1252 | ver = GET_APIC_VERSION(v); |
@@ -1439,7 +1439,7 @@ void disable_IO_APIC(void) | |||
1439 | entry.dest_mode = 0; /* Physical */ | 1439 | entry.dest_mode = 0; /* Physical */ |
1440 | entry.delivery_mode = dest_ExtINT; /* ExtInt */ | 1440 | entry.delivery_mode = dest_ExtINT; /* ExtInt */ |
1441 | entry.vector = 0; | 1441 | entry.vector = 0; |
1442 | entry.dest = GET_APIC_ID(read_apic_id()); | 1442 | entry.dest = read_apic_id(); |
1443 | 1443 | ||
1444 | /* | 1444 | /* |
1445 | * Add it to the IO-APIC irq-routing table: | 1445 | * Add it to the IO-APIC irq-routing table: |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 0c43e1f2e7d3..6cd002f3e20e 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -211,7 +211,7 @@ static void __cpuinit smp_callin(void) | |||
211 | /* | 211 | /* |
212 | * (This works even if the APIC is not enabled.) | 212 | * (This works even if the APIC is not enabled.) |
213 | */ | 213 | */ |
214 | phys_id = GET_APIC_ID(read_apic_id()); | 214 | phys_id = read_apic_id(); |
215 | cpuid = smp_processor_id(); | 215 | cpuid = smp_processor_id(); |
216 | if (cpu_isset(cpuid, cpu_callin_map)) { | 216 | if (cpu_isset(cpuid, cpu_callin_map)) { |
217 | panic("%s: phys CPU#%d, CPU#%d already present??\n", __func__, | 217 | panic("%s: phys CPU#%d, CPU#%d already present??\n", __func__, |
@@ -1157,9 +1157,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | preempt_disable(); | 1159 | preempt_disable(); |
1160 | if (GET_APIC_ID(read_apic_id()) != boot_cpu_physical_apicid) { | 1160 | if (read_apic_id() != boot_cpu_physical_apicid) { |
1161 | panic("Boot APIC ID in local APIC unexpected (%d vs %d)", | 1161 | panic("Boot APIC ID in local APIC unexpected (%d vs %d)", |
1162 | GET_APIC_ID(read_apic_id()), boot_cpu_physical_apicid); | 1162 | read_apic_id(), boot_cpu_physical_apicid); |
1163 | /* Or can we switch back to PIC here? */ | 1163 | /* Or can we switch back to PIC here? */ |
1164 | } | 1164 | } |
1165 | preempt_enable(); | 1165 | preempt_enable(); |