@@ -14,8 +14,9 @@
* Alan Cox <Alan.Cox@linux.org>, 1995.
* Ingo Molnar <mingo@redhat.com>, 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)
@@ -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 {
@@ -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;
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@google.com> --- lib/x86/apic-defs.h | 3 ++- lib/x86/apic.c | 6 ++++-- lib/x86/apic.h | 3 --- 3 files changed, 6 insertions(+), 6 deletions(-)