1
2
3
4
5
6
7 #include <asm/cprefix.h>
8 #include <asm/head.h>
9 #include <asm/psr.h>
10 #include <asm/asi.h>
11 #include <asm/ptrace.h>
12 #include <asm/vaddrs.h>
13 #include <asm/contregs.h>
14
15
16 .text
17 .align 4
18
19
20
21
22
23
24 .globl C_LABEL(sparc_cpu_startup)
25 C_LABEL(sparc_cpu_startup):
26 cpu1_startup:
27 sethi %hi(C_LABEL(trapbase_cpu1)), %g7
28 or %g7, %lo(C_LABEL(trapbase_cpu1)), %g7
29 sethi %hi(C_LABEL(cpu1_stack)), %g6
30 or %g6, %lo(C_LABEL(cpu1_stack)), %g6
31 b 1f
32 nop
33
34 cpu2_startup:
35 sethi %hi(C_LABEL(trapbase_cpu2)), %g7
36 or %g7, %lo(C_LABEL(trapbase_cpu2)), %g7
37 sethi %hi(C_LABEL(cpu2_stack)), %g6
38 or %g6, %lo(C_LABEL(cpu2_stack)), %g6
39 b 1f
40 nop
41
42 cpu3_startup:
43 sethi %hi(C_LABEL(trapbase_cpu3)), %g7
44 or %g7, %lo(C_LABEL(trapbase_cpu3)), %g7
45 sethi %hi(C_LABEL(cpu3_stack)), %g6
46 or %g6, %lo(C_LABEL(cpu3_stack)), %g6
47 b 1f
48 nop
49
50 1:
51
52 set (PSR_PIL | PSR_S | PSR_PS), %g1
53 wr %g1, 0x0, %psr ! traps off though
54 WRITE_PAUSE
55
56
57 mov 2, %g1
58 wr %g1, 0x0, %wim
59 WRITE_PAUSE
60
61
62 wr %g7, 0x0, %tbr
63 WRITE_PAUSE
64
65
66 set 0x2000, %g5
67 add %g6, %g5, %g6 ! end of stack
68 sub %g6, REGWIN_SZ, %sp
69 mov 0, %fp
70
71
72 rd %psr, %g1
73 wr %g1, PSR_ET, %psr ! traps on
74 WRITE_PAUSE
75
76
77 set C_LABEL(poke_srmmu), %g5
78 ld [%g5], %g5
79 call %g5
80 nop
81
82
83 call C_LABEL(smp_callin)
84 nop
85
86 call C_LABEL(cpu_idle)
87 mov 0, %o0
88
89 call C_LABEL(cpu_panic)
90 nop