1/8 Move NUMA-Q support into subarch
PATCH 1/1 1/8 Move NUMA-Q support into subarch
Patch from John Stultz. This just reorganises the subarch files to put all the headers under the include dir, instead of mixing them up with the C files. The only interesting part is the top section where he makes it fall back from the subarch dir to the default dir if there's no .h file under the subarch dir.
This patch means we can create multiple subarches without copying every single file that any subarch wants into all the directories. And is much tidier, IMHO.
arch/i386/Makefile +14 -8
@@ -46,25 +46,31 @@ cflags-$(CONFIG_MCYRIXIII) += $(call che CFLAGS += $(cflags-y) -ifdef CONFIG_VISWS -MACHINE := mach-visws -else -MACHINE := mach-generic -endif +#default subarch .c files +mcore-y := mach-default + +#VISWS subarch support +mflags-$(CONFIG_VISWS) := -Iinclude/asm-i386/mach-visws +mcore-$(CONFIG_VISWS) := mach-visws + +#add other subarch support here + +#default subarch .h files +mflags-y += -Iinclude/asm-i386/mach-default HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o libs-y += arch/i386/lib/ core-y += arch/i386/kernel/ \ arch/i386/mm/ \ - arch/i386/$(MACHINE)/ + arch/i386/$(mcore-y)/ drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/ drivers-$(CONFIG_PCI) += arch/i386/pci/ # FIXME: is drivers- right ? drivers-$(CONFIG_OPROFILE) += arch/i386/oprofile/ -CFLAGS += -Iarch/i386/$(MACHINE) -AFLAGS += -Iarch/i386/$(MACHINE) +CFLAGS += $(mflags-y) +AFLAGS += $(mflags-y) makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/i386/boot $(1)
arch/i386/kernel/apic.c +2 -1
@@ -31,7 +31,8 @@#include <asm/pgalloc.h> #include <asm/desc.h> #include <asm/arch_hooks.h> -#include "mach_apic.h" + +#include <mach_apic.h> void __init apic_intr_init (void ) {
arch/i386/kernel/io_apic.c +2 -1
@@ -35,7 +35,8 @@#include <asm/io.h> #include <asm/smp.h> #include <asm/desc.h> -#include "mach_apic.h" + +#include <mach_apic.h> #undef APIC_LOCKUP_DEBUG
arch/i386/kernel/mpparse.c +2 -1
@@ -30,7 +30,8 @@#include <asm/mpspec.h> #include <asm/pgalloc.h> #include <asm/io_apic.h> -#include "mach_apic.h" + +#include <mach_apic.h> /* Have we found an MP table */ int smp_found_config;
arch/i386/kernel/smpboot.c +2 -1
@@ -51,7 +51,8 @@#include <asm/desc.h> #include <asm/arch_hooks.h> #include "smpboot_hooks.h" -#include "mach_apic.h" + +#include <mach_apic.h> /* Set if we find a B stepping CPU */ static int __initdata smp_b_stepping;
arch/i386/mach-default/Makefile +7 -0
@@ -0,0 +1,7 @@ +# +# Makefile for the linux kernel. +# + +EXTRA_CFLAGS += -I../kernel + +obj-y := setup.o topology.o
arch/i386/mach-default/setup.c +104 -0
104 lines not on this page · raw message
arch/i386/mach-default/topology.c +68 -0
68 lines not on this page · raw message
arch/i386/mach-generic/Makefile +0 -7
@@ -1,7 +0,0 @@ -# -# Makefile for the linux kernel. -# - -EXTRA_CFLAGS += -I../kernel - -obj-y := setup.o topology.o
arch/i386/mach-generic/do_timer.h +0 -82
82 lines not on this page · raw message
arch/i386/mach-generic/entry_arch.h +0 -34
@@ -1,34 +0,0 @@ -/* -* This file is designed to contain the BUILD_INTERRUPT specifications for -* all of the extra named interrupt vectors used by the architecture. -* Usually this is the Inter Process Interrupts (IPIs) -*/ - -/* -* The following vectors are part of the Linux architecture, there -* is no hardware IRQ pin equivalent for them, they are triggered -* through the ICC by us (IPIs) -*/ -#ifdef CONFIG_X86_SMP -BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) -BUILD_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR) -BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) -#endif - -/* -* every pentium local APIC has two 'local interrupts', with a -* soft-definable vector attached to both interrupts, one of -* which is a timer interrupt, the other one is error counter -* overflow. Linux uses the local APIC timer interrupt to get -* a much simpler SMP time architecture: -*/ -#ifdef CONFIG_X86_LOCAL_APIC -BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR) -BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR) -BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR) - -#ifdef CONFIG_X86_MCE_P4THERMAL -BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR) -#endif - -#endif
arch/i386/mach-generic/irq_vectors.h +0 -85
85 lines not on this page · raw message
arch/i386/mach-generic/mach_apic.h +0 -46
46 lines not on this page · raw message
arch/i386/mach-generic/setup.c +0 -104
104 lines not on this page · raw message
arch/i386/mach-generic/setup_arch_post.h +0 -40
@@ -1,40 +0,0 @@ -/** -* machine_specific_memory_setup - Hook for machine specific memory setup. -* -* Description: -* This is included late in kernel/setup.c so that it can make -* use of all of the static functions. -**/ - -static inline char *__init machine_specific_memory_setup (void ) -{ -char *who; - - - who ="BIOS-e820" ; - -/* -* Try to copy the BIOS-supplied E820-map. -* -* Otherwise fake a memory map; one section from 0k->640k, -* the next section from 1mb->appropriate_mem_k -*/ -sanitize_e820_map (E820_MAP , &E820_MAP_NR ); -if (copy_e820_map (E820_MAP ,E820_MAP_NR ) <0 ) { -unsigned long mem_size; - -/* compare results from other methods and take the greater */ -if (ALT_MEM_K <EXT_MEM_K ) { - mem_size =EXT_MEM_K ; - who ="BIOS-88" ; - }else { - mem_size =ALT_MEM_K ; - who ="BIOS-e801" ; - } - - e820.nr_map =0 ; -add_memory_region (0 ,LOWMEMSIZE (),E820_RAM ); -add_memory_region (HIGH_MEMORY , mem_size <<10 ,E820_RAM ); - } -return who; -}
arch/i386/mach-generic/setup_arch_pre.h +0 -5
@@ -1,5 +0,0 @@ -/* Hook to call BIOS initialisation function */ - -/* no action for generic */ - -#define ARCH_SETUP
arch/i386/mach-generic/smpboot_hooks.h +0 -33
@@ -1,33 +0,0 @@ -/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws -* which needs to alter them. */ - -static inline void smpboot_clear_io_apic_irqs (void ) -{ - io_apic_irqs =0 ; -} - -static inline void smpboot_setup_warm_reset_vector (void ) -{ -/* -* Install writable page 0 entry to set BIOS data area. -*/ -local_flush_tlb (); - -/* -* Paranoid: Set warm reset code and vector here back -* to default values. -*/ -CMOS_WRITE (0 ,0xf ); - - *((volatile long *)phys_to_virt (0x467 )) =0 ; -} - -static inline void smpboot_setup_io_apic (void ) -{ -/* -* Here we can be sure that there is an IO-APIC in the system. Let's -* go and set it up: -*/ -if (!skip_ioapic_setup && nr_ioapics) -setup_IO_APIC (); -}
arch/i386/mach-generic/topology.c +0 -68
68 lines not on this page · raw message
arch/i386/mach-summit/mach_apic.h +0 -57
57 lines not on this page · raw message
arch/i386/mach-visws/do_timer.h +0 -49
49 lines not on this page · raw message
arch/i386/mach-visws/entry_arch.h +0 -23
@@ -1,23 +0,0 @@ -/* -* The following vectors are part of the Linux architecture, there -* is no hardware IRQ pin equivalent for them, they are triggered -* through the ICC by us (IPIs) -*/ -#ifdef CONFIG_X86_SMP -BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) -BUILD_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR) -BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) -#endif - -/* -* every pentium local APIC has two 'local interrupts', with a -* soft-definable vector attached to both interrupts, one of -* which is a timer interrupt, the other one is error counter -* overflow. Linux uses the local APIC timer interrupt to get -* a much simpler SMP time architecture: -*/ -#ifdef CONFIG_X86_LOCAL_APIC -BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR) -BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR) -BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR) -#endif
arch/i386/mach-visws/irq_vectors.h +0 -64
64 lines not on this page · raw message
arch/i386/mach-visws/setup_arch_post.h +0 -37
@@ -1,37 +0,0 @@ -/* Hook for machine specific memory setup. -* -* This is included late in kernel/setup.c so that it can make use of all of -* the static functions. */ - -static inline char *__init machine_specific_memory_setup (void ) -{ -char *who; - - - who ="BIOS-e820" ; - -/* -* Try to copy the BIOS-supplied E820-map. -* -* Otherwise fake a memory map; one section from 0k->640k, -* the next section from 1mb->appropriate_mem_k -*/ -sanitize_e820_map (E820_MAP , &E820_MAP_NR ); -if (copy_e820_map (E820_MAP ,E820_MAP_NR ) <0 ) { -unsigned long mem_size; - -/* compare results from other methods and take the greater */ -if (ALT_MEM_K <EXT_MEM_K ) { - mem_size =EXT_MEM_K ; - who ="BIOS-88" ; - }else { - mem_size =ALT_MEM_K ; - who ="BIOS-e801" ; - } - - e820.nr_map =0 ; -add_memory_region (0 ,LOWMEMSIZE (),E820_RAM ); -add_memory_region (HIGH_MEMORY , mem_size <<10 ,E820_RAM ); - } -return who; -}
arch/i386/mach-visws/setup_arch_pre.h +0 -5
@@ -1,5 +0,0 @@ -/* Hook to call BIOS initialisation function */ - -/* no action for visws */ - -#define ARCH_SETUP
arch/i386/mach-visws/smpboot_hooks.h +0 -13
@@ -1,13 +0,0 @@ -/* for visws do nothing for any of these */ - -static inline void smpboot_clear_io_apic_irqs (void ) -{ -} - -static inline void smpboot_setup_warm_reset_vector (void ) -{ -} - -static inline void smpboot_setup_io_apic (void ) -{ -}
arch/i386/mach-voyager/do_timer.h +0 -22
@@ -1,22 +0,0 @@ -/* defines for inline arch setup functions */ -#include <asm/voyager.h> - -static inline void do_timer_interrupt_hook (struct pt_regs *regs) -{ -do_timer (regs); - -voyager_timer_interrupt (regs); -} - -static inline int do_timer_overflow (int count) -{ -/* can't read the ISR, just assume 1 tick -overflow */ -if (count >LATCH || count <0 ) { -printk (KERN_ERR "VOYAGER PROBLEM: count is %d, latch is %d\n" , count,LATCH ); - count =LATCH ; - } - count -=LATCH ; - -return count; -}
arch/i386/mach-voyager/entry_arch.h +0 -26
@@ -1,26 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8 -*- */ - -/* Copyright (C) 2002 -* -* Author: [email protected] -* -* linux/arch/i386/voyager/entry_arch.h -* -* This file builds the VIC and QIC CPI gates -*/ - -/* initialise the voyager interrupt gates -* -* This uses the macros in irq.h to set up assembly jump gates. The -* calls are then redirected to the same routine with smp_ prefixed */ -BUILD_INTERRUPT(vic_sys_interrupt, VIC_SYS_INT) -BUILD_INTERRUPT(vic_cmn_interrupt, VIC_CMN_INT) -BUILD_INTERRUPT (vic_cpi_interrupt,VIC_CPI_LEVEL0 ); - -/* do all the QIC interrupts */ -BUILD_INTERRUPT (qic_timer_interrupt,QIC_TIMER_CPI ); -BUILD_INTERRUPT (qic_invalidate_interrupt,QIC_INVALIDATE_CPI ); -BUILD_INTERRUPT (qic_reschedule_interrupt,QIC_RESCHEDULE_CPI ); -BUILD_INTERRUPT (qic_enable_irq_interrupt,QIC_ENABLE_IRQ_CPI ); -BUILD_INTERRUPT (qic_call_function_interrupt,QIC_CALL_FUNCTION_CPI ); -
arch/i386/mach-voyager/irq_vectors.h +0 -71
71 lines not on this page · raw message
arch/i386/mach-voyager/setup_arch_post.h +0 -73
73 lines not on this page · raw message
arch/i386/mach-voyager/setup_arch_pre.h +0 -10
@@ -1,10 +0,0 @@ -#include <asm/voyager.h> -#define VOYAGER_BIOS_INFO ((struct voyager_bios_info *)(PARAM+0x40)) - -/* Hook to call BIOS initialisation function */ - -/* for voyager, pass the voyager BIOS/SUS info area to the detection -* routines */ - -#define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO); -
include/asm-i386/mach-default/do_timer.h +82 -0
82 lines not on this page · raw message
include/asm-i386/mach-default/entry_arch.h +34 -0
@@ -0,0 +1,34 @@ +/* +* This file is designed to contain the BUILD_INTERRUPT specifications for +* all of the extra named interrupt vectors used by the architecture. +* Usually this is the Inter Process Interrupts (IPIs) +*/ + +/* +* The following vectors are part of the Linux architecture, there +* is no hardware IRQ pin equivalent for them, they are triggered +* through the ICC by us (IPIs) +*/ +#ifdef CONFIG_X86_SMP +BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) +BUILD_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR) +BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) +#endif + +/* +* every pentium local APIC has two 'local interrupts', with a +* soft-definable vector attached to both interrupts, one of +* which is a timer interrupt, the other one is error counter +* overflow. Linux uses the local APIC timer interrupt to get +* a much simpler SMP time architecture: +*/ +#ifdef CONFIG_X86_LOCAL_APIC +BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR) +BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR) +BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR) + +#ifdef CONFIG_X86_MCE_P4THERMAL +BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR) +#endif + +#endif
include/asm-i386/mach-default/irq_vectors.h +85 -0
85 lines not on this page · raw message
include/asm-i386/mach-default/mach_apic.h +46 -0
46 lines not on this page · raw message
include/asm-i386/mach-default/setup_arch_post.h +40 -0
@@ -0,0 +1,40 @@ +/** +* machine_specific_memory_setup - Hook for machine specific memory setup. +* +* Description: +* This is included late in kernel/setup.c so that it can make +* use of all of the static functions. +**/ + +static inline char *__init machine_specific_memory_setup (void ) +{ +char *who; + + + who ="BIOS-e820" ; + +/* +* Try to copy the BIOS-supplied E820-map. +* +* Otherwise fake a memory map; one section from 0k->640k, +* the next section from 1mb->appropriate_mem_k +*/ +sanitize_e820_map (E820_MAP , &E820_MAP_NR ); +if (copy_e820_map (E820_MAP ,E820_MAP_NR ) <0 ) { +unsigned long mem_size; + +/* compare results from other methods and take the greater */ +if (ALT_MEM_K <EXT_MEM_K ) { + mem_size =EXT_MEM_K ; + who ="BIOS-88" ; + }else { + mem_size =ALT_MEM_K ; + who ="BIOS-e801" ; + } + + e820.nr_map =0 ; +add_memory_region (0 ,LOWMEMSIZE (),E820_RAM ); +add_memory_region (HIGH_MEMORY , mem_size <<10 ,E820_RAM ); + } +return who; +}
include/asm-i386/mach-default/setup_arch_pre.h +5 -0
@@ -0,0 +1,5 @@ +/* Hook to call BIOS initialisation function */ + +/* no action for generic */ + +#define ARCH_SETUP
include/asm-i386/mach-default/smpboot_hooks.h +33 -0
@@ -0,0 +1,33 @@ +/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws +* which needs to alter them. */ + +static inline void smpboot_clear_io_apic_irqs (void ) +{ + io_apic_irqs =0 ; +} + +static inline void smpboot_setup_warm_reset_vector (void ) +{ +/* +* Install writable page 0 entry to set BIOS data area. +*/ +local_flush_tlb (); + +/* +* Paranoid: Set warm reset code and vector here back +* to default values. +*/ +CMOS_WRITE (0 ,0xf ); + + *((volatile long *)phys_to_virt (0x467 )) =0 ; +} + +static inline void smpboot_setup_io_apic (void ) +{ +/* +* Here we can be sure that there is an IO-APIC in the system. Let's +* go and set it up: +*/ +if (!skip_ioapic_setup && nr_ioapics) +setup_IO_APIC (); +}
include/asm-i386/mach-summit/mach_apic.h +57 -0
57 lines not on this page · raw message
include/asm-i386/mach-visws/do_timer.h +49 -0
49 lines not on this page · raw message
include/asm-i386/mach-visws/entry_arch.h +23 -0
@@ -0,0 +1,23 @@ +/* +* The following vectors are part of the Linux architecture, there +* is no hardware IRQ pin equivalent for them, they are triggered +* through the ICC by us (IPIs) +*/ +#ifdef CONFIG_X86_SMP +BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) +BUILD_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR) +BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) +#endif + +/* +* every pentium local APIC has two 'local interrupts', with a +* soft-definable vector attached to both interrupts, one of +* which is a timer interrupt, the other one is error counter +* overflow. Linux uses the local APIC timer interrupt to get +* a much simpler SMP time architecture: +*/ +#ifdef CONFIG_X86_LOCAL_APIC +BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR) +BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR) +BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR) +#endif
include/asm-i386/mach-visws/irq_vectors.h +64 -0
64 lines not on this page · raw message
include/asm-i386/mach-visws/setup_arch_post.h +37 -0
@@ -0,0 +1,37 @@ +/* Hook for machine specific memory setup. +* +* This is included late in kernel/setup.c so that it can make use of all of +* the static functions. */ + +static inline char *__init machine_specific_memory_setup (void ) +{ +char *who; + + + who ="BIOS-e820" ; + +/* +* Try to copy the BIOS-supplied E820-map. +* +* Otherwise fake a memory map; one section from 0k->640k, +* the next section from 1mb->appropriate_mem_k +*/ +sanitize_e820_map (E820_MAP , &E820_MAP_NR ); +if (copy_e820_map (E820_MAP ,E820_MAP_NR ) <0 ) { +unsigned long mem_size; + +/* compare results from other methods and take the greater */ +if (ALT_MEM_K <EXT_MEM_K ) { + mem_size =EXT_MEM_K ; + who ="BIOS-88" ; + }else { + mem_size =ALT_MEM_K ; + who ="BIOS-e801" ; + } + + e820.nr_map =0 ; +add_memory_region (0 ,LOWMEMSIZE (),E820_RAM ); +add_memory_region (HIGH_MEMORY , mem_size <<10 ,E820_RAM ); + } +return who; +}
include/asm-i386/mach-visws/setup_arch_pre.h +5 -0
@@ -0,0 +1,5 @@ +/* Hook to call BIOS initialisation function */ + +/* no action for visws */ + +#define ARCH_SETUP
include/asm-i386/mach-visws/smpboot_hooks.h +13 -0
@@ -0,0 +1,13 @@ +/* for visws do nothing for any of these */ + +static inline void smpboot_clear_io_apic_irqs (void ) +{ +} + +static inline void smpboot_setup_warm_reset_vector (void ) +{ +} + +static inline void smpboot_setup_io_apic (void ) +{ +}
include/asm-i386/mach-voyager/do_timer.h +22 -0
@@ -0,0 +1,22 @@ +/* defines for inline arch setup functions */ +#include <asm/voyager.h> + +static inline void do_timer_interrupt_hook (struct pt_regs *regs) +{ +do_timer (regs); + +voyager_timer_interrupt (regs); +} + +static inline int do_timer_overflow (int count) +{ +/* can't read the ISR, just assume 1 tick +overflow */ +if (count >LATCH || count <0 ) { +printk (KERN_ERR "VOYAGER PROBLEM: count is %d, latch is %d\n" , count,LATCH ); + count =LATCH ; + } + count -=LATCH ; + +return count; +}
include/asm-i386/mach-voyager/entry_arch.h +26 -0
@@ -0,0 +1,26 @@ +/* -*- mode: c; c-basic-offset: 8 -*- */ + +/* Copyright (C) 2002 +* +* Author: [email protected] +* +* linux/arch/i386/voyager/entry_arch.h +* +* This file builds the VIC and QIC CPI gates +*/ + +/* initialise the voyager interrupt gates +* +* This uses the macros in irq.h to set up assembly jump gates. The +* calls are then redirected to the same routine with smp_ prefixed */ +BUILD_INTERRUPT(vic_sys_interrupt, VIC_SYS_INT) +BUILD_INTERRUPT(vic_cmn_interrupt, VIC_CMN_INT) +BUILD_INTERRUPT (vic_cpi_interrupt,VIC_CPI_LEVEL0 ); + +/* do all the QIC interrupts */ +BUILD_INTERRUPT (qic_timer_interrupt,QIC_TIMER_CPI ); +BUILD_INTERRUPT (qic_invalidate_interrupt,QIC_INVALIDATE_CPI ); +BUILD_INTERRUPT (qic_reschedule_interrupt,QIC_RESCHEDULE_CPI ); +BUILD_INTERRUPT (qic_enable_irq_interrupt,QIC_ENABLE_IRQ_CPI ); +BUILD_INTERRUPT (qic_call_function_interrupt,QIC_CALL_FUNCTION_CPI ); +
include/asm-i386/mach-voyager/irq_vectors.h +71 -0
71 lines not on this page · raw message
include/asm-i386/mach-voyager/setup_arch_post.h +73 -0
73 lines not on this page · raw message
include/asm-i386/mach-voyager/setup_arch_pre.h +10 -0
@@ -0,0 +1,10 @@ +#include <asm/voyager.h> +#define VOYAGER_BIOS_INFO ((struct voyager_bios_info *)(PARAM+0x40)) + +/* Hook to call BIOS initialisation function */ + +/* for voyager, pass the voyager BIOS/SUS info area to the detection +* routines */ + +#define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO); +