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