Commit 80d21417 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ia32 subarch circular dependency fix

From: john stultz <johnstul@us.ibm.com>

This patch fixes a circular dependency (a function in mach_apic.h requires
hard_smp_processor_id() and hard_smp_processor_id() requires macros from
mach_apic.h) that has been in the subarch code for a bit, but was hacked
around with some #ifdefs.

With the inclusion of the generic-subarch the hack was dropped and bigsmp
and summit promptly broke.  So this makes things compile again.
parent a209bc78
...@@ -40,10 +40,18 @@ static inline unsigned long check_apicid_present(int bit) ...@@ -40,10 +40,18 @@ static inline unsigned long check_apicid_present(int bit)
#define apicid_cluster(apicid) (apicid & 0xF0) #define apicid_cluster(apicid) (apicid & 0xF0)
static inline unsigned get_apic_id(unsigned long x)
{
return (((x)>>24)&0x0F);
}
#define GET_APIC_ID(x) get_apic_id(x)
static inline unsigned long calculate_ldr(unsigned long old) static inline unsigned long calculate_ldr(unsigned long old)
{ {
unsigned long id; unsigned long id;
id = xapic_phys_to_log_apicid(hard_smp_processor_id()); id = xapic_phys_to_log_apicid(
GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR)));
return ((old & ~APIC_LDR_MASK) | SET_APIC_LOGICAL_ID(id)); return ((old & ~APIC_LDR_MASK) | SET_APIC_LOGICAL_ID(id));
} }
...@@ -129,13 +137,6 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) ...@@ -129,13 +137,6 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
#define APIC_ID_MASK (0x0F<<24) #define APIC_ID_MASK (0x0F<<24)
static inline unsigned get_apic_id(unsigned long x)
{
return (((x)>>24)&0x0F);
}
#define GET_APIC_ID(x) get_apic_id(x)
static inline unsigned int cpu_mask_to_apicid (unsigned long cpumask) static inline unsigned int cpu_mask_to_apicid (unsigned long cpumask)
{ {
int num_bits_set; int num_bits_set;
......
...@@ -48,12 +48,20 @@ static inline unsigned long check_apicid_present(int bit) ...@@ -48,12 +48,20 @@ static inline unsigned long check_apicid_present(int bit)
extern u8 bios_cpu_apicid[]; extern u8 bios_cpu_apicid[];
static inline unsigned get_apic_id(unsigned long x)
{
return (((x)>>24)&0xFF);
}
#define GET_APIC_ID(x) get_apic_id(x)
static inline void init_apic_ldr(void) static inline void init_apic_ldr(void)
{ {
unsigned long val, id; unsigned long val, id;
if (x86_summit) if (x86_summit)
id = xapic_phys_to_log_apicid(hard_smp_processor_id()); id = xapic_phys_to_log_apicid(
GET_APIC_ID(*(unsigned long *)(APIC_BASE+APIC_ID)));
else else
id = 1UL << smp_processor_id(); id = 1UL << smp_processor_id();
apic_write_around(APIC_DFR, APIC_DFR_VALUE); apic_write_around(APIC_DFR, APIC_DFR_VALUE);
...@@ -137,13 +145,6 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) ...@@ -137,13 +145,6 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
#define APIC_ID_MASK (0xFF<<24) #define APIC_ID_MASK (0xFF<<24)
static inline unsigned get_apic_id(unsigned long x)
{
return (((x)>>24)&0xFF);
}
#define GET_APIC_ID(x) get_apic_id(x)
static inline unsigned int cpu_mask_to_apicid (unsigned long cpumask) static inline unsigned int cpu_mask_to_apicid (unsigned long cpumask)
{ {
int num_bits_set; int num_bits_set;
......
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