Commit 9f319fe0 authored by Andrew Morton's avatar Andrew Morton Committed by Anton Blanchard

[PATCH] cleanup conditionals in summit subarch

From: "Martin J. Bligh" <mbligh@aracnet.com>

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.
parent a8123da8
......@@ -73,9 +73,6 @@ static unsigned int __initdata num_processors;
/* 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 };
/*
......
......@@ -4,13 +4,7 @@
#include <linux/config.h>
#include <asm/smp.h>
#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_to_log_apicid(int phys_apic)
((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();
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(void)
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(int cpu)
static inline int cpu_present_to_apicid(int mps_cpu)
{
if (x86_summit)
return (int) bios_cpu_apicid[mps_cpu];
else
return 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);
}
static inline int mpc_apic_id(struct mpc_config_processor *m,
......@@ -130,10 +115,7 @@ static inline void setup_portio_remap(void)
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)
......
......@@ -21,9 +21,6 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
(!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(char *oem_id, char *oem_table_id)
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment