Skip to content

Commit 7e35952

Browse files
committed
Move Origin crapola into a machine-specific header file.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent a0c3a5b commit 7e35952

3 files changed

Lines changed: 83 additions & 37 deletions

File tree

‎arch/mips/kernel/head.S‎

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@
2222
#include <asm/page.h>
2323
#include <asm/mipsregs.h>
2424
#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>
3027

3128
.macro ARC64_TWIDDLE_PC
3229
#if defined(CONFIG_ARC64) || defined(CONFIG_MAPPED_KERNEL)
@@ -38,18 +35,6 @@
3835
#endif
3936
.endm
4037

41-
#ifdef CONFIG_SGI_IP27
42-
/*
43-
* outputs the local nasid into res. IP27 stuff.
44-
*/
45-
.macro GET_NASID_ASM res
46-
dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID)
47-
ld \res, (\res)
48-
and \res, NSRI_NODEID_MASK
49-
dsrl \res, NSRI_NODEID_SHFT
50-
.endm
51-
#endif /* CONFIG_SGI_IP27 */
52-
5338
/*
5439
* inputs are the text nasid in t1, data nasid in t2.
5540
*/
@@ -142,13 +127,10 @@ EXPORT(_stext)
142127
__INIT
143128

144129
NESTED(kernel_entry, 16, sp) # kernel entry point
145-
setup_c0_status_pri
146130

147-
#ifdef CONFIG_SGI_IP27
148-
GET_NASID_ASM t1
149-
move t2, t1 # text and data are here
150-
MAPPED_KERNEL_SETUP_TLB
151-
#endif /* IP27 */
131+
kernel_entry_setup # cpu specific setup
132+
133+
setup_c0_status_pri
152134

153135
ARC64_TWIDDLE_PC
154136

@@ -185,20 +167,7 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
185167
*/
186168
NESTED(smp_bootstrap, 16, sp)
187169
setup_c0_status_sec
188-
189-
#ifdef CONFIG_SGI_IP27
190-
GET_NASID_ASM t1
191-
dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \
192-
KLDIR_OFF_POINTER + CAC_BASE
193-
dsll t1, NASID_SHFT
194-
or t0, t0, t1
195-
ld t0, 0(t0) # t0 points to kern_vars struct
196-
lh t1, KV_RO_NASID_OFFSET(t0)
197-
lh t2, KV_RW_NASID_OFFSET(t0)
198-
MAPPED_KERNEL_SETUP_TLB
199-
ARC64_TWIDDLE_PC
200-
#endif /* CONFIG_SGI_IP27 */
201-
170+
smp_slave_setup
202171
j start_secondary
203172
END(smp_bootstrap)
204173
#endif /* CONFIG_SMP */
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 */
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 */

0 commit comments

Comments
 (0)