x86: move mp_register_lapic to boot.c
authorAlexey Starikovskiy <astarikovskiy@suse.de>
Fri, 4 Apr 2008 19:41:50 +0000 (23:41 +0400)
committerIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 15:41:35 +0000 (17:41 +0200)
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/mpparse_32.c
arch/x86/kernel/mpparse_64.c
include/asm-x86/mpspec.h

index 9cf5751845368198f8f5dfda46de0a8132e6c191..11bd11847b19eb815bedd863f8062a276d7eba7b 100644 (file)
@@ -39,6 +39,7 @@
 #include <asm/apic.h>
 #include <asm/io.h>
 #include <asm/mpspec.h>
+#include <asm/smp.h>
 
 #ifdef CONFIG_X86_LOCAL_APIC
 # include <mach_apic.h>
@@ -239,6 +240,16 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
        return 0;
 }
 
+static void __cpuinit acpi_register_lapic(int id, u8 enabled)
+{
+       if (!enabled) {
+               ++disabled_cpus;
+               return;
+       }
+
+       generic_processor_info(id, 0);
+}
+
 static int __init
 acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
 {
@@ -258,8 +269,8 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
         * to not preallocating memory for all NR_CPUS
         * when we use CPU hotplug.
         */
-       mp_register_lapic(processor->id,        /* APIC ID */
-                         processor->lapic_flags & ACPI_MADT_ENABLED);  /* Enabled? */
+       acpi_register_lapic(processor->id,      /* APIC ID */
+                           processor->lapic_flags & ACPI_MADT_ENABLED);
 
        return 0;
 }
@@ -276,8 +287,8 @@ acpi_parse_sapic(struct acpi_subtable_header *header, const unsigned long end)
 
        acpi_table_print_madt_entry(header);
 
-       mp_register_lapic((processor->id << 8) | processor->eid,/* APIC ID */
-               processor->lapic_flags & ACPI_MADT_ENABLED);    /* Enabled? */
+       acpi_register_lapic((processor->id << 8) | processor->eid,/* APIC ID */
+                           processor->lapic_flags & ACPI_MADT_ENABLED);
 
        return 0;
 }
@@ -554,7 +565,7 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
        buffer.pointer = NULL;
 
        tmp_map = cpu_present_map;
-       mp_register_lapic(physid, lapic->lapic_flags & ACPI_MADT_ENABLED);
+       acpi_register_lapic(physid, lapic->lapic_flags & ACPI_MADT_ENABLED);
 
        /*
         * If mp_register_lapic successfully generates a new logical cpu
index ed4b3bc0e97ad3758facdc15ecbe1ce2d17948ea..ebec70a14198ef76376b11020b9ca918766a94b4 100644 (file)
@@ -797,22 +797,6 @@ void __init mp_register_lapic_address(u64 address)
        Dprintk("Boot CPU = %d\n", boot_cpu_physical_apicid);
 }
 
-void __cpuinit mp_register_lapic (int id, u8 enabled)
-{
-       if (MAX_APICS - id <= 0) {
-               printk(KERN_WARNING "Processor #%d invalid (max %d)\n",
-                       id, MAX_APICS);
-               return;
-       }
-
-       if (!enabled) {
-               ++disabled_cpus;
-               return;
-       }
-
-       generic_processor_info(id, GET_APIC_VERSION(apic_read(APIC_LVR)));
-}
-
 #ifdef CONFIG_X86_IO_APIC
 
 #define MP_ISA_BUS             0
index f860727e9151f4ad4cf4c47b9ac057c49d327ef3..03c19a2e6e9e1b5d3fcc79b861e28b42986a6759 100644 (file)
@@ -601,16 +601,6 @@ void __init mp_register_lapic_address(u64 address)
        if (boot_cpu_physical_apicid == -1U)
                boot_cpu_physical_apicid  = GET_APIC_ID(read_apic_id());
 }
-void __cpuinit mp_register_lapic(int id, u8 enabled)
-{
-       if (!enabled) {
-               ++disabled_cpus;
-               return;
-       }
-
-       generic_processor_info(id, 0);
-}
-
 
 #define MP_ISA_BUS             0
 #define MP_MAX_IOAPIC_PIN      127
index 08cc5e02795899688e7372c3d0c18626f2dabb83..c614051f4fc93c5570718e4f2eb59e71ad9f9ffa 100644 (file)
@@ -44,7 +44,6 @@ extern void get_smp_config(void);
 
 void __cpuinit generic_processor_info(int apicid, int version);
 #ifdef CONFIG_ACPI
-extern void mp_register_lapic(int id, u8 enabled);
 extern void mp_register_lapic_address(u64 address);
 extern void mp_register_ioapic(int id, u32 address, u32 gsi_base);
 extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,