Skip to contentSkip to conversation

x86: cleanup mpparse.c

PATCH In review Jan Beulich 1 participant 1 message Mar 9, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 4/11 x86: cleanup mpparse.c

Remove unused and pointless bits from mpparse.c (and other files where they are related to it). Of what remains, move whatever possible into .init.*, and some data items into .data.read_mostly.

xen/arch/x86/acpi/boot.c +4 -2
@@ -177,7 +177,8 @@ acpi_parse_x2apic(struct acpi_subtable_h
 	 * when we use CPU hotplug.
 	 */
 	mp_register_lapic(processor->id,	/* X2APIC ID */
-			  processor->flags.enabled);	/* Enabled? */
+			  processor->flags.enabled,	/* Enabled? */
+			  0);
 
 	return 0;
 }
@@ -206,7 +207,8 @@ acpi_parse_lapic(struct acpi_subtable_he
 	 * when we use CPU hotplug.
 	 */
 	mp_register_lapic(processor->id,	/* APIC ID */
-			  processor->flags.enabled);	/* Enabled? */
+			  processor->flags.enabled,	/* Enabled? */
+			  0);
 
 	return 0;
 }
xen/arch/x86/genapic/probe.c +0 -1
@@ -18,7 +18,6 @@
 
 extern const struct genapic apic_summit;
 extern const struct genapic apic_bigsmp;
-extern const struct genapic apic_default;
 
 const struct genapic *__read_mostly genapic;
 
xen/arch/x86/io_apic.c +0 -2
@@ -2491,8 +2491,6 @@ void dump_ioapic_irq_info(void)
     }
 }
 
-unsigned highest_gsi(void);
-
 static unsigned int __initdata max_gsi_irqs;
 integer_param("max_gsi_irqs", max_gsi_irqs);
 
xen/arch/x86/mpparse.c +33 -179

357 lines not on this page · raw message

xen/arch/x86/smpboot.c +1 -1
@@ -891,7 +891,7 @@ int cpu_add(uint32_t apic_id, uint32_t a
         goto out;
     }
 
-    if ( (cpu = mp_register_lapic(apic_id, 1)) < 0 )
+    if ( (cpu = mp_register_lapic(apic_id, 1, 1)) < 0 )
         goto out;
 
     x86_acpiid_to_apicid[acpi_id] = apic_id;
xen/include/asm-x86/genapic.h +1 -0
@@ -49,6 +49,7 @@ struct genapic { 
 	APICFUNC(acpi_madt_oem_check)
 
 extern const struct genapic *genapic;
+extern const struct genapic apic_default;
 
 const cpumask_t *target_cpus_all(void);
 
xen/include/asm-x86/io_apic.h +2 -0
@@ -212,4 +212,6 @@ static inline void ioapic_resume(void) {
 extern int assign_irq_vector(int irq);
 extern int free_irq_vector(int vector);
 
+unsigned highest_gsi(void);
+
 #endif
xen/include/asm-x86/mach-generic/mach_apic.h +1 -2
@@ -28,8 +28,7 @@ static inline void enable_apic_mode(void
 
 extern u32 bios_cpu_apicid[];
 
-static inline int mpc_apic_id(struct mpc_config_processor *m, u32 apicid,
-			struct mpc_config_translation *translation_record)
+static inline int mpc_apic_id(struct mpc_config_processor *m, u32 apicid)
 {
 	printk("Processor #%d %d:%d APIC version %d\n",
 			apicid,
xen/include/asm-x86/mach-generic/mach_mpparse.h +0 -11
@@ -1,17 +1,6 @@
 #ifndef _MACH_MPPARSE_H
 #define _MACH_MPPARSE_H 1
 
-static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 
-				struct mpc_config_translation *translation)
-{
-	Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
-}
-
-static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, 
-				struct mpc_config_translation *translation)
-{
-}
-
 int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid);
 int acpi_madt_oem_check(char *oem_id, char *oem_table_id);
 
xen/include/asm-x86/mpspec.h +6 -9
@@ -5,25 +5,22 @@
 #include <asm/mpspec_def.h>
 #include <mach_mpspec.h>
 
-extern int mp_bus_id_to_type [MAX_MP_BUSSES];
-extern int mp_bus_id_to_node [MAX_MP_BUSSES];
-extern int mp_bus_id_to_local [MAX_MP_BUSSES];
-extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES];
+extern unsigned char mp_bus_id_to_type[MAX_MP_BUSSES];
 
-extern unsigned int def_to_bigsmp;
+extern bool_t def_to_bigsmp;
 extern unsigned int boot_cpu_physical_apicid;
-extern int smp_found_config;
+extern bool_t smp_found_config;
 extern void find_smp_config (void);
 extern void get_smp_config (void);
-extern int apic_version [MAX_APICS];
+extern unsigned char apic_version [MAX_APICS];
 extern int mp_irq_entries;
 extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOURCES];
 extern int mpc_default_type;
 extern unsigned long mp_lapic_addr;
-extern int pic_mode;
+extern bool_t pic_mode;
 
 #ifdef CONFIG_ACPI
-extern int mp_register_lapic (u32 id, u8 enabled);
+extern int mp_register_lapic(u32 id, bool_t enabled, bool_t hotplug);
 extern void mp_unregister_lapic(uint32_t apic_id, uint32_t cpu);
 extern void mp_register_lapic_address (u64 address);
 extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base);

