xref: /illumos-gate/usr/src/uts/sun4v/cpu/mach_cpu_module.c (revision 6ed9368a130d7c9a82e574da808d34034da33748)
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 /* ARGSUSED */
159 void
160 atomic_inc_8(volatile uint8_t *target)
161 {}
162 
163 /* ARGSUSED */
164 void
165 atomic_inc_uchar(volatile uchar_t *target)
166 {}
167 
168 /* ARGSUSED */
169 void
170 atomic_inc_16(volatile uint16_t *target)
171 {}
172 
173 /* ARGSUSED */
174 void
175 atomic_inc_ushort(volatile ushort_t *target)
176 {}
177 
178 /* ARGSUSED */
179 void
180 atomic_inc_32(volatile uint32_t *target)
181 {}
182 
183 /* ARGSUSED */
184 void
185 atomic_inc_uint(volatile uint_t *target)
186 {}
187 
188 /* ARGSUSED */
189 void
190 atomic_inc_ulong(volatile ulong_t *target)
191 {}
192 
193 /* ARGSUSED */
194 void
195 atomic_inc_64(volatile uint64_t *target)
196 {}
197 
198 /* ARGSUSED */
199 void
200 atomic_dec_8(volatile uint8_t *target)
201 {}
202 
203 /* ARGSUSED */
204 void
205 atomic_dec_uchar(volatile uchar_t *target)
206 {}
207 
208 /* ARGSUSED */
209 void
210 atomic_dec_16(volatile uint16_t *target)
211 {}
212 
213 /* ARGSUSED */
214 void
215 atomic_dec_ushort(volatile ushort_t *target)
216 {}
217 
218 /* ARGSUSED */
219 void
220 atomic_dec_32(volatile uint32_t *target)
221 {}
222 
223 /* ARGSUSED */
224 void
225 atomic_dec_uint(volatile uint_t *target)
226 {}
227 
228 /* ARGSUSED */
229 void
230 atomic_dec_ulong(volatile ulong_t *target)
231 {}
232 
233 /* ARGSUSED */
234 void
235 atomic_dec_64(volatile uint64_t *target)
236 {}
237 
238 /* ARGSUSED */
239 void
240 atomic_add_8(volatile uint8_t *target, int8_t value)
241 {}
242 
243 /* ARGSUSED */
244 void
245 atomic_add_char(volatile uchar_t *target, signed char value)
246 {}
247 
248 /* ARGSUSED */
249 void
250 atomic_add_16(volatile uint16_t *target, int16_t delta)
251 {}
252 
253 /* ARGSUSED */
254 void
255 atomic_add_ushort(volatile ushort_t *target, short value)
256 {}
257 
258 /* ARGSUSED */
259 void
260 atomic_add_32(volatile uint32_t *target, int32_t delta)
261 {}
262 
263 /* ARGSUSED */
264 void
265 atomic_add_ptr(volatile void *target, ssize_t value)
266 {}
267 
268 /* ARGSUSED */
269 void
270 atomic_add_long(volatile ulong_t *target, long delta)
271 {}
272 
273 /* ARGSUSED */
274 void
275 atomic_add_64(volatile uint64_t *target, int64_t delta)
276 {}
277 
278 /* ARGSUSED */
279 void
280 atomic_or_8(volatile uint8_t *target, uint8_t bits)
281 {}
282 
283 /* ARGSUSED */
284 void
285 atomic_or_uchar(volatile uchar_t *target, uchar_t bits)
286 {}
287 
288 /* ARGSUSED */
289 void
290 atomic_or_16(volatile uint16_t *target, uint16_t bits)
291 {}
292 
293 /* ARGSUSED */
294 void
295 atomic_or_ushort(volatile ushort_t *target, ushort_t bits)
296 {}
297 
298 /* ARGSUSED */
299 void
300 atomic_or_32(volatile uint32_t *target, uint32_t bits)
301 {}
302 
303 /* ARGSUSED */
304 void
305 atomic_or_uint(volatile uint_t *target, uint_t bits)
306 {}
307 
308 /* ARGSUSED */
309 void
310 atomic_or_ulong(volatile ulong_t *target, ulong_t bits)
311 {}
312 
313 /* ARGSUSED */
314 void
315 atomic_or_64(volatile uint64_t *target, uint64_t bits)
316 {}
317 
318 /* ARGSUSED */
319 void
320 atomic_and_8(volatile uint8_t *target, uint8_t bits)
321 {}
322 
323 /* ARGSUSED */
324 void
325 atomic_and_uchar(volatile uchar_t *target, uchar_t bits)
326 {}
327 
328 /* ARGSUSED */
329 void
330 atomic_and_16(volatile uint16_t *target, uint16_t bits)
331 {}
332 
333 /* ARGSUSED */
334 void
335 atomic_and_ushort(volatile ushort_t *target, ushort_t bits)
336 {}
337 
338 /* ARGSUSED */
339 void
340 atomic_and_32(volatile uint32_t *target, uint32_t bits)
341 {}
342 
343 /* ARGSUSED */
344 void
345 atomic_and_uint(volatile uint_t *target, uint_t bits)
346 {}
347 
348 /* ARGSUSED */
349 void
350 atomic_and_ulong(volatile ulong_t *target, ulong_t bits)
351 {}
352 
353 /* ARGSUSED */
354 void
355 atomic_and_64(volatile uint64_t *target, uint64_t bits)
356 {}
357 
358 /* ARGSUSED */
359 uint8_t
360 atomic_inc_8_nv(volatile uint8_t *target)
361 { return (0); }
362 
363 /* ARGSUSED */
364 uchar_t
365 atomic_inc_uchar_nv(volatile uchar_t *target)
366 { return (0); }
367 
368 /* ARGSUSED */
369 uint16_t
370 atomic_inc_16_nv(volatile uint16_t *target)
371 { return (0); }
372 
373 /* ARGSUSED */
374 ushort_t
375 atomic_inc_ushort_nv(volatile ushort_t *target)
376 { return (0); }
377 
378 /* ARGSUSED */
379 uint32_t
380 atomic_inc_32_nv(volatile uint32_t *target)
381 { return (0); }
382 
383 /* ARGSUSED */
384 uint_t
385 atomic_inc_uint_nv(volatile uint_t *target)
386 { return (0); }
387 
388 /* ARGSUSED */
389 ulong_t
390 atomic_inc_ulong_nv(volatile ulong_t *target)
391 { return (0); }
392 
393 /* ARGSUSED */
394 uint64_t
395 atomic_inc_64_nv(volatile uint64_t *target)
396 { return (0); }
397 
398 /* ARGSUSED */
399 uint8_t
400 atomic_dec_8_nv(volatile uint8_t *target)
401 { return (0); }
402 
403 /* ARGSUSED */
404 uchar_t
405 atomic_dec_uchar_nv(volatile uchar_t *target)
406 { return (0); }
407 
408 /* ARGSUSED */
409 uint16_t
410 atomic_dec_16_nv(volatile uint16_t *target)
411 { return (0); }
412 
413 /* ARGSUSED */
414 ushort_t
415 atomic_dec_ushort_nv(volatile ushort_t *target)
416 { return (0); }
417 
418 /* ARGSUSED */
419 uint32_t
420 atomic_dec_32_nv(volatile uint32_t *target)
421 { return (0); }
422 
423 /* ARGSUSED */
424 uint_t
425 atomic_dec_uint_nv(volatile uint_t *target)
426 { return (0); }
427 
428 /* ARGSUSED */
429 ulong_t
430 atomic_dec_ulong_nv(volatile ulong_t *target)
431 { return (0); }
432 
433 /* ARGSUSED */
434 uint64_t
435 atomic_dec_64_nv(volatile uint64_t *target)
436 { return (0); }
437 
438 /* ARGSUSED */
439 uint8_t
440 atomic_add_8_nv(volatile uint8_t *target, int8_t value)
441 { return (0); }
442 
443 /* ARGSUSED */
444 uchar_t
445 atomic_add_char_nv(volatile uchar_t *target, signed char value)
446 { return (0); }
447 
448 /* ARGSUSED */
449 uint16_t
450 atomic_add_16_nv(volatile uint16_t *target, int16_t delta)
451 { return (0); }
452 
453 /* ARGSUSED */
454 ushort_t
455 atomic_add_short_nv(volatile ushort_t *target, short value)
456 { return (0); }
457 
458 /* ARGSUSED */
459 uint32_t
460 atomic_add_32_nv(volatile uint32_t *target, int32_t delta)
461 { return (0); }
462 
463 /* ARGSUSED */
464 uint_t
465 atomic_add_int_nv(volatile uint_t *target, int delta)
466 { return (0); }
467 
468 /* ARGSUSED */
469 void *
470 atomic_add_ptr_nv(volatile void *target, ssize_t value)
471 { return (NULL); }
472 
473 /* ARGSUSED */
474 ulong_t
475 atomic_add_long_nv(volatile ulong_t *target, long delta)
476 { return (0); }
477 
478 /* ARGSUSED */
479 uint64_t
480 atomic_add_64_nv(volatile uint64_t *target, int64_t delta)
481 { return (0); }
482 
483 /* ARGSUSED */
484 uint8_t
485 atomic_or_8_nv(volatile uint8_t *target, uint8_t value)
486 { return (0); }
487 
488 /* ARGSUSED */
489 uchar_t
490 atomic_or_uchar_nv(volatile uchar_t *target, uchar_t value)
491 { return (0); }
492 
493 /* ARGSUSED */
494 uint16_t
495 atomic_or_16_nv(volatile uint16_t *target, uint16_t value)
496 { return (0); }
497 
498 /* ARGSUSED */
499 ushort_t
500 atomic_or_ushort_nv(volatile ushort_t *target, ushort_t value)
501 { return (0); }
502 
503 /* ARGSUSED */
504 uint32_t
505 atomic_or_32_nv(volatile uint32_t *target, uint32_t value)
506 { return (0); }
507 
508 /* ARGSUSED */
509 uint_t
510 atomic_or_uint_nv(volatile uint_t *target, uint_t value)
511 { return (0); }
512 
513 /* ARGSUSED */
514 ulong_t
515 atomic_or_ulong_nv(volatile ulong_t *target, ulong_t value)
516 { return (0); }
517 
518 /* ARGSUSED */
519 uint64_t
520 atomic_or_64_nv(volatile uint64_t *target, uint64_t value)
521 { return (0); }
522 
523 /* ARGSUSED */
524 uint8_t
525 atomic_and_8_nv(volatile uint8_t *target, uint8_t value)
526 { return (0); }
527 
528 /* ARGSUSED */
529 uchar_t
530 atomic_and_uchar_nv(volatile uchar_t *target, uchar_t value)
531 { return (0); }
532 
533 /* ARGSUSED */
534 uint16_t
535 atomic_and_16_nv(volatile uint16_t *target, uint16_t value)
536 { return (0); }
537 
538 /* ARGSUSED */
539 ushort_t
540 atomic_and_ushort_nv(volatile ushort_t *target, ushort_t value)
541 { return (0); }
542 
543 /* ARGSUSED */
544 uint32_t
545 atomic_and_32_nv(volatile uint32_t *target, uint32_t value)
546 { return (0); }
547 
548 /* ARGSUSED */
549 uint_t
550 atomic_and_uint_nv(volatile uint_t *target, uint_t value)
551 { return (0); }
552 
553 /* ARGSUSED */
554 ulong_t
555 atomic_and_ulong_nv(volatile ulong_t *target, ulong_t value)
556 { return (0); }
557 
558 /* ARGSUSED */
559 uint64_t
560 atomic_and_64_nv(volatile uint64_t *target, uint64_t value)
561 { return (0); }
562 
563 /* ARGSUSED */
564 uint8_t
565 atomic_cas_8(volatile uint8_t *target, uint8_t cmp, uint8_t new)
566 { return (0); }
567 
568 /* ARGSUSED */
569 uchar_t
570 atomic_cas_uchar(volatile uchar_t *target, uchar_t cmp, uchar_t new)
571 { return (0); }
572 
573 /* ARGSUSED */
574 uint16_t
575 atomic_cas_16(volatile uint16_t *target, uint16_t cmp, uint16_t new)
576 { return (0); }
577 
578 /* ARGSUSED */
579 ushort_t
580 atomic_cas_ushort(volatile ushort_t *target, ushort_t cmp, ushort_t new)
581 { return (0); }
582 
583 /* ARGSUSED */
584 uint32_t
585 atomic_cas_32(volatile uint32_t *target, uint32_t cmp, uint32_t new)
586 { return (0); }
587 
588 /* ARGSUSED */
589 uint_t
590 atomic_cas_uint(volatile uint_t *target, uint_t cmp, uint_t new)
591 { return (0); }
592 
593 /* ARGSUSED */
594 ulong_t
595 atomic_cas_ulong(volatile ulong_t *target, ulong_t cmp, ulong_t new)
596 { return (0); }
597 
598 /* ARGSUSED */
599 uint64_t
600 atomic_cas_uint64(volatile uint64_t *target, ulong_t cmp, uint64_t new)
601 { return (0); }
602 
603 /* ARGSUSED */
604 void *
605 atomic_cas_ptr(volatile void *target, void *cmp, void *new)
606 { return (NULL); }
607 
608 /* ARGSUSED */
609 uint8_t
610 atomic_swap_8(volatile uint8_t *target, uint8_t new)
611 { return (0); }
612 
613 /* ARGSUSED */
614 uchar_t
615 atomic_swap_char(volatile uchar_t *target, uchar_t new)
616 { return (0); }
617 
618 /* ARGSUSED */
619 uint16_t
620 atomic_swap_16(volatile uint16_t *target, uint16_t new)
621 { return (0); }
622 
623 /* ARGSUSED */
624 ushort_t
625 atomic_swap_ushort(volatile ushort_t *target, ushort_t new)
626 { return (0); }
627 
628 /* ARGSUSED */
629 uint32_t
630 atomic_swap_32(volatile uint32_t *target, uint32_t new)
631 { return (0); }
632 
633 /* ARGSUSED */
634 uint_t
635 atomic_swap_uint(volatile uint_t *target, uint_t new)
636 { return (0); }
637 
638 /* ARGSUSED */
639 uint64_t
640 atomic_swap_64(volatile uint64_t *target, uint64_t new)
641 { return (0); }
642 
643 /* ARGSUSED */
644 void *
645 atomic_swap_ptr(volatile void *target, void *new)
646 { return (NULL); }
647 
648 /* ARGSUSED */
649 ulong_t
650 atomic_swap_ulong(volatile ulong_t *target, ulong_t new)
651 { return (0); }
652 
653 /* ARGSUSED */
654 int
655 atomic_set_long_excl(volatile ulong_t *target, uint_t value)
656 { return (0); }
657 
658 /* ARGSUSED */
659 int
660 atomic_clear_long_excl(volatile ulong_t *target, uint_t value)
661 { return (0); }
662 
663 void
664 fp_zero(void)
665 {}
666 
667 uint64_t
668 gettick_npt(void)
669 { return (0); }
670 
671 uint64_t
672 getstick_npt(void)
673 { return (0); }
674