Print this page
de-linting of .s files
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/sun4/ml/proc_init.s
+++ new/usr/src/uts/sun4/ml/proc_init.s
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 -#if defined(lint)
27 -#include <sys/types.h>
28 -#else /* lint */
29 26 #include "assym.h"
30 -#endif /* lint */
31 27
32 28 #include <sys/asm_linkage.h>
33 29 #include <sys/machthread.h>
34 30 #include <sys/param.h>
35 31 #include <sys/vm_machparam.h>
36 32 #include <sys/privregs.h>
37 33 #include <sys/intreg.h>
38 34 #include <sys/vis.h>
39 35 #include <sys/clock.h>
40 36 #include <vm/hat_sfmmu.h>
41 37
42 -#if !defined(lint)
43 38 .weak cpu_feature_init
44 39 .type cpu_feature_init, #function
45 -#endif /* lint */
46 40
47 -#if !defined(lint)
48 41 .weak cpu_early_feature_init
49 42 .type cpu_early_feature_init, #function
50 -#endif /* lint */
51 43
52 44 /*
53 45 * Processor initialization
54 46 *
55 47 * This is the kernel entry point for other cpus except the first one.
56 48 * When the prom jumps to this location we are still executing with the
57 49 * prom's trap table. It expects the cpuid as its first parameter.
58 50 */
59 51
60 -#if defined(lint)
61 -
62 -/* ARGSUSED */
63 -void
64 -cpu_startup(int cpuid)
65 -{}
66 -
67 -#else /* lint */
68 -
69 52 ! allocate a temporary stack to run on while we figure who and
70 53 ! what we are.
71 54 .seg ".data"
72 55 .align 8
73 56 etmpstk:
74 57 .skip 2048
75 58 tmpstk:
76 59 .word 0
77 60
78 61 ENTRY_NP(cpu_startup)
79 62 !
80 63 ! Initialize CPU state registers
81 64 !
82 65 ! The boot cpu and other cpus are different. The boot cpu has gone
83 66 ! through boot, and its state might be affected as a result. The
84 67 ! other cpus' states come directly from the prom.
85 68 !
86 69 wrpr %g0, PSTATE_KERN, %pstate
87 70 wr %g0, %g0, %fprs ! clear fprs
88 71 CLEARTICKNPT ! allow user rdtick
89 72
90 73 !
91 74 ! Set up temporary stack
92 75 !
93 76 set tmpstk, %g1
94 77 sub %g1, SA(KFPUSIZE+GSR_SIZE), %g2
95 78 and %g2, 0x3F, %g3
96 79 sub %g2, %g3, %o2
97 80 sub %o2, SA(MINFRAME) + STACK_BIAS, %sp
98 81
99 82 mov %o0, %l1 ! save cpuid
100 83
101 84 call sfmmu_mp_startup
102 85 sub %g0, 1, THREAD_REG ! catch any curthread acceses
103 86
104 87 ! On OPL platforms, context page size TLB programming must be enabled in
105 88 ! ASI_MEMCNTL. To avoid Olympus-C and Jupiter sTLB errata (strands with
106 89 ! different TLB page size settings), this must be done here before any
107 90 ! reference to non-nucleus memory. An early hook is added to perform
108 91 ! cpu specific initialization.
109 92 !
110 93 sethi %hi(cpu_early_feature_init), %o0
111 94 or %o0, %lo(cpu_early_feature_init), %o0
112 95 brz %o0, 0f
113 96 nop
114 97 call %o0
115 98 nop
116 99
117 100 0:
118 101 ! SET_KCONTEXTREG(reg0, reg1, reg2, reg3, reg4, label1, label2, label3)
119 102 SET_KCONTEXTREG(%o0, %g1, %g2, %g3, %l3, l1, l2, l3)
120 103
121 104 ! We are now running on the kernel's trap table.
122 105 !
123 106 ! It is very important to have a thread pointer and a cpu struct
124 107 ! *before* calling into C routines .
125 108 ! Otherwise, overflow/underflow handlers, etc. can get very upset!
126 109 !
127 110 !
128 111 ! We don't want to simply increment
129 112 ! ncpus right now because it is in the cache, and
130 113 ! we don't have the cache on yet for this CPU.
131 114 !
132 115 set cpu, %l3
133 116 sll %l1, CPTRSHIFT, %l2 ! offset into CPU vector.
134 117 ldn [%l3 + %l2], %l3 ! pointer to CPU struct
135 118 ldn [%l3 + CPU_THREAD], THREAD_REG ! set thread pointer (%g7)
136 119
137 120 !
138 121 ! Set up any required cpu feature
139 122 !
140 123 sethi %hi(cpu_feature_init), %o0
141 124 or %o0, %lo(cpu_feature_init), %o0
142 125 brz %o0, 1f
143 126 nop
144 127 call %o0
145 128 nop
146 129
↓ open down ↓ |
68 lines elided |
↑ open up ↑ |
147 130 1:
148 131 !
149 132 ! Resume the thread allocated for the CPU.
150 133 !
151 134 ldn [THREAD_REG + T_PC], %i7
152 135 ldn [THREAD_REG + T_SP], %fp
153 136 ret ! "return" into the thread
154 137 restore ! WILL cause underflow
155 138 SET_SIZE(cpu_startup)
156 139
157 -#endif /* lint */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX