diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-04-03 17:47:42 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-04-03 17:47:42 +0100 |
commit | 4b233c874995b8094af311962df7a1fc999595e7 (patch) | |
tree | db836133adaf82dcf4bd4a7f0d2d25e21da9d551 | |
parent | f55976facfbc63f0c8619070a5b2be32a915a67a (diff) | |
download | xen-4b233c874995b8094af311962df7a1fc999595e7.tar.gz xen-4b233c874995b8094af311962df7a1fc999595e7.tar.bz2 xen-4b233c874995b8094af311962df7a1fc999595e7.zip |
Clean up subarch 'mach-foo' header files. No need for
subarch apicdef.h and ipi.h can be much simplified.
Signed-off-by: Keir Fraser <keir@xensource.com>
22 files changed, 32 insertions, 194 deletions
diff --git a/xen/arch/x86/genapic/bigsmp.c b/xen/arch/x86/genapic/bigsmp.c index 61b594a409..4338e5765e 100644 --- a/xen/arch/x86/genapic/bigsmp.c +++ b/xen/arch/x86/genapic/bigsmp.c @@ -2,7 +2,6 @@ * APIC driver for "bigsmp" XAPIC machines with more than 8 virtual CPUs. * Drives the local APIC in "clustered mode". */ -#define APIC_DEFINITION 1 #include <xen/config.h> #include <xen/cpumask.h> #include <asm/current.h> @@ -14,9 +13,8 @@ #include <xen/smp.h> #include <xen/init.h> #include <xen/dmi.h> +#include <asm/mach_ipi.h> #include <asm/mach-bigsmp/mach_apic.h> -#include <asm/mach-bigsmp/mach_apicdef.h> -#include <asm/mach-bigsmp/mach_ipi.h> #include <asm/mach-default/mach_mpparse.h> static int dmi_bigsmp; /* can be set by dmi scanners */ @@ -52,4 +50,7 @@ static __init int probe_bigsmp(void) return dmi_bigsmp; } -struct genapic apic_bigsmp = APIC_INIT("bigsmp", probe_bigsmp); +struct genapic apic_bigsmp = { + APIC_INIT("bigsmp", probe_bigsmp), + .send_ipi_mask = send_IPI_mask_sequence +}; diff --git a/xen/arch/x86/genapic/default.c b/xen/arch/x86/genapic/default.c index d84cf41141..a7403922bb 100644 --- a/xen/arch/x86/genapic/default.c +++ b/xen/arch/x86/genapic/default.c @@ -1,12 +1,10 @@ /* * Default generic APIC driver. This handles upto 8 CPUs. */ -#define APIC_DEFINITION 1 #include <xen/config.h> #include <xen/cpumask.h> #include <asm/current.h> #include <asm/mpspec.h> -#include <asm/mach-default/mach_apicdef.h> #include <asm/genapic.h> #include <asm/fixmap.h> #include <asm/apicdef.h> @@ -14,8 +12,8 @@ #include <xen/string.h> #include <xen/smp.h> #include <xen/init.h> +#include <asm/mach_ipi.h> #include <asm/mach-default/mach_apic.h> -#include <asm/mach-default/mach_ipi.h> #include <asm/mach-default/mach_mpparse.h> /* should be called last. */ @@ -24,4 +22,7 @@ static __init int probe_default(void) return 1; } -struct genapic apic_default = APIC_INIT("default", probe_default); +struct genapic apic_default = { + APIC_INIT("default", probe_default), + .send_ipi_mask = send_IPI_mask_bitmask +}; diff --git a/xen/arch/x86/genapic/es7000.c b/xen/arch/x86/genapic/es7000.c index 05e94b0f04..37c959bf4c 100644 --- a/xen/arch/x86/genapic/es7000.c +++ b/xen/arch/x86/genapic/es7000.c @@ -1,7 +1,6 @@ /* * APIC driver for the Unisys ES7000 chipset. */ -#define APIC_DEFINITION 1 #include <xen/config.h> #include <xen/cpumask.h> #include <asm/current.h> @@ -14,11 +13,9 @@ #include <xen/string.h> #include <xen/smp.h> #include <xen/init.h> -#include <asm/mach-es7000/mach_apicdef.h> +#include <asm/mach_ipi.h> #include <asm/mach-es7000/mach_apic.h> -#include <asm/mach-es7000/mach_ipi.h> #include <asm/mach-es7000/mach_mpparse.h> -#include <asm/mach-es7000/mach_wakecpu.h> static __init int probe_es7000(void) { @@ -26,4 +23,7 @@ static __init int probe_es7000(void) return 0; } -struct genapic apic_es7000 = APIC_INIT("es7000", probe_es7000); +struct genapic apic_es7000 = { + APIC_INIT("es7000", probe_es7000), + .send_ipi_mask = send_IPI_mask_sequence +}; diff --git a/xen/arch/x86/genapic/probe.c b/xen/arch/x86/genapic/probe.c index cddde7a459..4b1d375b1d 100644 --- a/xen/arch/x86/genapic/probe.c +++ b/xen/arch/x86/genapic/probe.c @@ -103,8 +103,3 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) } return 0; } - -int hard_smp_processor_id(void) -{ - return genapic->get_apic_id(*(unsigned long *)(APIC_BASE+APIC_ID)); -} diff --git a/xen/arch/x86/genapic/summit.c b/xen/arch/x86/genapic/summit.c index 28a47f09de..acf191acfc 100644 --- a/xen/arch/x86/genapic/summit.c +++ b/xen/arch/x86/genapic/summit.c @@ -1,7 +1,6 @@ /* * APIC driver for the IBM "Summit" chipset. */ -#define APIC_DEFINITION 1 #include <xen/config.h> #include <xen/cpumask.h> #include <asm/current.h> @@ -13,9 +12,8 @@ #include <xen/string.h> #include <xen/smp.h> #include <xen/init.h> +#include <asm/mach_ipi.h> #include <asm/mach-summit/mach_apic.h> -#include <asm/mach-summit/mach_apicdef.h> -#include <asm/mach-summit/mach_ipi.h> #include <asm/mach-summit/mach_mpparse.h> static __init int probe_summit(void) @@ -24,4 +22,7 @@ static __init int probe_summit(void) return 0; } -struct genapic apic_summit = APIC_INIT("summit", probe_summit); +struct genapic apic_summit = { + APIC_INIT("summit", probe_summit), + .send_ipi_mask = send_IPI_mask_sequence +}; diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c index 18240da6f5..f94ad00517 100644 --- a/xen/arch/x86/smp.c +++ b/xen/arch/x86/smp.c @@ -20,8 +20,8 @@ #include <asm/flushtlb.h> #include <asm/smpboot.h> #include <asm/hardirq.h> +#include <asm/mach_ipi.h> #include <mach_apic.h> -#include <mach_ipi.h> /* * Some notes on x86 processor bugs affecting SMP operation: @@ -119,7 +119,7 @@ void send_IPI_mask_bitmask(cpumask_t cpumask, int vector) local_irq_restore(flags); } -inline void send_IPI_mask_sequence(cpumask_t mask, int vector) +void send_IPI_mask_sequence(cpumask_t mask, int vector) { unsigned long cfg, flags; unsigned int query_cpu; diff --git a/xen/include/asm-x86/apicdef.h b/xen/include/asm-x86/apicdef.h index 402b2a9da5..81bb2b84cb 100644 --- a/xen/include/asm-x86/apicdef.h +++ b/xen/include/asm-x86/apicdef.h @@ -11,6 +11,9 @@ #define APIC_DEFAULT_PHYS_BASE 0xfee00000 #define APIC_ID 0x20 +#define APIC_ID_MASK (0xFFu<<24) +#define GET_APIC_ID(x) (((x)>>24)&0xFFu) +#define SET_APIC_ID(x) (((x)<<24)) #define APIC_LVR 0x30 #define APIC_LVR_MASK 0xFF00FF #define GET_APIC_VERSION(x) ((x)&0xFF) diff --git a/xen/include/asm-x86/genapic.h b/xen/include/asm-x86/genapic.h index 2c7fa476f3..751e1dfc28 100644 --- a/xen/include/asm-x86/genapic.h +++ b/xen/include/asm-x86/genapic.h @@ -49,16 +49,15 @@ struct genapic { char *productid); int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id); - unsigned (*get_apic_id)(unsigned long x); unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask); /* ipi */ - void (*send_IPI_mask)(cpumask_t mask, int vector); + void (*send_ipi_mask)(cpumask_t mask, int vector); }; #define APICFUNC(x) .x = x -#define APIC_INIT(aname, aprobe) { \ +#define APIC_INIT(aname, aprobe) \ .name = aname, \ .probe = aprobe, \ .int_delivery_mode = INT_DELIVERY_MODE, \ @@ -79,13 +78,10 @@ struct genapic { APICFUNC(apicid_to_cpu_present), \ APICFUNC(check_phys_apicid_present), \ APICFUNC(mps_oem_check), \ - APICFUNC(get_apic_id), \ APICFUNC(cpu_mask_to_apicid), \ APICFUNC(acpi_madt_oem_check), \ - APICFUNC(send_IPI_mask), \ APICFUNC(enable_apic_mode), \ - APICFUNC(phys_pkg_id), \ - } + APICFUNC(phys_pkg_id) extern struct genapic *genapic; diff --git a/xen/include/asm-x86/mach-bigsmp/mach_apicdef.h b/xen/include/asm-x86/mach-bigsmp/mach_apicdef.h deleted file mode 100644 index 4842ed8ba2..0000000000 --- a/xen/include/asm-x86/mach-bigsmp/mach_apicdef.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASM_MACH_APICDEF_H -#define __ASM_MACH_APICDEF_H - -static inline unsigned get_apic_id(unsigned long x) -{ - return (((x)>>24)&0xFF); -} - -#define GET_APIC_ID(x) get_apic_id(x) - -#endif diff --git a/xen/include/asm-x86/mach-bigsmp/mach_ipi.h b/xen/include/asm-x86/mach-bigsmp/mach_ipi.h deleted file mode 100644 index c487589d94..0000000000 --- a/xen/include/asm-x86/mach-bigsmp/mach_ipi.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASM_MACH_IPI_H -#define __ASM_MACH_IPI_H - -void send_IPI_mask_sequence(cpumask_t mask, int vector); - -static inline void send_IPI_mask(cpumask_t mask, int vector) -{ - send_IPI_mask_sequence(mask, vector); -} - -#endif /* __ASM_MACH_IPI_H */ diff --git a/xen/include/asm-x86/mach-default/mach_apic.h b/xen/include/asm-x86/mach-default/mach_apic.h index b1c76fe27b..c673ae24bb 100644 --- a/xen/include/asm-x86/mach-default/mach_apic.h +++ b/xen/include/asm-x86/mach-default/mach_apic.h @@ -1,7 +1,6 @@ #ifndef __ASM_MACH_APIC_H #define __ASM_MACH_APIC_H -#include <mach_apicdef.h> #include <asm/smp.h> #define APIC_DFR_VALUE (APIC_DFR_FLAT) diff --git a/xen/include/asm-x86/mach-default/mach_apicdef.h b/xen/include/asm-x86/mach-default/mach_apicdef.h deleted file mode 100644 index db8c9237e0..0000000000 --- a/xen/include/asm-x86/mach-default/mach_apicdef.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASM_MACH_APICDEF_H -#define __ASM_MACH_APICDEF_H - -static inline unsigned get_apic_id(unsigned long x) -{ - return (((x)>>24)&0xF); -} - -#define GET_APIC_ID(x) get_apic_id(x) - -#endif diff --git a/xen/include/asm-x86/mach-default/mach_ipi.h b/xen/include/asm-x86/mach-default/mach_ipi.h deleted file mode 100644 index 069f16cede..0000000000 --- a/xen/include/asm-x86/mach-default/mach_ipi.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASM_MACH_IPI_H -#define __ASM_MACH_IPI_H - -void send_IPI_mask_bitmask(cpumask_t mask, int vector); - -static inline void send_IPI_mask(cpumask_t mask, int vector) -{ - send_IPI_mask_bitmask(mask, vector); -} - -#endif /* __ASM_MACH_IPI_H */ diff --git a/xen/include/asm-x86/mach-generic/mach_mpspec.h b/xen/include/asm-x86/mach-default/mach_mpspec.h index 9ef0b941bb..9ef0b941bb 100644 --- a/xen/include/asm-x86/mach-generic/mach_mpspec.h +++ b/xen/include/asm-x86/mach-default/mach_mpspec.h diff --git a/xen/include/asm-x86/mach-es7000/mach_apicdef.h b/xen/include/asm-x86/mach-es7000/mach_apicdef.h deleted file mode 100644 index 4842ed8ba2..0000000000 --- a/xen/include/asm-x86/mach-es7000/mach_apicdef.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASM_MACH_APICDEF_H -#define __ASM_MACH_APICDEF_H - -static inline unsigned get_apic_id(unsigned long x) -{ - return (((x)>>24)&0xFF); -} - -#define GET_APIC_ID(x) get_apic_id(x) - -#endif diff --git a/xen/include/asm-x86/mach-es7000/mach_wakecpu.h b/xen/include/asm-x86/mach-es7000/mach_wakecpu.h deleted file mode 100644 index d43e0b6235..0000000000 --- a/xen/include/asm-x86/mach-es7000/mach_wakecpu.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef __ASM_MACH_WAKECPU_H -#define __ASM_MACH_WAKECPU_H - -/* - * This file copes with machines that wakeup secondary CPUs by the - * INIT, INIT, STARTUP sequence. - */ - -#ifdef CONFIG_ES7000_CLUSTERED_APIC -#define WAKE_SECONDARY_VIA_MIP -#else -#define WAKE_SECONDARY_VIA_INIT -#endif - -#ifdef WAKE_SECONDARY_VIA_MIP -extern int es7000_start_cpu(int cpu, unsigned long eip); -static inline int -wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip) -{ - int boot_error = 0; - boot_error = es7000_start_cpu(phys_apicid, start_eip); - return boot_error; -} -#endif - -#define TRAMPOLINE_LOW maddr_to_virt(0x467) -#define TRAMPOLINE_HIGH maddr_to_virt(0x469) - -#define boot_cpu_apicid boot_cpu_physical_apicid - -static inline void wait_for_init_deassert(atomic_t *deassert) -{ -#ifdef WAKE_SECONDARY_VIA_INIT - while (!atomic_read(deassert)); -#endif - return; -} - -/* Nothing to do for most platforms, since cleared by the INIT cycle */ -static inline void smp_callin_clear_local_apic(void) -{ -} - -static inline void store_NMI_vector(unsigned short *high, unsigned short *low) -{ -} - -static inline void restore_NMI_vector(unsigned short *high, unsigned short *low) -{ -} - -#if APIC_DEBUG - #define inquire_remote_apic(apicid) __inquire_remote_apic(apicid) -#else - #define inquire_remote_apic(apicid) {} -#endif - -#endif /* __ASM_MACH_WAKECPU_H */ diff --git a/xen/include/asm-x86/mach-generic/mach_apicdef.h b/xen/include/asm-x86/mach-generic/mach_apicdef.h deleted file mode 100644 index 78eada8442..0000000000 --- a/xen/include/asm-x86/mach-generic/mach_apicdef.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _GENAPIC_MACH_APICDEF_H -#define _GENAPIC_MACH_APICDEF_H 1 - -#ifndef APIC_DEFINITION -#include <asm/genapic.h> - -#define GET_APIC_ID (genapic->get_apic_id) -#endif - -#endif diff --git a/xen/include/asm-x86/mach-generic/mach_ipi.h b/xen/include/asm-x86/mach-generic/mach_ipi.h deleted file mode 100644 index 06bfd75100..0000000000 --- a/xen/include/asm-x86/mach-generic/mach_ipi.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _MACH_IPI_H -#define _MACH_IPI_H 1 - -#include <asm/genapic.h> - -#define send_IPI_mask (genapic->send_IPI_mask) - -#endif diff --git a/xen/include/asm-x86/mach-summit/mach_apicdef.h b/xen/include/asm-x86/mach-summit/mach_apicdef.h deleted file mode 100644 index 4842ed8ba2..0000000000 --- a/xen/include/asm-x86/mach-summit/mach_apicdef.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASM_MACH_APICDEF_H -#define __ASM_MACH_APICDEF_H - -static inline unsigned get_apic_id(unsigned long x) -{ - return (((x)>>24)&0xFF); -} - -#define GET_APIC_ID(x) get_apic_id(x) - -#endif diff --git a/xen/include/asm-x86/mach-summit/mach_ipi.h b/xen/include/asm-x86/mach-summit/mach_ipi.h deleted file mode 100644 index c487589d94..0000000000 --- a/xen/include/asm-x86/mach-summit/mach_ipi.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASM_MACH_IPI_H -#define __ASM_MACH_IPI_H - -void send_IPI_mask_sequence(cpumask_t mask, int vector); - -static inline void send_IPI_mask(cpumask_t mask, int vector) -{ - send_IPI_mask_sequence(mask, vector); -} - -#endif /* __ASM_MACH_IPI_H */ diff --git a/xen/include/asm-x86/mach-es7000/mach_ipi.h b/xen/include/asm-x86/mach_ipi.h index c487589d94..20936c8df0 100644 --- a/xen/include/asm-x86/mach-es7000/mach_ipi.h +++ b/xen/include/asm-x86/mach_ipi.h @@ -1,11 +1,11 @@ #ifndef __ASM_MACH_IPI_H #define __ASM_MACH_IPI_H +#include <asm/genapic.h> + +void send_IPI_mask_bitmask(cpumask_t mask, int vector); void send_IPI_mask_sequence(cpumask_t mask, int vector); -static inline void send_IPI_mask(cpumask_t mask, int vector) -{ - send_IPI_mask_sequence(mask, vector); -} +#define send_IPI_mask (genapic->send_ipi_mask) #endif /* __ASM_MACH_IPI_H */ diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h index f05c5feb0e..f23b915873 100644 --- a/xen/include/asm-x86/smp.h +++ b/xen/include/asm-x86/smp.h @@ -74,16 +74,11 @@ static inline int num_booting_cpus(void) #ifdef CONFIG_X86_LOCAL_APIC -#ifdef APIC_DEFINITION -extern int hard_smp_processor_id(void); -#else -#include <mach_apicdef.h> static inline int hard_smp_processor_id(void) { /* we don't want to mark this access volatile - bad code generation */ return GET_APIC_ID(*(unsigned int *)(APIC_BASE+APIC_ID)); } -#endif static __inline int logical_smp_processor_id(void) { |