Make the pointers to the xAPIC and I/O APIC static as there are no users outside of apic.c. Opportunistically use #defines for the default values instead of open coding magic numbers. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx> --- lib/x86/apic-defs.h | 3 ++- lib/x86/apic.c | 6 ++++-- lib/x86/apic.h | 3 --- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/x86/apic-defs.h b/lib/x86/apic-defs.h index dabefe78..4db73da2 100644 --- a/lib/x86/apic-defs.h +++ b/lib/x86/apic-defs.h @@ -14,8 +14,9 @@ * Alan Cox <Alan.Cox@xxxxxxxxx>, 1995. * Ingo Molnar <mingo@xxxxxxxxxx>, 1999, 2000 */ +#define IO_APIC_DEFAULT_PHYS_BASE 0xfec00000 +#define APIC_DEFAULT_PHYS_BASE 0xfee00000 -#define APIC_DEFAULT_PHYS_BASE 0xfee00000 #define APIC_BSP (1UL << 8) #define APIC_EXTD (1UL << 10) #define APIC_EN (1UL << 11) diff --git a/lib/x86/apic.c b/lib/x86/apic.c index d7137b61..5d4c7766 100644 --- a/lib/x86/apic.c +++ b/lib/x86/apic.c @@ -5,8 +5,10 @@ #include "smp.h" #include "asm/barrier.h" -void *g_apic = (void *)0xfee00000; -void *g_ioapic = (void *)0xfec00000; +/* xAPIC and I/O APIC are identify mapped, and never relocated. */ +static void *g_apic = (void *)APIC_DEFAULT_PHYS_BASE; +static void *g_ioapic = (void *)IO_APIC_DEFAULT_PHYS_BASE; + u8 id_map[MAX_TEST_CPUS]; struct apic_ops { diff --git a/lib/x86/apic.h b/lib/x86/apic.h index 7844324b..6d27f047 100644 --- a/lib/x86/apic.h +++ b/lib/x86/apic.h @@ -6,9 +6,6 @@ extern u8 id_map[MAX_TEST_CPUS]; -extern void *g_apic; -extern void *g_ioapic; - typedef struct { uint8_t vector; uint8_t delivery_mode:3; -- 2.35.0.rc0.227.g00780c9af4-goog