Print this page
de-linting of .s files
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/sun4u/serengeti/ml/sbdp_asm.s
+++ new/usr/src/uts/sun4u/serengeti/ml/sbdp_asm.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
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 -#pragma ident "%Z%%M% %I% %E% SMI"
28 -
29 27 /*
30 28 * This file is through cpp before being used as
31 29 * an inline. It contains support routines used
32 30 * only by DR for the copy-rename sequence.
33 31 */
34 32
35 -#if defined(lint)
36 -#include <sys/types.h>
37 -#include <sys/sbd_ioctl.h>
38 -#include <sys/sbdp_priv.h>
39 -#else
40 33 #include "assym.h"
41 -#endif /* lint */
42 34
43 35 #include <sys/asm_linkage.h>
44 36 #include <sys/param.h>
45 37 #include <sys/privregs.h>
46 38 #include <sys/machasi.h>
47 39 #include <sys/mmu.h>
48 40 #include <sys/machthread.h>
49 41 #include <sys/pte.h>
50 42 #include <sys/stack.h>
51 43 #include <sys/vis.h>
52 44 #include <sys/param.h>
53 45 #include <sys/errno.h>
54 46 #include <sys/vtrace.h>
55 47 #include <sys/clock.h>
56 48 #include <sys/asi.h>
57 49 #include <sys/fsr.h>
58 50 #include <sys/cheetahregs.h>
59 51 #include <sys/cheetahasm.h>
60 52
61 -#ifndef lint
62 -
63 53 /*
64 54 * Invalidating the E$ tags is only needed on Cheetah following
65 55 * the manual displacement flush. The internal flush ASI used by
66 56 * Cheetahplus, Jaguar, and Panther will invalidate the cache lines.
67 57 *
68 58 * arg1 = ecache_size
69 59 * arg2 = ecache_linesize
70 60 */
71 61 #define ECACHE_FLUSHTAGS(arg1, arg2, tmp1) \
72 62 GET_CPU_IMPL(tmp1) ;\
73 63 srlx arg1, 1, arg1 ;\
74 64 cmp tmp1, CHEETAH_IMPL ;\
75 65 bne 1f ;\
76 66 nop ;\
77 67 sub arg1, arg2, tmp1 ;\
78 68 0: ;\
79 69 stxa %g0, [tmp1]ASI_EC_DIAG ;\
80 70 membar #Sync ;\
81 71 cmp %g0, tmp1 ;\
82 72 bne,pt %icc, 0b ;\
83 73 sub tmp1, arg2, tmp1 ;\
84 74 1:
85 75
86 76
87 77 #define SWITCH_STACK(estk) \
88 78 flushw ;\
89 79 sub estk, SA(KFPUSIZE+GSR_SIZE), estk ;\
90 80 andn estk, 0x3f, estk ;\
91 81 sub estk, SA(MINFRAME) + STACK_BIAS, %sp ;\
92 82 mov estk, %fp
93 83
94 84 /*
95 85 * Returns icache size and linesize in reg1 and reg2, respectively.
96 86 * Panther has a larger icache compared to Cheetahplus and Jaguar.
97 87 */
98 88 #define GET_ICACHE_PARAMS(reg1, reg2) \
99 89 GET_CPU_IMPL(reg1) ;\
100 90 cmp reg1, PANTHER_IMPL ;\
101 91 bne %xcc, 1f ;\
↓ open down ↓ |
29 lines elided |
↑ open up ↑ |
102 92 nop ;\
103 93 set PN_ICACHE_SIZE, reg1 ;\
104 94 set PN_ICACHE_LSIZE, reg2 ;\
105 95 ba 2f ;\
106 96 nop ;\
107 97 1: ;\
108 98 set CH_ICACHE_SIZE, reg1 ;\
109 99 set CH_ICACHE_LSIZE, reg2 ;\
110 100 2:
111 101
112 -#endif /* !lint */
113 -
114 -#if defined(lint)
115 -
116 -/*ARGSUSED*/
117 -void
118 -sbdp_shutdown_asm(sbdp_shutdown_t *shutshown)
119 -{}
120 -
121 -#else /* lint */
122 -
123 102 ENTRY_NP(sbdp_shutdown_asm)
124 103 ! %o0 = address of sbdp_shutdown_t structure passed in
125 104 !
126 105 ! struct sbdp_shutdown {
127 106 ! uint64_t estack; -> %o0
128 107 ! uint64_t flushaddr; -> %o1
129 108 ! uint32_t size; -> %o2
130 109 ! uint32_t linesize; -> %g1
131 110 ! uint64_t physaddr; -> %o0
132 111 ! } sbdp_shutdown_t;
133 112 !
134 113 membar #LoadStore
135 114 mov %o0, %o4
136 115 ldx [%o4], %o0
137 116 ldx [%o4 + 8], %o1
138 117 ld [%o4 + 16], %o2
139 118 ld [%o4 + 20], %g1
140 119
141 120 !
142 121 ! Switch stack pointer to bbsram
143 122 !
144 123 SWITCH_STACK(%o0)
145 124
146 125 ldx [%o4 + 24], %o0 !save physaddr in %o0
147 126 !
148 127 ! Get some globals
149 128 !
150 129 ! ecache_linesize already in %g1
151 130
152 131 sethi %hi(dcache_linesize), %g2
153 132 ld [%g2 + %lo(dcache_linesize)], %g2
154 133
155 134 sethi %hi(dcache_size), %g3
156 135 ld [%g3 + %lo(dcache_size)], %g3
157 136
158 137 !
159 138 ! Save the E$ size
160 139 !
161 140 mov %o2, %o5
162 141 !
163 142 ! Flush E$
164 143 !
165 144 rdpr %pstate, %o3
166 145 andn %o3, PSTATE_IE | PSTATE_AM, %o4
167 146 wrpr %g0, %o4, %pstate
168 147
169 148 ! Panther needs to flush L2 before L3 cache.
170 149 PN_L2_FLUSHALL(%o4, %g4, %g5)
171 150
172 151 ECACHE_FLUSHALL(%o2, %g1, %o1, %o4)
173 152
174 153 wrpr %g0, %o3, %pstate
175 154
176 155 !
177 156 ! Invalidate the E$ tags (Cheetah only).
178 157 !
179 158 ECACHE_FLUSHTAGS(%o5, %g1, %o3)
180 159
181 160 !
182 161 ! %o2 & %o3 now available
183 162 !
184 163
185 164 membar #Sync
186 165
187 166 !
188 167 ! Flush D$
189 168 !
190 169 CH_DCACHE_FLUSHALL(%g3, %g2, %o3)
191 170
192 171 !
193 172 ! Flush I$
194 173 !
195 174 GET_ICACHE_PARAMS(%g5, %g4)
196 175 CH_ICACHE_FLUSHALL(%g5, %g4, %o3, %o4)
197 176
198 177 membar #Sync
199 178
200 179 !
201 180 ! Flush all unlocked dtlb's & itlb's
202 181 !
203 182 sethi %hi(FLUSH_ADDR), %g3
204 183 set DEMAP_ALL_TYPE, %g1
205 184 stxa %g0, [%g1]ASI_DTLB_DEMAP
206 185 stxa %g0, [%g1]ASI_ITLB_DEMAP
207 186 flush %g3
↓ open down ↓ |
75 lines elided |
↑ open up ↑ |
208 187
209 188 sir 0
210 189 SET_SIZE(sbdp_shutdown_asm)
211 190
212 191 .global sbdp_shutdown_asm_end
213 192
214 193 .skip 2048
215 194
216 195 sbdp_shutdown_asm_end:
217 196
218 -#endif /* lint */
219 197
220 -
221 -#if defined(lint)
222 -
223 -#else /* lint */
224 198 #include "assym.h"
225 -#endif /* lint */
226 199
227 200 #define TT_HSM 0x99
228 201
229 -#if defined(lint)
230 -/* ARGSUSED */
231 -void
232 -sgdr_mem_blkcopy(caddr_t src, caddr_t dst, u_int linecount, u_int linesize)
233 -{}
234 -
235 -void
236 -stdmcdecode(uint64_t physaddr, uint64_t value)
237 -{
238 - physaddr = physaddr;
239 - value = value;
240 -}
241 -
242 -#else /* !lint */
243 202 !
244 203 ! Move a single cache line of data. Survive UE and CE on the read
245 204 !
246 205 ! i0 = src va
247 206 ! i1 = dst va
248 207 ! i2 = line count
249 208 ! i3 = line size
250 209 ! i4 = cache of fpu state
251 210 !
252 211 ENTRY(sgdr_mem_blkcopy)
253 212
254 213 ! TODO: can we safely SAVE here
255 214 save %sp, -SA(MINFRAME + 2*64), %sp
256 215
257 216 ! XXX do we need to save the state of the fpu?
258 217 rd %fprs, %i4
259 218 btst (FPRS_DU|FPRS_DL|FPRS_FEF), %i4
260 219
261 220 ! always enable FPU
262 221 wr %g0, FPRS_FEF, %fprs
263 222
264 223 bz,a 1f
265 224 nop
266 225
267 226 ! save in-use fpregs on stack
268 227 membar #Sync
269 228 add %fp, STACK_BIAS - 81, %o2
270 229 and %o2, -64, %o2
271 230 stda %d0, [%o2]ASI_BLK_P
272 231 membar #Sync
273 232
274 233 1:
275 234 brz,pn %i2, 2f ! while (linecount) {
276 235 nop
277 236 ldda [%i0]ASI_BLK_P, %d0 ! *dst = *src;
278 237 membar #Sync
279 238 stda %d0, [%i1]ASI_BLK_COMMIT_P
280 239 membar #Sync
281 240
282 241 add %i0, %i3, %i0 ! dst++, src++;
283 242 add %i1, %i3, %i1
284 243
285 244 ba 1b ! linecount-- }
286 245 dec %i2
287 246
288 247 2:
289 248 membar #Sync
290 249
291 250 ! restore fp to the way we got it
292 251 btst (FPRS_DU|FPRS_DL|FPRS_FEF), %i4
293 252 bz,a 3f
294 253 nop
295 254
296 255 ! restore fpregs from stack
297 256 add %fp, STACK_BIAS - 81, %o2
298 257 and %o2, -64, %o2
299 258 ldda [%o2]ASI_BLK_P, %d0
300 259 membar #Sync
301 260
302 261 3:
303 262 wr %g0, %i4, %fprs ! fpu back to the way it was
304 263 ret
305 264 restore
306 265 SET_SIZE(sgdr_mem_blkcopy)
307 266
308 267 ! Store long word value at mc regs
309 268 !
310 269 ! void stdmcdecode(uint64_t physaddr, uint64_t value)
311 270 !
312 271 ENTRY(stdmcdecode)
313 272 /*
314 273 * disable interrupts, clear Address Mask to access 64 bit physaddr
↓ open down ↓ |
62 lines elided |
↑ open up ↑ |
315 274 */
316 275 rdpr %pstate, %o4
317 276 andn %o4, PSTATE_IE | PSTATE_AM, %o5
318 277 wrpr %o5, 0, %pstate ! clear IE, AM bits
319 278 stxa %o1, [%o0]ASI_MC_DECODE
320 279 membar #Sync
321 280 retl
322 281 wrpr %g0, %o4, %pstate ! restore earlier pstate register value
323 282 SET_SIZE(stdmcdecode)
324 283
325 -#endif /* lint */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX