Print this page
de-linting of .s files
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/sun4v/ml/mach_xc.s
+++ new/usr/src/uts/sun4v/ml/mach_xc.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 -#include <sys/cpuvar.h>
29 -#else /*lint */
30 26 #include "assym.h"
31 -#endif /* lint */
32 27
33 28 #include <sys/asm_linkage.h>
34 29 #include <sys/privregs.h>
35 30 #include <sys/x_call.h>
36 31 #include <sys/xc_impl.h>
37 32 #include <sys/machthread.h>
38 33 #include <sys/hypervisor_api.h>
39 34
40 35 #ifdef TRAPTRACE
41 36 #include <sys/traptrace.h>
42 37 #endif /* TRAPTRACE */
43 38
44 39
45 -#if defined(lint)
46 -
47 -/* ARGSUSED */
48 -void
49 -self_xcall(struct cpu *cpu, uint64_t arg1, uint64_t arg2, xcfunc_t *func)
50 -{}
51 -
52 -#else
53 -
54 40 /*
55 41 * Entered by the software trap (TT=ST_SELFXCALL, TL>0) thru send_self_xcall().
56 42 * Emulate the mondo handler - vec_interrupt().
57 43 *
58 44 * Global registers are the Alternate Globals.
59 45 * Arguments:
60 46 * %o0 - CPU
61 47 * ILP32 kernel:
62 48 * %o5 - function to call
63 49 * %o1, %o2, %o3, %o4 - arguments
64 50 * LP64 kernel:
65 51 * %o3 - function to call
66 52 * %o1, %o2 - arguments
67 53 */
68 54 ENTRY_NP(self_xcall)
69 55 !
70 56 ! TL>0 handlers are expected to do "retry"
71 57 ! prepare their return PC and nPC now
72 58 !
73 59 rdpr %tnpc, %g1
74 60 wrpr %g1, %tpc ! PC <- TNPC[TL]
75 61 add %g1, 4, %g1
76 62 wrpr %g1, %tnpc ! nPC <- TNPC[TL] + 4
77 63
78 64 #ifdef TRAPTRACE
79 65 TRACE_PTR(%g4, %g6)
80 66 GET_TRACE_TICK(%g6, %g3)
81 67 stxa %g6, [%g4 + TRAP_ENT_TICK]%asi
82 68 rdpr %tl, %g6
83 69 stha %g6, [%g4 + TRAP_ENT_TL]%asi
84 70 rdpr %tt, %g6
85 71 stha %g6, [%g4 + TRAP_ENT_TT]%asi
86 72 stna %o3, [%g4 + TRAP_ENT_TR]%asi ! pc of the TL>0 handler
87 73 rdpr %tpc, %g6
88 74 stna %g6, [%g4 + TRAP_ENT_TPC]%asi
89 75 rdpr %tstate, %g6
90 76 stxa %g6, [%g4 + TRAP_ENT_TSTATE]%asi
91 77 stna %sp, [%g4 + TRAP_ENT_SP]%asi
92 78 stna %o1, [%g4 + TRAP_ENT_F1]%asi ! arg 1
93 79 stna %o2, [%g4 + TRAP_ENT_F2]%asi ! arg 2
94 80 stna %g0, [%g4 + TRAP_ENT_F3]%asi
95 81 stna %g0, [%g4 + TRAP_ENT_F4]%asi
96 82 TRACE_NEXT(%g4, %g6, %g3)
↓ open down ↓ |
33 lines elided |
↑ open up ↑ |
97 83 #endif /* TRAPTRACE */
98 84 !
99 85 ! Load the arguments for the fast trap handler.
100 86 !
101 87 mov %o1, %g1
102 88 jmp %o3 ! call the fast trap handler
103 89 mov %o2, %g2
104 90 /* Not Reached */
105 91 SET_SIZE(self_xcall)
106 92
107 -#endif /* lint */
108 -
109 93 #ifdef TRAPTRACE
110 -#if defined(lint)
111 -
112 -/* ARGSUSED */
113 -void
114 -xc_trace(u_int traptype, cpuset_t *cpu_set, xcfunc_t *func,
115 - uint64_t arg1, uint64_t arg2)
116 -{}
117 -
118 -#else /* lint */
119 94 ENTRY(xc_trace)
120 95 rdpr %pstate, %g1
121 96 andn %g1, PSTATE_IE | PSTATE_AM, %g2
122 97 wrpr %g0, %g2, %pstate /* disable interrupts */
123 98 TRACE_PTR(%g3, %g4)
124 99 GET_TRACE_TICK(%g6, %g4)
125 100 stxa %g6, [%g3 + TRAP_ENT_TICK]%asi
126 101 stha %g0, [%g3 + TRAP_ENT_TL]%asi
127 102 set TT_XCALL, %g2
128 103 or %o0, %g2, %g4
129 104 stha %g4, [%g3 + TRAP_ENT_TT]%asi
130 105 stna %o7, [%g3 + TRAP_ENT_TPC]%asi
131 106 ldn [%o1], %g2
132 107 stna %g2, [%g3 + TRAP_ENT_SP]%asi /* sp = cpuset */
133 108 stna %o2, [%g3 + TRAP_ENT_TR]%asi /* tr = func */
134 109 stna %o3, [%g3 + TRAP_ENT_F1]%asi /* f1 = arg1 */
135 110 stna %o4, [%g3 + TRAP_ENT_F2]%asi /* f2 = arg2 */
136 111 stna %g0, [%g3 + TRAP_ENT_F3]%asi /* f3 = 0 */
137 112 stna %i7, [%g3 + TRAP_ENT_F4]%asi /* f4 = xcall caller */
138 113 stxa %g1, [%g3 + TRAP_ENT_TSTATE]%asi /* tstate = pstate */
139 114 TRACE_NEXT(%g2, %g3, %g4)
140 115 /*
141 116 * In the case of a cpuset of greater size than a long we
142 117 * grab extra trace buffers just to store the cpuset.
143 118 * Seems like a waste but popular opinion opted for this
144 119 * rather than increase the size of the buffer.
145 120 */
146 121 #if CPUSET_SIZE > CLONGSIZE
147 122 add %o1, CPUSET_SIZE, %g5 /* end of cpuset */
148 123 clr %o2
149 124 1:
150 125 TRACE_PTR(%g3, %g4)
151 126 stha %g0, [%g3 + TRAP_ENT_TL]%asi
152 127 set TT_XCALL_CONT, %g2
153 128 or %g2, %o2, %g2 /* continuation # */
154 129 stha %g2, [%g3 + TRAP_ENT_TT]%asi
155 130 stxa %g6, [%g3 + TRAP_ENT_TICK]%asi /* same tick */
156 131 stna %g0, [%g3 + TRAP_ENT_TPC]%asi /* clr unused fields */
157 132 stna %g0, [%g3 + TRAP_ENT_SP]%asi
158 133 stna %g0, [%g3 + TRAP_ENT_TR]%asi
159 134 stxa %g0, [%g3 + TRAP_ENT_TSTATE]%asi
160 135 stna %g0, [%g3 + TRAP_ENT_F2]%asi
161 136 stna %g0, [%g3 + TRAP_ENT_F3]%asi
162 137 stna %g0, [%g3 + TRAP_ENT_F4]%asi
163 138 ldn [%o1], %g2
164 139 stna %g2, [%g3 + TRAP_ENT_F1]%asi
165 140 add %o1, CLONGSIZE, %o1
166 141 cmp %o1, %g5
167 142 bge 2f
168 143 ldn [%o1], %g2
169 144 stna %g2, [%g3 + TRAP_ENT_F2]%asi
170 145 add %o1, CLONGSIZE, %o1
171 146 cmp %o1, %g5
172 147 bge 2f
173 148 ldn [%o1], %g2
174 149 stna %g2, [%g3 + TRAP_ENT_F3]%asi
175 150 add %o1, CLONGSIZE, %o1
176 151 cmp %o1, %g5
177 152 bge 2f
178 153 ldn [%o1], %g2
179 154 stna %g2, [%g3 + TRAP_ENT_F4]%asi
180 155 add %o1, CLONGSIZE, %o1
↓ open down ↓ |
52 lines elided |
↑ open up ↑ |
181 156 2:
182 157 TRACE_NEXT(%g2, %g3, %g4)
183 158 cmp %o1, %g5
184 159 bl 1b
185 160 inc %o2
186 161 #endif /* CPUSET_SIZE */
187 162 retl
188 163 wrpr %g0, %g1, %pstate /* enable interrupts */
189 164 SET_SIZE(xc_trace)
190 165
191 -#endif /* lint */
192 166 #endif /* TRAPTRACE */
193 167
194 -#if defined(lint)
195 -
196 -/*ARGSUSED*/
197 -void
198 -init_mondo(xcfunc_t *func, uint64_t arg1, uint64_t arg2)
199 -{}
200 -
201 -/*ARGSUSED*/
202 -int
203 -shipit(int n, uint64_t cpuid)
204 -{ return(0); }
205 -
206 -#else /* lint */
207 168 /*
208 169 * Setup interrupt dispatch data registers
209 170 * Entry:
210 171 * %o0 - function or inumber to call
211 172 * %o1, %o2 - arguments (2 uint64_t's)
212 173 */
213 174 ENTRY(init_mondo)
214 175 ALTENTRY(init_mondo_nocheck)
215 176 CPU_ADDR(%g1, %g4) ! load CPU struct addr
216 177 add %g1, CPU_MCPU, %g1
217 178 ldx [%g1 + MCPU_MONDO_DATA], %g1
218 179 stx %o0, [%g1]
219 180 stx %o1, [%g1+8]
220 181 stx %o2, [%g1+0x10]
221 182 stx %g0, [%g1+0x18]
222 183 stx %g0, [%g1+0x20]
223 184 stx %g0, [%g1+0x28]
224 185 stx %g0, [%g1+0x30]
225 186 stx %g0, [%g1+0x38]
226 187 retl
227 188 membar #Sync ! allowed to be in the delay slot
228 189 SET_SIZE(init_mondo)
229 190
230 191 /*
231 192 * Ship mondo to cpuid
232 193 */
233 194 ENTRY_NP(shipit)
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
234 195 /* For now use dummy interface: cpu# func arg1 arg2 */
235 196 CPU_ADDR(%g1, %g4)
236 197 add %g1, CPU_MCPU, %g1
237 198 ldx [%g1 + MCPU_MONDO_DATA_RA], %o2
238 199 mov HV_INTR_SEND, %o5
239 200 ta FAST_TRAP
240 201 retl
241 202 membar #Sync
242 203 SET_SIZE(shipit)
243 204
244 -#endif /* lint */
245 -
246 -#if defined(lint)
247 -
248 -/*ARGSUSED*/
249 -uint64_t
250 -get_cpuaddr(uint64_t reg, uint64_t scr)
251 -{ return (0);}
252 -
253 -#else /* lint */
254 205 /*
255 206 * Get cpu structure
256 207 * Entry:
257 208 * %o0 - register for CPU_ADDR macro
258 209 * %o1 - scratch for CPU_ADDR macro
259 210 */
260 211 ENTRY(get_cpuaddr)
261 212 CPU_ADDR(%o0, %o1) ! %o0 == CPU struct addr
262 213 retl
263 214 nop
264 215 SET_SIZE(get_cpuaddr)
265 216
266 -#endif /* lint */
267 -
268 -#if defined(lint)
269 -/* ARGSUSED */
270 -void
271 -xt_sync_tl1(uint64_t *cpu_sync_addr)
272 -{}
273 -
274 -#else /* lint */
275 217 /*
276 218 * This is to ensure that previously called xtrap handlers have executed on
277 219 * sun4v. We zero out the byte corresponding to its cpuid in the
278 220 * array passed to us from xt_sync(), so the sender knows the previous
279 221 * mondo has been executed.
280 222 * Register:
281 223 * %g1 - Addr of the cpu_sync array.
282 224 */
283 225 ENTRY_NP(xt_sync_tl1)
284 226 CPU_INDEX(%g3, %g4) /* %g3 = cpu id */
285 227 stb %g0, [%g1 + %g3]
286 228 retry
287 229 SET_SIZE(xt_sync_tl1)
288 230
289 -#endif /* lint */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX