xref: /illumos-gate/usr/src/uts/sun4v/cpu/mach_cpu_module.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 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 void
34 cpu_fiximp(struct cpu_node *cpunode)
35 {}
36 
37 void
38 cpu_flush_ecache(void)
39 {}
40 
41 /*ARGSUSED*/
42 void
43 cpu_faulted_enter(struct cpu *cp)
44 {}
45 
46 /*ARGSUSED*/
47 void
48 cpu_faulted_exit(struct cpu *cp)
49 {}
50 
51 /*
52  * Ecache scrub operations
53  */
54 void
55 cpu_init_cache_scrub(void)
56 {}
57 
58 /* ARGSUSED */
59 void
60 prefetch_page_w(void *pp)
61 {
62 #define	ECACHE_SUBBLOCKS_PER_PAGE	2
63 #define	ECACHE_SUBBLOCK_SIZE_BYTES	64
64 #define	ECACHE_PAGE_BYTE_MAX	\
65 	(ECACHE_SUBBLOCKS_PER_PAGE*ECACHE_SUBBLOCK_SIZE_BYTES+1)
66 
67 	/*
68 	 * The following line is intended to cause an error
69 	 * whenever the sun4u page_t grows beyond 128
70 	 * bytes.
71 	 *
72 	 * If you get an error here, you'll need to change
73 	 * the 'prefetch_page_w' assembly language code
74 	 * (see also prefetch_page_w prologue comment)
75 	 */
76 	/*LINTED*/
77 	volatile int garbage[ECACHE_PAGE_BYTE_MAX - sizeof (page_t)];
78 }
79 
80 /* ARGSUSED */
81 void
82 prefetch_page_r(void *pp)
83 {
84 #define	ECACHE_SUBBLOCKS_PER_PAGE	2
85 #define	ECACHE_SUBBLOCK_SIZE_BYTES	64
86 #define	ECACHE_PAGE_BYTE_MAX	\
87 	(ECACHE_SUBBLOCKS_PER_PAGE*ECACHE_SUBBLOCK_SIZE_BYTES+1)
88 
89 	/*
90 	 * The following line is intended to cause an error
91 	 * whenever the sun4u page_t grows beyond 128
92 	 * bytes.
93 	 *
94 	 * If you get an error here, you'll need to change
95 	 * the 'prefetch_page_r' assembly language code
96 	 * (see also prefetch_page_w prologue comment)
97 	 */
98 	/*LINTED*/
99 	volatile int garbage[ECACHE_PAGE_BYTE_MAX - sizeof (page_t)];
100 }
101 
102 
103 #ifdef	SEGKPM_SUPPORT
104 #define	SMAP_SIZE	80
105 #else
106 #define	SMAP_SIZE	56
107 #endif
108 
109 /* ARGSUSED */
110 void
111 prefetch_smap_w(void *smp)
112 {
113 
114 	/*
115 	 * The following lines are intended to cause an error
116 	 * whenever the smap object size changes from the current
117 	 * size of 48 bytes.  If you get an error here, you'll
118 	 * need to update the code in the 'prefetch_smap_w' assembly
119 	 * language code.
120 	 */
121 	/*LINTED*/
122 	volatile int smap_size_changed [SMAP_SIZE - sizeof (struct smap) + 1];
123 	volatile int smap_size_changed2 [sizeof (struct smap) - SMAP_SIZE + 1];
124 }
125 
126 void
127 kdi_flush_caches(void)
128 {}
129 
130 /*ARGSUSED*/
131 int
132 kzero(void *addr, size_t count)
133 { return (0); }
134 
135 /*ARGSUSED*/
136 void
137 uzero(void *addr, size_t count)
138 {}
139 
140 /*ARGSUSED*/
141 void
142 bzero(void *addr, size_t count)
143 {}
144 
145 /*ARGSUSED*/
146 void
147 cpu_inv_tsb(caddr_t tsb_base, uint_t tsb_bytes)
148 {}
149