xref: /titanic_51/usr/src/uts/sun4u/cpu/mach_cpu_module.c (revision d485aa23b5e424dd136afdf657683389f93f72d6)
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(pnode_t dnode)
35 {}
36 
37 void
38 ce_err(void)
39 {}
40 
41 void
42 ce_err_tl1(void)
43 {}
44 
45 void
46 async_err(void)
47 {}
48 
49 void
50 cpu_flush_ecache(void)
51 {}
52 
53 void
54 cpu_disable_errors(void)
55 {}
56 
57 /* It could be removed later if prom enables error handling */
58 void
59 cpu_enable_errors(void)
60 {}
61 
62 /*ARGSUSED*/
63 void
64 cpu_faulted_enter(struct cpu *cp)
65 {}
66 
67 /*ARGSUSED*/
68 void
69 cpu_faulted_exit(struct cpu *cp)
70 {}
71 
72 /*ARGSUSED*/
73 void
74 cpu_ce_count_unum(struct async_flt *ecc, int len, char *unum)
75 {}
76 
77 /*ARGSUSED*/
78 void
79 cpu_ce_scrub_mem_err(struct async_flt *ecc, boolean_t triedcpulogout)
80 {}
81 
82 /*ARGSUSED*/
83 void
84 cpu_ce_log_err(struct async_flt *ecc, errorq_elem_t *eqep)
85 {}
86 
87 /*ARGSUSED*/
88 void
89 cpu_ue_log_err(struct async_flt *ecc)
90 {}
91 
92 /*ARGSUSED*/
93 int
94 ce_scrub_xdiag_recirc(struct async_flt *aflt, errorq_t *eqp,
95     errorq_elem_t *eqep, size_t afltoffset)
96 { return (0); }
97 
98 /*ARGSUSED*/
99 char *
100 flt_to_error_type(struct async_flt *aflt)
101 { return (NULL); }
102 
103 int
104 cpu_aflt_size(void)
105 { return (0); }
106 
107 void
108 cpu_async_panic_callb(void)
109 {}
110 
111 /*ARGSUSED*/
112 void
113 cpu_check_allcpus(struct async_flt *aflt)
114 {}
115 
116 /*ARGSUSED*/
117 int
118 cpu_get_mem_unum(int synd_stat, ushort_t synd, uint64_t afsr, uint64_t afar,
119     int cpuid, int flt_in_memory, ushort_t flt_status, char *buf,
120     int buflen, int *lenp)
121 { return (ENOTSUP); }
122 
123 /*ARGSUSED*/
124 int
125 cpu_get_mem_unum_aflt(int synd_stat, struct async_flt *aflt,
126     char *buf, int buflen, int *lenp)
127 { return (ENOTSUP); }
128 
129 /*ARGSUSED*/
130 int
131 cpu_get_cpu_unum(int cpuid, char *buf, int buflen, int *lenp)
132 { return (ENOTSUP); }
133 
134 /*ARGSUSED*/
135 int
136 cpu_get_mem_name(uint64_t synd, uint64_t *afsr, uint64_t afar,
137     char *buf, int buflen, int *lenp)
138 { return (ENOTSUP); }
139 
140 /*ARGSUSED*/
141 size_t
142 cpu_get_name_bufsize()
143 { return (0); }
144 
145 /*ARGSUSED*/
146 int
147 cpu_get_mem_info(uint64_t synd, uint64_t afar,
148     uint64_t *mem_sizep, uint64_t *seg_sizep, uint64_t *bank_sizep,
149     int *segsp, int *banksp, int *mcidp)
150 { return (ENOTSUP); }
151 
152 /*ARGSUSED*/
153 void
154 cpu_ereport_post(struct async_flt *aflt)
155 {}
156 
157 /*ARGSUSED*/
158 void
159 cpu_run_bus_error_handlers(struct async_flt *aflt, int expected)
160 {}
161 
162 void
163 cpu_errorq_dispatch(char *error_class, void *payload, size_t payload_sz,
164     errorq_t *eqp, uint_t flag)
165 {}
166 
167 void
168 clr_datapath(void)
169 {}
170 
171 /*ARGSUSED*/
172 void
173 read_ecc_data(struct async_flt *ecc, short verbose, short ce_err)
174 {}
175 
176 /*ARGSUSED*/
177 void
178 itlb_rd_entry(uint_t entry, tte_t *tte, uint64_t *va_tag)
179 {}
180 
181 /*ARGSUSED*/
182 void
183 dtlb_rd_entry(uint_t entry, tte_t *tte, uint64_t *va_tag)
184 {}
185 
186 /*
187  * tick operations
188  */
189 
190 void
191 cpu_clearticknpt(void)
192 { }
193 
194 /*
195  * Ecache scrub operations
196  */
197 void
198 cpu_init_cache_scrub(void)
199 {}
200 
201 /*ARGSUSED*/
202 void
203 cpu_busy_ecache_scrub(struct cpu *cp)
204 {}
205 
206 /*ARGSUSED*/
207 void
208 cpu_idle_ecache_scrub(struct cpu *cp)
209 {}
210 
211 /* ARGSUSED */
212 void
213 cpu_check_ce(int flag, uint64_t pa, caddr_t va, uint_t bpp)
214 {}
215 
216 /* ARGSUSED */
217 void
218 prefetch_page_w(void *pp)
219 {
220 #define	ECACHE_SUBBLOCKS_PER_PAGE	2
221 #define	ECACHE_SUBBLOCK_SIZE_BYTES	64
222 #define	ECACHE_PAGE_BYTE_MAX	\
223 	(ECACHE_SUBBLOCKS_PER_PAGE*ECACHE_SUBBLOCK_SIZE_BYTES+1)
224 
225 	/*
226 	 * The following line is intended to cause an error
227 	 * whenever the sun4u page_t grows beyond 128
228 	 * bytes.
229 	 *
230 	 * If you get an error here, you'll need to change
231 	 * the 'prefetch_page_w' assembly language code
232 	 * (see also prefetch_page_w prologue comment)
233 	 */
234 	/*LINTED*/
235 	volatile int garbage[ECACHE_PAGE_BYTE_MAX - sizeof (page_t)];
236 }
237 
238 /* ARGSUSED */
239 void
240 prefetch_page_r(void *pp)
241 {
242 #define	ECACHE_SUBBLOCKS_PER_PAGE	2
243 #define	ECACHE_SUBBLOCK_SIZE_BYTES	64
244 #define	ECACHE_PAGE_BYTE_MAX	\
245 	(ECACHE_SUBBLOCKS_PER_PAGE*ECACHE_SUBBLOCK_SIZE_BYTES+1)
246 
247 	/*
248 	 * The following line is intended to cause an error
249 	 * whenever the sun4u page_t grows beyond 128
250 	 * bytes.
251 	 *
252 	 * If you get an error here, you'll need to change
253 	 * the 'prefetch_page_r' assembly language code
254 	 * (see also prefetch_page_w prologue comment)
255 	 */
256 	/*LINTED*/
257 	volatile int garbage[ECACHE_PAGE_BYTE_MAX - sizeof (page_t)];
258 }
259 
260 
261 #ifdef	SEGKPM_SUPPORT
262 #define	SMAP_SIZE	80
263 #else
264 #define	SMAP_SIZE	56
265 #endif
266 
267 /* ARGSUSED */
268 void
269 prefetch_smap_w(void *smp)
270 {
271 
272 	/*
273 	 * The following lines are intended to cause an error
274 	 * whenever the smap object size changes from the current
275 	 * size of 48 bytes.  If you get an error here, you'll
276 	 * need to update the code in the 'prefetch_smap_w' assembly
277 	 * language code.
278 	 */
279 	/*LINTED*/
280 	volatile int smap_size_changed [SMAP_SIZE - sizeof (struct smap) + 1];
281 	volatile int smap_size_changed2 [sizeof (struct smap) - SMAP_SIZE + 1];
282 }
283 
284 void
285 kdi_flush_caches(void)
286 {}
287 
288 /*ARGSUSED*/
289 void
290 mmu_init_kernel_pgsz(struct hat *hat)
291 {
292 }
293 
294 size_t
295 mmu_get_kernel_lpsize(size_t value)
296 {
297 	return (value);
298 }
299