]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/mpparse_64.c
x86: move mp_irqs to io_apic_64.c
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / mpparse_64.c
index 71f098414d0b492c7321387f7dfa526d67103570..07c98dbd468aaa6a6d2a6455f27ce6601fde7a56 100644 (file)
@@ -35,7 +35,6 @@
 
 /* Have we found an MP table */
 int smp_found_config;
-unsigned int __cpuinitdata maxcpus = NR_CPUS;
 
 /*
  * Various Linux-internal data structures created from the
@@ -45,30 +44,15 @@ DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES);
 int mp_bus_id_to_pci_bus[MAX_MP_BUSSES] = {[0 ... MAX_MP_BUSSES - 1] = -1 };
 
 static int mp_current_pci_id = 0;
-/* I/O APIC entries */
-struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
-
-/* # of MP IRQ source entries */
-struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
-
-/* MP IRQ source entries */
-int mp_irq_entries;
-
-int nr_ioapics;
-
-/* Processor that is doing the boot up */
-unsigned int boot_cpu_physical_apicid = -1U;
-EXPORT_SYMBOL(boot_cpu_physical_apicid);
 
+/* Make it easy to share the UP and SMP code: */
+#ifndef CONFIG_X86_SMP
+unsigned int num_processors;
 unsigned disabled_cpus __cpuinitdata;
-
-#ifdef CONFIG_SMP
-u16 x86_bios_cpu_apicid_init[NR_CPUS] __initdata
-    = {[0 ... NR_CPUS - 1] = BAD_APICID };
-void *x86_bios_cpu_apicid_early_ptr;
+#ifndef CONFIG_X86_LOCAL_APIC
+unsigned int boot_cpu_physical_apicid = -1U;
+#endif
 #endif
-DEFINE_PER_CPU(u16, x86_bios_cpu_apicid) = BAD_APICID;
-EXPORT_PER_CPU_SYMBOL(x86_bios_cpu_apicid);
 
 /*
  * Intel MP BIOS table parsing routines:
@@ -88,52 +72,6 @@ static int __init mpf_checksum(unsigned char *mp, int len)
        return sum & 0xFF;
 }
 
-void __cpuinit generic_processor_info(int apicid, int version)
-{
-       int cpu;
-       cpumask_t tmp_map;
-
-       if (num_processors >= NR_CPUS) {
-               printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached."
-                      " Processor ignored.\n", NR_CPUS);
-               return;
-       }
-
-       if (num_processors >= maxcpus) {
-               printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
-                      " Processor ignored.\n", maxcpus);
-               return;
-       }
-
-       num_processors++;
-       cpus_complement(tmp_map, cpu_present_map);
-       cpu = first_cpu(tmp_map);
-
-       physid_set(apicid, phys_cpu_present_map);
-       if (apicid == boot_cpu_physical_apicid) {
-               /*
-                * x86_bios_cpu_apicid is required to have processors listed
-                * in same order as logical cpu numbers. Hence the first
-                * entry is BSP, and so on.
-                */
-               cpu = 0;
-       }
-       /* are we being called early in kernel startup? */
-       if (x86_cpu_to_apicid_early_ptr) {
-               u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
-               u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
-
-               cpu_to_apicid[cpu] = apicid;
-               bios_cpu_apicid[cpu] = apicid;
-       } else {
-               per_cpu(x86_cpu_to_apicid, cpu) = apicid;
-               per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
-       }
-
-       cpu_set(cpu, cpu_possible_map);
-       cpu_set(cpu, cpu_present_map);
-}
-
 static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
 {
        char *bootup_cpu = "";
@@ -670,10 +608,9 @@ void __init mp_register_lapic_address(u64 address)
        mp_lapic_addr = (unsigned long)address;
        set_fixmap_nocache(FIX_APIC_BASE, mp_lapic_addr);
        if (boot_cpu_physical_apicid == -1U)
-               boot_cpu_physical_apicid  = GET_APIC_ID(apic_read(APIC_ID));
+               boot_cpu_physical_apicid  = GET_APIC_ID(read_apic_id());
 }
-
-void __cpuinit mp_register_lapic(u8 id, u8 enabled)
+void __cpuinit mp_register_lapic(int id, u8 enabled)
 {
        if (!enabled) {
                ++disabled_cpus;
@@ -683,15 +620,11 @@ void __cpuinit mp_register_lapic(u8 id, u8 enabled)
        generic_processor_info(id, 0);
 }
 
+
 #define MP_ISA_BUS             0
 #define MP_MAX_IOAPIC_PIN      127
 
-static struct mp_ioapic_routing {
-       int apic_id;
-       int gsi_base;
-       int gsi_end;
-       u32 pin_programmed[4];
-} mp_ioapic_routing[MAX_IO_APICS];
+extern struct mp_ioapic_routing mp_ioapic_routing[MAX_IO_APICS];
 
 static int mp_find_ioapic(int gsi)
 {
@@ -722,7 +655,7 @@ static u8 uniq_ioapic_id(u8 id)
        return find_first_zero_bit(used, 256);
 }
 
-void __init mp_register_ioapic(u8 id, u32 address, u32 gsi_base)
+void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
 {
        int idx = 0;