Remove unused and pointless bits from APIC handling code. Move some data items into .data.read_mostly. Adjust some types. Signed-off-by: Jan Beulich --- 2011-03-09.orig/xen/arch/x86/apic.c +++ 2011-03-09/xen/arch/x86/apic.c @@ -64,12 +64,12 @@ static struct { /* * Knob to control our willingness to enable the local APIC. */ -static int enable_local_apic __initdata = 0; /* -1=force-disable, +1=force-enable */ +static s8 __initdata enable_local_apic; /* -1=force-disable, +1=force-enable */ /* * Debug level */ -int apic_verbosity; +u8 __read_mostly apic_verbosity; static bool_t __initdata opt_x2apic = 1; boolean_param("x2apic", opt_x2apic); @@ -442,8 +442,6 @@ void __init sync_Arb_IDs(void) | APIC_DM_INIT); } -extern void __error_in_apic_c (void); - /* * An initial setup of the virtual wire mode. */ @@ -558,8 +556,7 @@ void __devinit setup_local_APIC(void) value = apic_read(APIC_LVR); ver = GET_APIC_VERSION(value); - if ((SPURIOUS_APIC_VECTOR & 0x0f) != 0x0f) - __error_in_apic_c(); + BUILD_BUG_ON((SPURIOUS_APIC_VECTOR & 0x0f) != 0x0f); /* * Double-check whether this APIC is really registered. @@ -1117,12 +1114,6 @@ static void __init wait_8254_wraparound( } /* - * Default initialization for 8254 timers. If we use other timers like HPET, - * we override this later - */ -void (*wait_timer_tick)(void) __initdata = wait_8254_wraparound; - -/* * This function sets up the local APIC timer, with a timeout of * 'clocks' APIC bus clock. During calibration we actually call * this function twice on the boot CPU, once with a bogus timeout @@ -1204,7 +1195,7 @@ static int __init calibrate_APIC_clock(v * for a wraparound to start exact measurement: * (the current tick might have been already half done) */ - wait_timer_tick(); + wait_8254_wraparound(); /* * We wrapped around just now. Let's start: @@ -1217,7 +1208,7 @@ static int __init calibrate_APIC_clock(v * Let's wait LOOPS wraprounds: */ for (i = 0; i < LOOPS; i++) - wait_timer_tick(); + wait_8254_wraparound(); tt2 = apic_read(APIC_TMCCT); if (cpu_has_tsc) --- 2011-03-09.orig/xen/arch/x86/genapic/bigsmp.c +++ 2011-03-09/xen/arch/x86/genapic/bigsmp.c @@ -12,12 +12,10 @@ #include #include -static int dmi_bigsmp; /* can be set by dmi scanners */ - static __init int force_bigsmp(struct dmi_system_id *d) { printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident); - dmi_bigsmp = 1; + def_to_bigsmp = 1; return 0; } @@ -42,11 +40,9 @@ static struct dmi_system_id __initdata b static __init int probe_bigsmp(void) { - if (def_to_bigsmp) - dmi_bigsmp = 1; - else + if (!def_to_bigsmp) dmi_check_system(bigsmp_dmi_table); - return dmi_bigsmp; + return def_to_bigsmp; } const struct genapic apic_bigsmp = { --- 2011-03-09.orig/xen/arch/x86/genapic/probe.c +++ 2011-03-09/xen/arch/x86/genapic/probe.c @@ -28,7 +28,7 @@ const struct genapic *apic_probe[] __ini NULL, }; -static int cmdline_apic; +static bool_t __initdata cmdline_apic; void __init generic_bigsmp_probe(void) { --- 2011-03-09.orig/xen/include/asm-x86/apic.h +++ 2011-03-09/xen/include/asm-x86/apic.h @@ -21,7 +21,7 @@ #define IO_APIC_REDIR_DEST_LOGICAL 0x00800 #define IO_APIC_REDIR_DEST_PHYSICAL 0x00000 -extern int apic_verbosity; +extern u8 apic_verbosity; extern bool_t x2apic_enabled; extern bool_t directed_eoi_enabled; @@ -177,8 +177,6 @@ static inline void ack_APIC_irq(void) apic_write_around(APIC_EOI, 0); } -extern void (*wait_timer_tick)(void); - extern int get_maxlvt(void); extern void clear_local_APIC(void); extern void connect_bsp_APIC (void);