Remove unused and pointless bits from mpparse.c (and other files where they are related to it). Of what remains, move whatever possible into .init.*, and some data items into .data.read_mostly.

xen/arch/x86/acpi/boot.c +4 -2
@@ -177,7 +177,8 @@ acpi_parse_x2apic(struct acpi_subtable_h
 	 * when we use CPU hotplug.
 	 */
 	mp_register_lapic(processor->id,	/* X2APIC ID */
-			  processor->flags.enabled);	/* Enabled? */
+			  processor->flags.enabled,	/* Enabled? */
+			  0);
 
 	return 0;
 }
@@ -206,7 +207,8 @@ acpi_parse_lapic(struct acpi_subtable_he
 	 * when we use CPU hotplug.
 	 */
 	mp_register_lapic(processor->id,	/* APIC ID */
-			  processor->flags.enabled);	/* Enabled? */
+			  processor->flags.enabled,	/* Enabled? */
+			  0);
 
 	return 0;
 }
xen/arch/x86/genapic/probe.c +0 -1
@@ -18,7 +18,6 @@
 
 extern const struct genapic apic_summit;
 extern const struct genapic apic_bigsmp;
-extern const struct genapic apic_default;
 
 const struct genapic *__read_mostly genapic;
 
xen/arch/x86/io_apic.c +0 -2
@@ -2491,8 +2491,6 @@ void dump_ioapic_irq_info(void)
     }
 }
 
-unsigned highest_gsi(void);
-
 static unsigned int __initdata max_gsi_irqs;
 integer_param("max_gsi_irqs", max_gsi_irqs);
 
xen/arch/x86/mpparse.c +33 -179

357 lines not on this page · raw message

xen/arch/x86/smpboot.c +1 -1
@@ -891,7 +891,7 @@ int cpu_add(uint32_t apic_id, uint32_t a
         goto out;
     }
 
-    if ( (cpu = mp_register_lapic(apic_id, 1)) < 0 )
+    if ( (cpu = mp_register_lapic(apic_id, 1, 1)) < 0 )
         goto out;
 
     x86_acpiid_to_apicid[acpi_id] = apic_id;
xen/include/asm-x86/genapic.h +1 -0
@@ -49,6 +49,7 @@ struct genapic { 
 	APICFUNC(acpi_madt_oem_check)
 
 extern const struct genapic *genapic;
+extern const struct genapic apic_default;
 
 const cpumask_t *target_cpus_all(void);
 
xen/include/asm-x86/io_apic.h +2 -0
@@ -212,4 +212,6 @@ static inline void ioapic_resume(void) {
 extern int assign_irq_vector(int irq);
 extern int free_irq_vector(int vector);
 
+unsigned highest_gsi(void);
+
 #endif
xen/include/asm-x86/mach-generic/mach_apic.h +1 -2
@@ -28,8 +28,7 @@ static inline void enable_apic_mode(void
 
 extern u32 bios_cpu_apicid[];
 
-static inline int mpc_apic_id(struct mpc_config_processor *m, u32 apicid,
-			struct mpc_config_translation *translation_record)
+static inline int mpc_apic_id(struct mpc_config_processor *m, u32 apicid)
 {
 	printk("Processor #%d %d:%d APIC version %d\n",
 			apicid,
xen/include/asm-x86/mach-generic/mach_mpparse.h +0 -11
@@ -1,17 +1,6 @@
 #ifndef _MACH_MPPARSE_H
 #define _MACH_MPPARSE_H 1
 
-static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 
-				struct mpc_config_translation *translation)
-{
-	Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
-}
-
-static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, 
-				struct mpc_config_translation *translation)
-{
-}
-
 int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid);
 int acpi_madt_oem_check(char *oem_id, char *oem_table_id);
 
xen/include/asm-x86/mpspec.h +6 -9
@@ -5,25 +5,22 @@
 #include <asm/mpspec_def.h>
 #include <mach_mpspec.h>
 
-extern int mp_bus_id_to_type [MAX_MP_BUSSES];
-extern int mp_bus_id_to_node [MAX_MP_BUSSES];
-extern int mp_bus_id_to_local [MAX_MP_BUSSES];
-extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES];
+extern unsigned char mp_bus_id_to_type[MAX_MP_BUSSES];
 
-extern unsigned int def_to_bigsmp;
+extern bool_t def_to_bigsmp;
 extern unsigned int boot_cpu_physical_apicid;
-extern int smp_found_config;
+extern bool_t smp_found_config;
 extern void find_smp_config (void);
 extern void get_smp_config (void);
-extern int apic_version [MAX_APICS];
+extern unsigned char apic_version [MAX_APICS];
 extern int mp_irq_entries;
 extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOURCES];
 extern int mpc_default_type;
 extern unsigned long mp_lapic_addr;
-extern int pic_mode;
+extern bool_t pic_mode;
 
 #ifdef CONFIG_ACPI
-extern int mp_register_lapic (u32 id, u8 enabled);
+extern int mp_register_lapic(u32 id, bool_t enabled, bool_t hotplug);
 extern void mp_unregister_lapic(uint32_t apic_id, uint32_t cpu);
 extern void mp_register_lapic_address (u64 address);
 extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel