From: "Martin J. Bligh" The "magic" switching in subarch was ugly when I put it there, and nobody liked it then (including me). It hasn't got any prettier since. Andi's generic arch stuff is a cleaner solution for now, so we can remove the old hacky stuff, and significantly simplify the code. All this does is replace "(x86_summit ? A : B)" with "A" everywhere. arch/i386/kernel/mpparse.c | 3 - include/asm-i386/mach-summit/mach_apic.h | 44 ++++++++-------------------- include/asm-i386/mach-summit/mach_mpparse.h | 6 --- 3 files changed, 13 insertions(+), 40 deletions(-) diff -puN include/asm-i386/mach-summit/mach_apic.h~cleanup-summit-subarch include/asm-i386/mach-summit/mach_apic.h --- 25/include/asm-i386/mach-summit/mach_apic.h~cleanup-summit-subarch 2003-06-06 20:47:53.000000000 -0700 +++ 25-akpm/include/asm-i386/mach-summit/mach_apic.h 2003-06-06 20:47:53.000000000 -0700 @@ -4,13 +4,7 @@ #include #include -#ifdef CONFIG_X86_GENERICARCH -#define x86_summit 1 /* must be an constant expressiona for generic arch */ -#else -extern int x86_summit; -#endif - -#define esr_disable (x86_summit ? 1 : 0) +#define esr_disable (1) #define NO_BALANCE_IRQ (0) #define XAPIC_DEST_CPUS_MASK 0x0Fu @@ -22,27 +16,27 @@ static inline unsigned long xapic_phys_t ((phys_apic) & XAPIC_DEST_CLUSTER_MASK) ); } -#define APIC_DFR_VALUE (x86_summit ? APIC_DFR_CLUSTER : APIC_DFR_FLAT) +#define APIC_DFR_VALUE (APIC_DFR_CLUSTER) static inline unsigned long target_cpus(void) { - return (x86_summit ? XAPIC_DEST_CPUS_MASK : cpu_online_map); + return XAPIC_DEST_CPUS_MASK; } #define TARGET_CPUS (target_cpus()) -#define INT_DELIVERY_MODE (x86_summit ? dest_Fixed : dest_LowestPrio) +#define INT_DELIVERY_MODE (dest_Fixed) #define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ #define APIC_BROADCAST_ID (0x0F) static inline unsigned long check_apicid_used(unsigned long bitmap, int apicid) { - return (x86_summit ? 0 : (bitmap & (1 << apicid))); + return 0; } /* we don't use the phys_cpu_present_map to indicate apicid presence */ static inline unsigned long check_apicid_present(int bit) { - return (x86_summit ? 1 : (phys_cpu_present_map & (1 << bit))); + return 1; } #define apicid_cluster(apicid) (apicid & 0xF0) @@ -53,10 +47,7 @@ static inline void init_apic_ldr(void) { unsigned long val, id; - if (x86_summit) - id = xapic_phys_to_log_apicid(hard_smp_processor_id()); - else - id = 1UL << smp_processor_id(); + id = xapic_phys_to_log_apicid(hard_smp_processor_id()); apic_write_around(APIC_DFR, APIC_DFR_VALUE); val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; val |= SET_APIC_LOGICAL_ID(id); @@ -75,8 +66,8 @@ static inline int apic_id_registered(voi static inline void clustered_apic_check(void) { - printk("Enabling APIC mode: %s. Using %d I/O APICs\n", - (x86_summit ? "Summit" : "Flat"), nr_ioapics); + printk("Enabling APIC mode: Summit. Using %d I/O APICs\n", + nr_ioapics); } static inline int apicid_to_node(int logical_apicid) @@ -93,24 +84,18 @@ static inline int cpu_to_logical_apicid( static inline int cpu_present_to_apicid(int mps_cpu) { - if (x86_summit) - return (int) bios_cpu_apicid[mps_cpu]; - else - return mps_cpu; + return (int) bios_cpu_apicid[mps_cpu]; } static inline ulong ioapic_phys_id_map(ulong phys_map) { /* For clustered we don't have a good way to do this yet - hack */ - return (x86_summit ? 0x0F : phys_map); + return 0x0F; } static inline unsigned long apicid_to_cpu_present(int apicid) { - if (x86_summit) - return 1; - else - return (1ul << apicid); + return 1; } static inline int mpc_apic_id(struct mpc_config_processor *m, @@ -130,10 +115,7 @@ static inline void setup_portio_remap(vo static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) { - if (x86_summit) - return (1); - else - return test_bit(boot_cpu_physical_apicid, &phys_cpu_present_map); + return 1; } static inline unsigned int cpu_mask_to_apicid (unsigned long cpumask) diff -puN arch/i386/kernel/mpparse.c~cleanup-summit-subarch arch/i386/kernel/mpparse.c --- 25/arch/i386/kernel/mpparse.c~cleanup-summit-subarch 2003-06-06 20:48:07.000000000 -0700 +++ 25-akpm/arch/i386/kernel/mpparse.c 2003-06-06 20:48:18.000000000 -0700 @@ -73,9 +73,6 @@ static unsigned int __initdata num_proce /* Bitmask of physically existing CPUs */ unsigned long phys_cpu_present_map; -#ifndef CONFIG_X86_GENERICARCH -int x86_summit = 0; -#endif u8 bios_cpu_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; /* diff -puN include/asm-i386/mach-summit/mach_mpparse.h~cleanup-summit-subarch include/asm-i386/mach-summit/mach_mpparse.h --- 25/include/asm-i386/mach-summit/mach_mpparse.h~cleanup-summit-subarch 2003-06-06 20:48:11.000000000 -0700 +++ 25-akpm/include/asm-i386/mach-summit/mach_mpparse.h 2003-06-06 20:48:18.000000000 -0700 @@ -21,9 +21,6 @@ static inline int mps_oem_check(struct m (!strncmp(productid, "VIGIL SMP", 9) || !strncmp(productid, "EXA", 3) || !strncmp(productid, "RUTHLESS SMP", 12))){ -#ifndef CONFIG_X86_GENERICARCH - x86_summit = 1; -#endif use_cyclone = 1; /*enable cyclone-timer*/ return 1; } @@ -36,9 +33,6 @@ static inline int acpi_madt_oem_check(ch if (!strncmp(oem_id, "IBM", 3) && (!strncmp(oem_table_id, "SERVIGIL", 8) || !strncmp(oem_table_id, "EXA", 3))){ -#ifndef CONFIG_X86_GENERICARCH - x86_summit = 1; -#endif use_cyclone = 1; /*enable cyclone-timer*/ return 1; } _