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