1
2
3
4
5
6
7 #include <asm/head.h>
8 #include <asm/cprefix.h>
9 #include <asm/asi.h>
10 #include <asm/page.h>
11
12
13
14
15
16
17
18
19
20
21
22 .align 4
23 .globl C_LABEL(sun4c_ctxflush), C_LABEL(sun4c_segflush)
24 .globl C_LABEL(sun4c_pgflush)
25 C_LABEL(sun4c_ctxflush): .word C_LABEL(sun4c_ctxflush_sw64KB16B)
26 C_LABEL(sun4c_segflush): .word C_LABEL(sun4c_segflush_sw64KB16B)
27 C_LABEL(sun4c_pgflush): .word C_LABEL(sun4c_pgflush_sw64KB16B)
28
29 .text
30
31
32
33
34
35 .align 4
36 .globl C_LABEL(sun4c_ctxflush_hw64KB16B)
37
38
39
40
41 C_LABEL(sun4c_ctxflush_hw64KB16B):
42 sethi %hi(PAGE_SIZE), %l6
43
44 or %g0, %g0, %l7
45 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
46 add %l7, %l6, %l7
47 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
48 add %l7, %l6, %l7
49 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
50 add %l7, %l6, %l7
51 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
52 add %l7, %l6, %l7
53 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
54 add %l7, %l6, %l7
55 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
56 add %l7, %l6, %l7
57 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
58 add %l7, %l6, %l7
59 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
60 add %l7, %l6, %l7
61 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
62 add %l7, %l6, %l7
63 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
64 add %l7, %l6, %l7
65 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
66 add %l7, %l6, %l7
67 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
68 add %l7, %l6, %l7
69 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
70 add %l7, %l6, %l7
71 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
72 add %l7, %l6, %l7
73 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
74 add %l7, %l6, %l7
75
76
77 jmpl %l4 + 0x8, %g0
78 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
79
80
81 .globl C_LABEL(sun4c_ctxflush_sw64KB16B)
82
83
84
85
86 C_LABEL(sun4c_ctxflush_sw64KB16B):
87
88
89
90 #define SWFLUSHCTX16_2LINES \
91 sta %g0, [%l7] ASI_FLUSHCTX; \
92 add %l7, 0x10, %l7; \
93 sta %g0, [%l7] ASI_FLUSHCTX; \
94 add %l7, 0x10, %l7; \
95
96 #define SWFLUSHCTX16_4LINES \
97 SWFLUSHCTX16_2LINES \
98 SWFLUSHCTX16_2LINES \
99
100 #define SWFLUSHCTX16_8LINES \
101 SWFLUSHCTX16_4LINES \
102 SWFLUSHCTX16_4LINES \
103
104 #define SWFLUSHCTX16_16LINES \
105 SWFLUSHCTX16_8LINES \
106 SWFLUSHCTX16_8LINES \
107
108 #define SWFLUSHCTX16_32LINES \
109 SWFLUSHCTX16_16LINES \
110 SWFLUSHCTX16_16LINES \
111
112 #define SWFLUSHCTX16_64LINES \
113 SWFLUSHCTX16_32LINES \
114 SWFLUSHCTX16_32LINES \
115
116 #define SWFLUSHCTX16_128LINES \
117 SWFLUSHCTX16_64LINES \
118 SWFLUSHCTX16_64LINES \
119
120 #define SWFLUSHCTX16_256LINES \
121 SWFLUSHCTX16_128LINES \
122 SWFLUSHCTX16_128LINES \
123
124
125 or %g0, %g0, %l7
126 SWFLUSHCTX16_256LINES
127 SWFLUSHCTX16_256LINES
128 SWFLUSHCTX16_256LINES
129 SWFLUSHCTX16_256LINES
130 SWFLUSHCTX16_256LINES
131 SWFLUSHCTX16_256LINES
132 SWFLUSHCTX16_256LINES
133 SWFLUSHCTX16_256LINES
134 SWFLUSHCTX16_256LINES
135 SWFLUSHCTX16_256LINES
136 SWFLUSHCTX16_256LINES
137 SWFLUSHCTX16_256LINES
138 SWFLUSHCTX16_256LINES
139 SWFLUSHCTX16_256LINES
140 SWFLUSHCTX16_256LINES
141 SWFLUSHCTX16_256LINES
142
143
144 jmpl %l4 + 0x8, %g0
145 nop
146
147 .globl C_LABEL(sun4c_ctxflush_hw64KB32B)
148
149
150
151 C_LABEL(sun4c_ctxflush_hw64KB32B):
152 sethi %hi(PAGE_SIZE), %l6
153
154 or %g0, %g0, %l7
155 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
156 add %l7, %l6, %l7
157 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
158 add %l7, %l6, %l7
159 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
160 add %l7, %l6, %l7
161 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
162 add %l7, %l6, %l7
163 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
164 add %l7, %l6, %l7
165 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
166 add %l7, %l6, %l7
167 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
168 add %l7, %l6, %l7
169 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
170 add %l7, %l6, %l7
171 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
172 add %l7, %l6, %l7
173 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
174 add %l7, %l6, %l7
175 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
176 add %l7, %l6, %l7
177 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
178 add %l7, %l6, %l7
179 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
180 add %l7, %l6, %l7
181 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
182 add %l7, %l6, %l7
183 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
184 add %l7, %l6, %l7
185
186
187 jmpl %l4 + 0x8, %g0
188 sta %g0, [%l7] ASI_HWFLUSHCONTEXT
189
190 .globl C_LABEL(sun4c_ctxflush_sw64KB32B)
191
192
193
194
195 C_LABEL(sun4c_ctxflush_sw64KB32B):
196
197
198
199 #define SWFLUSHCTX32_2LINES \
200 sta %g0, [%l7] ASI_FLUSHCTX; \
201 add %l7, 0x20, %l7; \
202 sta %g0, [%l7] ASI_FLUSHCTX; \
203 add %l7, 0x20, %l7; \
204
205 #define SWFLUSHCTX32_4LINES \
206 SWFLUSHCTX32_2LINES \
207 SWFLUSHCTX32_2LINES \
208
209 #define SWFLUSHCTX32_8LINES \
210 SWFLUSHCTX32_4LINES \
211 SWFLUSHCTX32_4LINES \
212
213 #define SWFLUSHCTX32_16LINES \
214 SWFLUSHCTX32_8LINES \
215 SWFLUSHCTX32_8LINES \
216
217 #define SWFLUSHCTX32_32LINES \
218 SWFLUSHCTX32_16LINES \
219 SWFLUSHCTX32_16LINES \
220
221 #define SWFLUSHCTX32_64LINES \
222 SWFLUSHCTX32_32LINES \
223 SWFLUSHCTX32_32LINES \
224
225 #define SWFLUSHCTX32_128LINES \
226 SWFLUSHCTX32_64LINES \
227 SWFLUSHCTX32_64LINES \
228
229
230 or %g0, %g0, %l7
231 SWFLUSHCTX32_128LINES
232 SWFLUSHCTX32_128LINES
233 SWFLUSHCTX32_128LINES
234 SWFLUSHCTX32_128LINES
235 SWFLUSHCTX32_128LINES
236 SWFLUSHCTX32_128LINES
237 SWFLUSHCTX32_128LINES
238 SWFLUSHCTX32_128LINES
239 SWFLUSHCTX32_128LINES
240 SWFLUSHCTX32_128LINES
241 SWFLUSHCTX32_128LINES
242 SWFLUSHCTX32_128LINES
243 SWFLUSHCTX32_128LINES
244 SWFLUSHCTX32_128LINES
245 SWFLUSHCTX16_256LINES
246 SWFLUSHCTX16_256LINES
247
248 jmpl %l4 + 0x8, %g0
249 nop
250
251 .align 4
252 .globl C_LABEL(sun4c_segflush_hw64KB16B)
253
254
255
256
257 C_LABEL(sun4c_segflush_hw64KB16B):
258 sethi %hi(PAGE_SIZE), %l6
259 sethi %hi(0xfffc0000), %l7
260 and %l2, %l7, %l7
261
262
263 sta %g0, [%l7] ASI_HWFLUSHSEG
264 add %l7, %l6, %l7
265 sta %g0, [%l7] ASI_HWFLUSHSEG
266 add %l7, %l6, %l7
267 sta %g0, [%l7] ASI_HWFLUSHSEG
268 add %l7, %l6, %l7
269 sta %g0, [%l7] ASI_HWFLUSHSEG
270 add %l7, %l6, %l7
271 sta %g0, [%l7] ASI_HWFLUSHSEG
272 add %l7, %l6, %l7
273 sta %g0, [%l7] ASI_HWFLUSHSEG
274 add %l7, %l6, %l7
275 sta %g0, [%l7] ASI_HWFLUSHSEG
276 add %l7, %l6, %l7
277 sta %g0, [%l7] ASI_HWFLUSHSEG
278 add %l7, %l6, %l7
279 sta %g0, [%l7] ASI_HWFLUSHSEG
280 add %l7, %l6, %l7
281 sta %g0, [%l7] ASI_HWFLUSHSEG
282 add %l7, %l6, %l7
283 sta %g0, [%l7] ASI_HWFLUSHSEG
284 add %l7, %l6, %l7
285 sta %g0, [%l7] ASI_HWFLUSHSEG
286 add %l7, %l6, %l7
287 sta %g0, [%l7] ASI_HWFLUSHSEG
288 add %l7, %l6, %l7
289 sta %g0, [%l7] ASI_HWFLUSHSEG
290 add %l7, %l6, %l7
291 sta %g0, [%l7] ASI_HWFLUSHSEG
292 add %l7, %l6, %l7
293
294
295 jmpl %l4 + 0x8, %g0
296 sta %g0, [%l7] ASI_HWFLUSHSEG
297
298 .globl C_LABEL(sun4c_segflush_sw64KB16B)
299
300
301
302
303 C_LABEL(sun4c_segflush_sw64KB16B):
304
305
306
307 #define SWFLUSHSEG16_2LINES \
308 sta %g0, [%l7] ASI_FLUSHSEG; \
309 add %l7, 0x10, %l7; \
310 sta %g0, [%l7] ASI_FLUSHSEG; \
311 add %l7, 0x10, %l7; \
312
313 #define SWFLUSHSEG16_4LINES \
314 SWFLUSHSEG16_2LINES \
315 SWFLUSHSEG16_2LINES \
316
317 #define SWFLUSHSEG16_8LINES \
318 SWFLUSHSEG16_4LINES \
319 SWFLUSHSEG16_4LINES \
320
321 #define SWFLUSHSEG16_16LINES \
322 SWFLUSHSEG16_8LINES \
323 SWFLUSHSEG16_8LINES \
324
325 #define SWFLUSHSEG16_32LINES \
326 SWFLUSHSEG16_16LINES \
327 SWFLUSHSEG16_16LINES \
328
329 #define SWFLUSHSEG16_64LINES \
330 SWFLUSHSEG16_32LINES \
331 SWFLUSHSEG16_32LINES \
332
333 #define SWFLUSHSEG16_128LINES \
334 SWFLUSHSEG16_64LINES \
335 SWFLUSHSEG16_64LINES \
336
337 #define SWFLUSHSEG16_256LINES \
338 SWFLUSHSEG16_128LINES \
339 SWFLUSHSEG16_128LINES \
340
341 sethi %hi(0xfffc0000), %l7
342 and %l2, %l7, %l7
343 SWFLUSHSEG16_256LINES
344 SWFLUSHSEG16_256LINES
345 SWFLUSHSEG16_256LINES
346 SWFLUSHSEG16_256LINES
347 SWFLUSHSEG16_256LINES
348 SWFLUSHSEG16_256LINES
349 SWFLUSHSEG16_256LINES
350 SWFLUSHSEG16_256LINES
351 SWFLUSHSEG16_256LINES
352 SWFLUSHSEG16_256LINES
353 SWFLUSHSEG16_256LINES
354 SWFLUSHSEG16_256LINES
355 SWFLUSHSEG16_256LINES
356 SWFLUSHSEG16_256LINES
357 SWFLUSHSEG16_256LINES
358 SWFLUSHSEG16_256LINES
359
360
361 jmpl %l4 + 0x8, %g0
362 nop
363
364 .globl C_LABEL(sun4c_segflush_hw64KB32B)
365
366
367
368
369 C_LABEL(sun4c_segflush_hw64KB32B):
370 sethi %hi(PAGE_SIZE), %l6
371 sethi %hi(0xfffc0000), %l7
372 and %l2, %l7, %l7
373
374
375 sta %g0, [%l7] ASI_HWFLUSHSEG
376 add %l7, %l6, %l7
377 sta %g0, [%l7] ASI_HWFLUSHSEG
378 add %l7, %l6, %l7
379 sta %g0, [%l7] ASI_HWFLUSHSEG
380 add %l7, %l6, %l7
381 sta %g0, [%l7] ASI_HWFLUSHSEG
382 add %l7, %l6, %l7
383 sta %g0, [%l7] ASI_HWFLUSHSEG
384 add %l7, %l6, %l7
385 sta %g0, [%l7] ASI_HWFLUSHSEG
386 add %l7, %l6, %l7
387 sta %g0, [%l7] ASI_HWFLUSHSEG
388 add %l7, %l6, %l7
389 sta %g0, [%l7] ASI_HWFLUSHSEG
390 add %l7, %l6, %l7
391 sta %g0, [%l7] ASI_HWFLUSHSEG
392 add %l7, %l6, %l7
393 sta %g0, [%l7] ASI_HWFLUSHSEG
394 add %l7, %l6, %l7
395 sta %g0, [%l7] ASI_HWFLUSHSEG
396 add %l7, %l6, %l7
397 sta %g0, [%l7] ASI_HWFLUSHSEG
398 add %l7, %l6, %l7
399 sta %g0, [%l7] ASI_HWFLUSHSEG
400 add %l7, %l6, %l7
401 sta %g0, [%l7] ASI_HWFLUSHSEG
402 add %l7, %l6, %l7
403 sta %g0, [%l7] ASI_HWFLUSHSEG
404 add %l7, %l6, %l7
405
406
407 jmpl %l4 + 0x8, %g0
408 sta %g0, [%l7] ASI_HWFLUSHSEG
409
410 .globl C_LABEL(sun4c_segflush_sw64KB32B)
411
412
413
414
415 C_LABEL(sun4c_segflush_sw64KB32B):
416
417
418
419 #define SWFLUSHSEG32_2LINES \
420 sta %g0, [%l7] ASI_FLUSHSEG; \
421 add %l7, 0x20, %l7; \
422 sta %g0, [%l7] ASI_FLUSHSEG; \
423 add %l7, 0x20, %l7; \
424
425 #define SWFLUSHSEG32_4LINES \
426 SWFLUSHSEG32_2LINES \
427 SWFLUSHSEG32_2LINES \
428
429 #define SWFLUSHSEG32_8LINES \
430 SWFLUSHSEG32_4LINES \
431 SWFLUSHSEG32_4LINES \
432
433 #define SWFLUSHSEG32_16LINES \
434 SWFLUSHSEG32_8LINES \
435 SWFLUSHSEG32_8LINES \
436
437 #define SWFLUSHSEG32_32LINES \
438 SWFLUSHSEG32_16LINES \
439 SWFLUSHSEG32_16LINES \
440
441 #define SWFLUSHSEG32_64LINES \
442 SWFLUSHSEG32_32LINES \
443 SWFLUSHSEG32_32LINES \
444
445 #define SWFLUSHSEG32_128LINES \
446 SWFLUSHSEG32_64LINES \
447 SWFLUSHSEG32_64LINES \
448
449
450 sethi %hi(0xfffc0000), %l7
451 and %l2, %l7, %l7
452 SWFLUSHSEG32_128LINES
453 SWFLUSHSEG32_128LINES
454 SWFLUSHSEG32_128LINES
455 SWFLUSHSEG32_128LINES
456 SWFLUSHSEG32_128LINES
457 SWFLUSHSEG32_128LINES
458 SWFLUSHSEG32_128LINES
459 SWFLUSHSEG32_128LINES
460 SWFLUSHSEG32_128LINES
461 SWFLUSHSEG32_128LINES
462 SWFLUSHSEG32_128LINES
463 SWFLUSHSEG32_128LINES
464 SWFLUSHSEG32_128LINES
465 SWFLUSHSEG32_128LINES
466 SWFLUSHSEG32_128LINES
467 SWFLUSHSEG32_128LINES
468
469 jmpl %l4 + 0x8, %g0
470 nop
471
472 .align 4
473 .globl C_LABEL(sun4c_pgflush_hw64KB16B)
474 .globl C_LABEL(sun4c_pgflush_hw64KB32B)
475
476
477
478
479 C_LABEL(sun4c_pgflush_hw64KB16B):
480 C_LABEL(sun4c_pgflush_hw64KB32B):
481
482 jmpl %l4 + 0x8, %g0
483 sta %g0, [%l2] ASI_HWFLUSHPAGE
484
485 .globl C_LABEL(sun4c_pgflush_sw64KB16B)
486
487
488
489 C_LABEL(sun4c_pgflush_sw64KB16B):
490
491 #define SWFLUSHPG16_2LINES \
492 sta %g0, [%l7] ASI_FLUSHPG; \
493 add %l7, 0x10, %l7; \
494 sta %g0, [%l7] ASI_FLUSHPG; \
495 add %l7, 0x10, %l7; \
496
497 #define SWFLUSHPG16_4LINES \
498 SWFLUSHPG16_2LINES \
499 SWFLUSHPG16_2LINES \
500
501 #define SWFLUSHPG16_8LINES \
502 SWFLUSHPG16_4LINES \
503 SWFLUSHPG16_4LINES \
504
505 #define SWFLUSHPG16_16LINES \
506 SWFLUSHPG16_8LINES \
507 SWFLUSHPG16_8LINES \
508
509 #define SWFLUSHPG16_32LINES \
510 SWFLUSHPG16_16LINES \
511 SWFLUSHPG16_16LINES \
512
513 #define SWFLUSHPG16_64LINES \
514 SWFLUSHPG16_32LINES \
515 SWFLUSHPG16_32LINES \
516
517 #define SWFLUSHPG16_128LINES \
518 SWFLUSHPG16_64LINES \
519 SWFLUSHPG16_64LINES \
520
521 #define SWFLUSHPG16_256LINES \
522 SWFLUSHPG16_128LINES \
523 SWFLUSHPG16_128LINES \
524
525 or %l2, %g0, %l7
526 SWFLUSHPG16_256LINES
527
528
529 jmpl %l4 + 0x8, %g0
530 nop
531
532 .globl C_LABEL(sun4c_pgflush_sw64KB32B)
533
534
535
536 C_LABEL(sun4c_pgflush_sw64KB32B):
537
538 #define SWFLUSHPG32_2LINES \
539 sta %g0, [%l7] ASI_FLUSHPG; \
540 add %l7, 0x20, %l7; \
541 sta %g0, [%l7] ASI_FLUSHPG; \
542 add %l7, 0x20, %l7; \
543
544 #define SWFLUSHPG32_4LINES \
545 SWFLUSHPG32_2LINES \
546 SWFLUSHPG32_2LINES \
547
548 #define SWFLUSHPG32_8LINES \
549 SWFLUSHPG32_4LINES \
550 SWFLUSHPG32_4LINES \
551
552 #define SWFLUSHPG32_16LINES \
553 SWFLUSHPG32_8LINES \
554 SWFLUSHPG32_8LINES \
555
556 #define SWFLUSHPG32_32LINES \
557 SWFLUSHPG32_16LINES \
558 SWFLUSHPG32_16LINES \
559
560 #define SWFLUSHPG32_64LINES \
561 SWFLUSHPG32_32LINES \
562 SWFLUSHPG32_32LINES \
563
564 #define SWFLUSHPG32_128LINES \
565 SWFLUSHPG32_64LINES \
566 SWFLUSHPG32_64LINES \
567
568 or %l2, %g0, %l7
569 SWFLUSHPG32_128LINES
570
571
572 jmpl %l4 + 0x8, %g0
573 nop
574
575