Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Move Origin crapola into a machine-specific header file.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+83 -37
+6 -37
arch/mips/kernel/head.S
··· 22 22 #include <asm/page.h> 23 23 #include <asm/mipsregs.h> 24 24 #include <asm/stackframe.h> 25 - #ifdef CONFIG_SGI_IP27 26 - #include <asm/sn/addrs.h> 27 - #include <asm/sn/sn0/hubni.h> 28 - #include <asm/sn/klkernvars.h> 29 - #endif 25 + 26 + #include <kernel-entry-init.h> 30 27 31 28 .macro ARC64_TWIDDLE_PC 32 29 #if defined(CONFIG_ARC64) || defined(CONFIG_MAPPED_KERNEL) ··· 34 37 \@: 35 38 #endif 36 39 .endm 37 - 38 - #ifdef CONFIG_SGI_IP27 39 - /* 40 - * outputs the local nasid into res. IP27 stuff. 41 - */ 42 - .macro GET_NASID_ASM res 43 - dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID) 44 - ld \res, (\res) 45 - and \res, NSRI_NODEID_MASK 46 - dsrl \res, NSRI_NODEID_SHFT 47 - .endm 48 - #endif /* CONFIG_SGI_IP27 */ 49 40 50 41 /* 51 42 * inputs are the text nasid in t1, data nasid in t2. ··· 127 142 __INIT 128 143 129 144 NESTED(kernel_entry, 16, sp) # kernel entry point 130 - setup_c0_status_pri 131 145 132 - #ifdef CONFIG_SGI_IP27 133 - GET_NASID_ASM t1 134 - move t2, t1 # text and data are here 135 - MAPPED_KERNEL_SETUP_TLB 136 - #endif /* IP27 */ 146 + kernel_entry_setup # cpu specific setup 147 + 148 + setup_c0_status_pri 137 149 138 150 ARC64_TWIDDLE_PC 139 151 ··· 167 185 */ 168 186 NESTED(smp_bootstrap, 16, sp) 169 187 setup_c0_status_sec 170 - 171 - #ifdef CONFIG_SGI_IP27 172 - GET_NASID_ASM t1 173 - dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \ 174 - KLDIR_OFF_POINTER + CAC_BASE 175 - dsll t1, NASID_SHFT 176 - or t0, t0, t1 177 - ld t0, 0(t0) # t0 points to kern_vars struct 178 - lh t1, KV_RO_NASID_OFFSET(t0) 179 - lh t2, KV_RW_NASID_OFFSET(t0) 180 - MAPPED_KERNEL_SETUP_TLB 181 - ARC64_TWIDDLE_PC 182 - #endif /* CONFIG_SGI_IP27 */ 183 - 188 + smp_slave_setup 184 189 j start_secondary 185 190 END(smp_bootstrap) 186 191 #endif /* CONFIG_SMP */
+25
include/asm-mips/mach-generic/kernel-entry-init.h
··· 1 + /* 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 6 + * Copyright (C) 2005 Embedded Alley Solutions, Inc 7 + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) 8 + */ 9 + #ifndef __ASM_MACH_GENERIC_KERNEL_ENTRY_H 10 + #define __ASM_MACH_GENERIC_KERNEL_ENTRY_H 11 + 12 + /* Intentionally empty macro, used in head.S. Override in 13 + * arch/mips/mach-xxx/kernel-entry-init.h when necessary. 14 + */ 15 + .macro kernel_entry_setup 16 + .endm 17 + 18 + /* 19 + * Do SMP slave processor setup necessary before we can savely execute C code. 20 + */ 21 + .macro smp_slave_setup 22 + .endm 23 + 24 + 25 + #endif /* __ASM_MACH_GENERIC_KERNEL_ENTRY_H */
+52
include/asm-mips/mach-ip27/kernel-entry-init.h
··· 1 + /* 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 6 + * Copyright (C) 2000 Silicon Graphics, Inc. 7 + * Copyright (C) 2005 Ralf Baechle <ralf@linux-mips.org> 8 + */ 9 + #ifndef __ASM_MACH_IP27_KERNEL_ENTRY_H 10 + #define __ASM_MACH_IP27_KERNEL_ENTRY_H 11 + 12 + #include <asm/sn/addrs.h> 13 + #include <asm/sn/sn0/hubni.h> 14 + #include <asm/sn/klkernvars.h> 15 + 16 + /* 17 + * Returns the local nasid into res. 18 + */ 19 + .macro GET_NASID_ASM res 20 + dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID) 21 + ld \res, (\res) 22 + and \res, NSRI_NODEID_MASK 23 + dsrl \res, NSRI_NODEID_SHFT 24 + .endm 25 + 26 + /* 27 + * Intentionally empty macro, used in head.S. Override in 28 + * arch/mips/mach-xxx/kernel-entry-init.h when necessary. 29 + */ 30 + .macro kernel_entry_setup 31 + GET_NASID_ASM t1 32 + move t2, t1 # text and data are here 33 + MAPPED_KERNEL_SETUP_TLB 34 + .endm 35 + 36 + /* 37 + * Do SMP slave processor setup necessary before we can savely execute C code. 38 + */ 39 + .macro smp_slave_setup 40 + GET_NASID_ASM t1 41 + dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \ 42 + KLDIR_OFF_POINTER + CAC_BASE 43 + dsll t1, NASID_SHFT 44 + or t0, t0, t1 45 + ld t0, 0(t0) # t0 points to kern_vars struct 46 + lh t1, KV_RO_NASID_OFFSET(t0) 47 + lh t2, KV_RW_NASID_OFFSET(t0) 48 + MAPPED_KERNEL_SETUP_TLB 49 + ARC64_TWIDDLE_PC 50 + .endm 51 + 52 + #endif /* __ASM_MACH_IP27_KERNEL_ENTRY_H */