xref: /titanic_44/usr/src/uts/sun4v/cpu/mach_cpu_module.c (revision 628e3cbed6489fa1db545d8524a06cd6535af456)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
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 /*
23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #include <sys/cpu_module.h>
30 #include <vm/page.h>
31 #include <vm/seg_map.h>
32 
33 /*ARGSUSED*/
34 void
35 cpu_fiximp(struct cpu_node *cpunode)
36 {}
37 
38 /*ARGSUSED*/
39 void
40 cpu_map_exec_units(struct cpu *cp)
41 {}
42 
43 void
44 cpu_flush_ecache(void)
45 {}
46 
47 /*ARGSUSED*/
48 void
49 cpu_faulted_enter(struct cpu *cp)
50 {}
51 
52 /*ARGSUSED*/
53 void
54 cpu_faulted_exit(struct cpu *cp)
55 {}
56 
57 /*
58  * Ecache scrub operations
59  */
60 void
61 cpu_init_cache_scrub(void)
62 {}
63 
64 /* ARGSUSED */
65 void
66 prefetch_page_w(void *pp)
67 {
68 #define	ECACHE_SUBBLOCKS_PER_PAGE	2
69 #define	ECACHE_SUBBLOCK_SIZE_BYTES	64
70 #define	ECACHE_PAGE_BYTE_MAX	\
71 	(ECACHE_SUBBLOCKS_PER_PAGE*ECACHE_SUBBLOCK_SIZE_BYTES+1)
72 
73 	/*
74 	 * The following line is intended to cause an error
75 	 * whenever the sun4u page_t grows beyond 128
76 	 * bytes.
77 	 *
78 	 * If you get an error here, you'll need to change
79 	 * the 'prefetch_page_w' assembly language code
80 	 * (see also prefetch_page_w prologue comment)
81 	 */
82 	/*LINTED*/
83 	volatile int garbage[ECACHE_PAGE_BYTE_MAX - sizeof (page_t)];
84 }
85 
86 /* ARGSUSED */
87 void
88 prefetch_page_r(void *pp)
89 {
90 #define	ECACHE_SUBBLOCKS_PER_PAGE	2
91 #define	ECACHE_SUBBLOCK_SIZE_BYTES	64
92 #define	ECACHE_PAGE_BYTE_MAX	\
93 	(ECACHE_SUBBLOCKS_PER_PAGE*ECACHE_SUBBLOCK_SIZE_BYTES+1)
94 
95 	/*
96 	 * The following line is intended to cause an error
97 	 * whenever the sun4u page_t grows beyond 128
98 	 * bytes.
99 	 *
100 	 * If you get an error here, you'll need to change
101 	 * the 'prefetch_page_r' assembly language code
102 	 * (see also prefetch_page_w prologue comment)
103 	 */
104 	/*LINTED*/
105 	volatile int garbage[ECACHE_PAGE_BYTE_MAX - sizeof (page_t)];
106 }
107 
108 
109 #ifdef	SEGKPM_SUPPORT
110 #define	SMAP_SIZE	80
111 #else
112 #define	SMAP_SIZE	56
113 #endif
114 
115 /* ARGSUSED */
116 void
117 prefetch_smap_w(void *smp)
118 {
119 
120 	/*
121 	 * The following lines are intended to cause an error
122 	 * whenever the smap object size changes from the current
123 	 * size of 48 bytes.  If you get an error here, you'll
124 	 * need to update the code in the 'prefetch_smap_w' assembly
125 	 * language code.
126 	 */
127 	/*LINTED*/
128 	volatile int smap_size_changed [SMAP_SIZE - sizeof (struct smap) + 1];
129 	volatile int smap_size_changed2 [sizeof (struct smap) - SMAP_SIZE + 1];
130 }
131 
132 void
133 kdi_flush_caches(void)
134 {}
135 
136 /*ARGSUSED*/
137 int
138 kzero(void *addr, size_t count)
139 { return (0); }
140 
141 /*ARGSUSED*/
142 void
143 uzero(void *addr, size_t count)
144 {}
145 
146 /*ARGSUSED*/
147 void
148 bzero(void *addr, size_t count)
149 {}
150 
151 /*ARGSUSED*/
152 void
153 cpu_inv_tsb(caddr_t tsb_base, uint_t tsb_bytes)
154 {}
155 
156 /*
157  *  Atomic Function Stubs
158  */
159 
160 uint8_t
161 cas8(uint8_t *target, uint8_t value1, uint8_t value2)
162 { return (0); }
163 
164 /* ARGSUSED */
165 uint32_t
166 cas32(uint32_t *target, uint32_t value1, uint32_t value2)
167 { return (0); }
168 
169 /* ARGSUSED */
170 uint64_t
171 cas64(uint64_t *target, uint64_t value1, uint64_t value2)
172 { return (0); }
173 
174 /* ARGSUSED */
175 ulong_t
176 caslong(ulong_t *target, ulong_t value1, ulong_t value2)
177 { return (0); }
178 
179 /* ARGSUSED */
180 void *
181 casptr(void *ptr1, void *ptr2, void *ptr3)
182 { return (0); }
183 
184 /* ARGSUSED */
185 void
186 atomic_and_long(ulong_t *target, ulong_t value)
187 {}
188 
189 /* ARGSUSED */
190 void
191 atomic_or_long(ulong_t *target, ulong_t value)
192 {}
193 
194 /* ARGSUSED */
195 void
196 atomic_inc_8(volatile uint8_t *target)
197 {}
198 
199 /* ARGSUSED */
200 void
201 atomic_inc_uchar(volatile uchar_t *target)
202 {}
203 
204 /* ARGSUSED */
205 void
206 atomic_inc_16(volatile uint16_t *target)
207 {}
208 
209 /* ARGSUSED */
210 void
211 atomic_inc_ushort(volatile ushort_t *target)
212 {}
213 
214 /* ARGSUSED */
215 void
216 atomic_inc_32(volatile uint32_t *target)
217 {}
218 
219 /* ARGSUSED */
220 void
221 atomic_inc_uint(volatile uint_t *target)
222 {}
223 
224 /* ARGSUSED */
225 void
226 atomic_inc_ulong(volatile ulong_t *target)
227 {}
228 
229 /* ARGSUSED */
230 void
231 atomic_inc_64(volatile uint64_t *target)
232 {}
233 
234 /* ARGSUSED */
235 void
236 atomic_dec_8(volatile uint8_t *target)
237 {}
238 
239 /* ARGSUSED */
240 void
241 atomic_dec_uchar(volatile uchar_t *target)
242 {}
243 
244 /* ARGSUSED */
245 void
246 atomic_dec_16(volatile uint16_t *target)
247 {}
248 
249 /* ARGSUSED */
250 void
251 atomic_dec_ushort(volatile ushort_t *target)
252 {}
253 
254 /* ARGSUSED */
255 void
256 atomic_dec_32(volatile uint32_t *target)
257 {}
258 
259 /* ARGSUSED */
260 void
261 atomic_dec_uint(volatile uint_t *target)
262 {}
263 
264 /* ARGSUSED */
265 void
266 atomic_dec_ulong(volatile ulong_t *target)
267 {}
268 
269 /* ARGSUSED */
270 void
271 atomic_dec_64(volatile uint64_t *target)
272 {}
273 
274 /* ARGSUSED */
275 void
276 atomic_add_8(volatile uint8_t *target, int8_t value)
277 {}
278 
279 /* ARGSUSED */
280 void
281 atomic_add_char(volatile uchar_t *target, signed char value)
282 {}
283 
284 /* ARGSUSED */
285 void
286 atomic_add_16(volatile uint16_t *target, int16_t delta)
287 {}
288 
289 /* ARGSUSED */
290 void
291 atomic_add_ushort(volatile ushort_t *target, short value)
292 {}
293 
294 /* ARGSUSED */
295 void
296 atomic_add_32(volatile uint32_t *target, int32_t delta)
297 {}
298 
299 /* ARGSUSED */
300 void
301 atomic_add_ptr(volatile void *target, ssize_t value)
302 {}
303 
304 /* ARGSUSED */
305 void
306 atomic_add_long(volatile ulong_t *target, long delta)
307 {}
308 
309 /* ARGSUSED */
310 void
311 atomic_add_64(volatile uint64_t *target, int64_t delta)
312 {}
313 
314 /* ARGSUSED */
315 void
316 atomic_or_8(volatile uint8_t *target, uint8_t bits)
317 {}
318 
319 /* ARGSUSED */
320 void
321 atomic_or_uchar(volatile uchar_t *target, uchar_t bits)
322 {}
323 
324 /* ARGSUSED */
325 void
326 atomic_or_16(volatile uint16_t *target, uint16_t bits)
327 {}
328 
329 /* ARGSUSED */
330 void
331 atomic_or_ushort(volatile ushort_t *target, ushort_t bits)
332 {}
333 
334 /* ARGSUSED */
335 void
336 atomic_or_32(volatile uint32_t *target, uint32_t bits)
337 {}
338 
339 /* ARGSUSED */
340 void
341 atomic_or_uint(volatile uint_t *target, uint_t bits)
342 {}
343 
344 /* ARGSUSED */
345 void
346 atomic_or_ulong(volatile ulong_t *target, ulong_t bits)
347 {}
348 
349 /* ARGSUSED */
350 void
351 atomic_or_64(volatile uint64_t *target, uint64_t bits)
352 {}
353 
354 /* ARGSUSED */
355 void
356 atomic_and_8(volatile uint8_t *target, uint8_t bits)
357 {}
358 
359 /* ARGSUSED */
360 void
361 atomic_and_uchar(volatile uchar_t *target, uchar_t bits)
362 {}
363 
364 /* ARGSUSED */
365 void
366 atomic_and_16(volatile uint16_t *target, uint16_t bits)
367 {}
368 
369 /* ARGSUSED */
370 void
371 atomic_and_ushort(volatile ushort_t *target, ushort_t bits)
372 {}
373 
374 /* ARGSUSED */
375 void
376 atomic_and_32(volatile uint32_t *target, uint32_t bits)
377 {}
378 
379 /* ARGSUSED */
380 void
381 atomic_and_uint(volatile uint_t *target, uint_t bits)
382 {}
383 
384 /* ARGSUSED */
385 void
386 atomic_and_ulong(volatile ulong_t *target, ulong_t bits)
387 {}
388 
389 /* ARGSUSED */
390 void
391 atomic_and_64(volatile uint64_t *target, uint64_t bits)
392 {}
393 
394 /* ARGSUSED */
395 uint8_t
396 atomic_inc_8_nv(volatile uint8_t *target)
397 { return (0); }
398 
399 /* ARGSUSED */
400 uchar_t
401 atomic_inc_uchar_nv(volatile uchar_t *target)
402 { return (0); }
403 
404 /* ARGSUSED */
405 uint16_t
406 atomic_inc_16_nv(volatile uint16_t *target)
407 { return (0); }
408 
409 /* ARGSUSED */
410 ushort_t
411 atomic_inc_ushort_nv(volatile ushort_t *target)
412 { return (0); }
413 
414 /* ARGSUSED */
415 uint32_t
416 atomic_inc_32_nv(volatile uint32_t *target)
417 { return (0); }
418 
419 /* ARGSUSED */
420 uint_t
421 atomic_inc_uint_nv(volatile uint_t *target)
422 { return (0); }
423 
424 /* ARGSUSED */
425 ulong_t
426 atomic_inc_ulong_nv(volatile ulong_t *target)
427 { return (0); }
428 
429 /* ARGSUSED */
430 uint64_t
431 atomic_inc_64_nv(volatile uint64_t *target)
432 { return (0); }
433 
434 /* ARGSUSED */
435 uint8_t
436 atomic_dec_8_nv(volatile uint8_t *target)
437 { return (0); }
438 
439 /* ARGSUSED */
440 uchar_t
441 atomic_dec_uchar_nv(volatile uchar_t *target)
442 { return (0); }
443 
444 /* ARGSUSED */
445 uint16_t
446 atomic_dec_16_nv(volatile uint16_t *target)
447 { return (0); }
448 
449 /* ARGSUSED */
450 ushort_t
451 atomic_dec_ushort_nv(volatile ushort_t *target)
452 { return (0); }
453 
454 /* ARGSUSED */
455 uint32_t
456 atomic_dec_32_nv(volatile uint32_t *target)
457 { return (0); }
458 
459 /* ARGSUSED */
460 uint_t
461 atomic_dec_uint_nv(volatile uint_t *target)
462 { return (0); }
463 
464 /* ARGSUSED */
465 ulong_t
466 atomic_dec_ulong_nv(volatile ulong_t *target)
467 { return (0); }
468 
469 /* ARGSUSED */
470 uint64_t
471 atomic_dec_64_nv(volatile uint64_t *target)
472 { return (0); }
473 
474 /* ARGSUSED */
475 uint8_t
476 atomic_add_8_nv(volatile uint8_t *target, int8_t value)
477 { return (0); }
478 
479 /* ARGSUSED */
480 uchar_t
481 atomic_add_char_nv(volatile uchar_t *target, signed char value)
482 { return (0); }
483 
484 /* ARGSUSED */
485 uint16_t
486 atomic_add_16_nv(volatile uint16_t *target, int16_t delta)
487 { return (0); }
488 
489 /* ARGSUSED */
490 ushort_t
491 atomic_add_short_nv(volatile ushort_t *target, short value)
492 { return (0); }
493 
494 /* ARGSUSED */
495 uint32_t
496 atomic_add_32_nv(volatile uint32_t *target, int32_t delta)
497 { return (0); }
498 
499 /* ARGSUSED */
500 uint_t
501 atomic_add_int_nv(volatile uint_t *target, int delta)
502 { return (0); }
503 
504 /* ARGSUSED */
505 void *
506 atomic_add_ptr_nv(volatile void *target, ssize_t value)
507 { return (NULL); }
508 
509 /* ARGSUSED */
510 ulong_t
511 atomic_add_long_nv(volatile ulong_t *target, long delta)
512 { return (0); }
513 
514 /* ARGSUSED */
515 uint64_t
516 atomic_add_64_nv(volatile uint64_t *target, int64_t delta)
517 { return (0); }
518 
519 /* ARGSUSED */
520 uint8_t
521 atomic_or_8_nv(volatile uint8_t *target, uint8_t value)
522 { return (0); }
523 
524 /* ARGSUSED */
525 uchar_t
526 atomic_or_uchar_nv(volatile uchar_t *target, uchar_t value)
527 { return (0); }
528 
529 /* ARGSUSED */
530 uint16_t
531 atomic_or_16_nv(volatile uint16_t *target, uint16_t value)
532 { return (0); }
533 
534 /* ARGSUSED */
535 ushort_t
536 atomic_or_ushort_nv(volatile ushort_t *target, ushort_t value)
537 { return (0); }
538 
539 /* ARGSUSED */
540 uint32_t
541 atomic_or_32_nv(volatile uint32_t *target, uint32_t value)
542 { return (0); }
543 
544 /* ARGSUSED */
545 uint_t
546 atomic_or_uint_nv(volatile uint_t *target, uint_t value)
547 { return (0); }
548 
549 /* ARGSUSED */
550 ulong_t
551 atomic_or_ulong_nv(volatile ulong_t *target, ulong_t value)
552 { return (0); }
553 
554 /* ARGSUSED */
555 uint64_t
556 atomic_or_64_nv(volatile uint64_t *target, uint64_t value)
557 { return (0); }
558 
559 /* ARGSUSED */
560 uint8_t
561 atomic_and_8_nv(volatile uint8_t *target, uint8_t value)
562 { return (0); }
563 
564 /* ARGSUSED */
565 uchar_t
566 atomic_and_uchar_nv(volatile uchar_t *target, uchar_t value)
567 { return (0); }
568 
569 /* ARGSUSED */
570 uint16_t
571 atomic_and_16_nv(volatile uint16_t *target, uint16_t value)
572 { return (0); }
573 
574 /* ARGSUSED */
575 ushort_t
576 atomic_and_ushort_nv(volatile ushort_t *target, ushort_t value)
577 { return (0); }
578 
579 /* ARGSUSED */
580 uint32_t
581 atomic_and_32_nv(volatile uint32_t *target, uint32_t value)
582 { return (0); }
583 
584 /* ARGSUSED */
585 uint_t
586 atomic_and_uint_nv(volatile uint_t *target, uint_t value)
587 { return (0); }
588 
589 /* ARGSUSED */
590 ulong_t
591 atomic_and_ulong_nv(volatile ulong_t *target, ulong_t value)
592 { return (0); }
593 
594 /* ARGSUSED */
595 uint64_t
596 atomic_and_64_nv(volatile uint64_t *target, uint64_t value)
597 { return (0); }
598 
599 /* ARGSUSED */
600 uint8_t
601 atomic_cas_8(volatile uint8_t *target, uint8_t cmp, uint8_t new)
602 { return (0); }
603 
604 /* ARGSUSED */
605 uchar_t
606 atomic_cas_uchar(volatile uchar_t *target, uchar_t cmp, uchar_t new)
607 { return (0); }
608 
609 /* ARGSUSED */
610 uint16_t
611 atomic_cas_16(volatile uint16_t *target, uint16_t cmp, uint16_t new)
612 { return (0); }
613 
614 /* ARGSUSED */
615 ushort_t
616 atomic_cas_ushort(volatile ushort_t *target, ushort_t cmp, ushort_t new)
617 { return (0); }
618 
619 /* ARGSUSED */
620 uint32_t
621 atomic_cas_32(volatile uint32_t *target, uint32_t cmp, uint32_t new)
622 { return (0); }
623 
624 /* ARGSUSED */
625 uint_t
626 atomic_cas_uint(volatile uint_t *target, uint_t cmp, uint_t new)
627 { return (0); }
628 
629 /* ARGSUSED */
630 ulong_t
631 atomic_cas_ulong(volatile ulong_t *target, ulong_t cmp, ulong_t new)
632 { return (0); }
633 
634 /* ARGSUSED */
635 uint64_t
636 atomic_cas_uint64(volatile uint64_t *target, ulong_t cmp, uint64_t new)
637 { return (0); }
638 
639 /* ARGSUSED */
640 void *
641 atomic_cas_ptr(volatile void *target, void *cmp, void *new)
642 { return (NULL); }
643 
644 /* ARGSUSED */
645 uint8_t
646 atomic_swap_8(volatile uint8_t *target, uint8_t new)
647 { return (0); }
648 
649 /* ARGSUSED */
650 uchar_t
651 atomic_swap_char(volatile uchar_t *target, uchar_t new)
652 { return (0); }
653 
654 /* ARGSUSED */
655 uint16_t
656 atomic_swap_16(volatile uint16_t *target, uint16_t new)
657 { return (0); }
658 
659 /* ARGSUSED */
660 ushort_t
661 atomic_swap_ushort(volatile ushort_t *target, ushort_t new)
662 { return (0); }
663 
664 /* ARGSUSED */
665 uint32_t
666 atomic_swap_32(volatile uint32_t *target, uint32_t new)
667 { return (0); }
668 
669 /* ARGSUSED */
670 uint_t
671 atomic_swap_uint(volatile uint_t *target, uint_t new)
672 { return (0); }
673 
674 /* ARGSUSED */
675 uint64_t
676 atomic_swap_64(volatile uint64_t *target, uint64_t new)
677 { return (0); }
678 
679 /* ARGSUSED */
680 void *
681 atomic_swap_ptr(volatile void *target, void *new)
682 { return (NULL); }
683 
684 /* ARGSUSED */
685 ulong_t
686 atomic_swap_ulong(volatile ulong_t *target, ulong_t new)
687 { return (0); }
688 
689 /* ARGSUSED */
690 int
691 atomic_set_long_excl(volatile ulong_t *target, uint_t value)
692 { return (0); }
693 
694 /* ARGSUSED */
695 int
696 atomic_clear_long_excl(volatile ulong_t *target, uint_t value)
697 { return (0); }
698 
699 void
700 fp_zero(void)
701 {}
702