6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #if defined(lint)
27 #include <sys/types.h>
28 #else /* lint */
29 #include "assym.h"
30 #endif /* lint */
31
32 #include <sys/asm_linkage.h>
33 #include <sys/machthread.h>
34 #include <sys/param.h>
35 #include <sys/vm_machparam.h>
36 #include <sys/privregs.h>
37 #include <sys/intreg.h>
38 #include <sys/vis.h>
39 #include <sys/clock.h>
40 #include <vm/hat_sfmmu.h>
41
42 #if !defined(lint)
43 .weak cpu_feature_init
44 .type cpu_feature_init, #function
45 #endif /* lint */
46
47 #if !defined(lint)
48 .weak cpu_early_feature_init
49 .type cpu_early_feature_init, #function
50 #endif /* lint */
51
52 /*
53 * Processor initialization
54 *
55 * This is the kernel entry point for other cpus except the first one.
56 * When the prom jumps to this location we are still executing with the
57 * prom's trap table. It expects the cpuid as its first parameter.
58 */
59
60 #if defined(lint)
61
62 /* ARGSUSED */
63 void
64 cpu_startup(int cpuid)
65 {}
66
67 #else /* lint */
68
69 ! allocate a temporary stack to run on while we figure who and
70 ! what we are.
71 .seg ".data"
72 .align 8
73 etmpstk:
74 .skip 2048
75 tmpstk:
76 .word 0
77
78 ENTRY_NP(cpu_startup)
79 !
80 ! Initialize CPU state registers
81 !
82 ! The boot cpu and other cpus are different. The boot cpu has gone
83 ! through boot, and its state might be affected as a result. The
84 ! other cpus' states come directly from the prom.
85 !
86 wrpr %g0, PSTATE_KERN, %pstate
87 wr %g0, %g0, %fprs ! clear fprs
88 CLEARTICKNPT ! allow user rdtick
137 !
138 ! Set up any required cpu feature
139 !
140 sethi %hi(cpu_feature_init), %o0
141 or %o0, %lo(cpu_feature_init), %o0
142 brz %o0, 1f
143 nop
144 call %o0
145 nop
146
147 1:
148 !
149 ! Resume the thread allocated for the CPU.
150 !
151 ldn [THREAD_REG + T_PC], %i7
152 ldn [THREAD_REG + T_SP], %fp
153 ret ! "return" into the thread
154 restore ! WILL cause underflow
155 SET_SIZE(cpu_startup)
156
157 #endif /* lint */
|
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #include "assym.h"
27
28 #include <sys/asm_linkage.h>
29 #include <sys/machthread.h>
30 #include <sys/param.h>
31 #include <sys/vm_machparam.h>
32 #include <sys/privregs.h>
33 #include <sys/intreg.h>
34 #include <sys/vis.h>
35 #include <sys/clock.h>
36 #include <vm/hat_sfmmu.h>
37
38 .weak cpu_feature_init
39 .type cpu_feature_init, #function
40
41 .weak cpu_early_feature_init
42 .type cpu_early_feature_init, #function
43
44 /*
45 * Processor initialization
46 *
47 * This is the kernel entry point for other cpus except the first one.
48 * When the prom jumps to this location we are still executing with the
49 * prom's trap table. It expects the cpuid as its first parameter.
50 */
51
52 ! allocate a temporary stack to run on while we figure who and
53 ! what we are.
54 .seg ".data"
55 .align 8
56 etmpstk:
57 .skip 2048
58 tmpstk:
59 .word 0
60
61 ENTRY_NP(cpu_startup)
62 !
63 ! Initialize CPU state registers
64 !
65 ! The boot cpu and other cpus are different. The boot cpu has gone
66 ! through boot, and its state might be affected as a result. The
67 ! other cpus' states come directly from the prom.
68 !
69 wrpr %g0, PSTATE_KERN, %pstate
70 wr %g0, %g0, %fprs ! clear fprs
71 CLEARTICKNPT ! allow user rdtick
120 !
121 ! Set up any required cpu feature
122 !
123 sethi %hi(cpu_feature_init), %o0
124 or %o0, %lo(cpu_feature_init), %o0
125 brz %o0, 1f
126 nop
127 call %o0
128 nop
129
130 1:
131 !
132 ! Resume the thread allocated for the CPU.
133 !
134 ldn [THREAD_REG + T_PC], %i7
135 ldn [THREAD_REG + T_SP], %fp
136 ret ! "return" into the thread
137 restore ! WILL cause underflow
138 SET_SIZE(cpu_startup)
139
|