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
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.
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]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <sys/cpu_module.h>
31 #include <vm/seg_map.h>
34 cpu_fiximp(pnode_t dnode
)
50 cpu_flush_ecache(void)
54 cpu_disable_errors(void)
57 /* It could be removed later if prom enables error handling */
59 cpu_enable_errors(void)
64 cpu_faulted_enter(struct cpu
*cp
)
69 cpu_faulted_exit(struct cpu
*cp
)
74 cpu_ce_count_unum(struct async_flt
*ecc
, int len
, char *unum
)
79 cpu_ce_scrub_mem_err(struct async_flt
*ecc
, boolean_t triedcpulogout
)
84 cpu_ce_log_err(struct async_flt
*ecc
, errorq_elem_t
*eqep
)
89 cpu_ue_log_err(struct async_flt
*ecc
)
94 ce_scrub_xdiag_recirc(struct async_flt
*aflt
, errorq_t
*eqp
,
95 errorq_elem_t
*eqep
, size_t afltoffset
)
100 flt_to_error_type(struct async_flt
*aflt
)
108 cpu_async_panic_callb(void)
113 cpu_check_allcpus(struct async_flt
*aflt
)
118 cpu_get_mem_sid(char *unum
, char *buf
, int buflen
, int *lenp
)
119 { return (ENOTSUP
); }
123 cpu_get_mem_offset(uint64_t flt_addr
, uint64_t *offp
)
124 { return (ENOTSUP
); }
128 cpu_get_mem_addr(char *unum
, char *sid
, uint64_t offset
,
130 { return (ENOTSUP
); }
134 cpu_get_mem_unum(int synd_stat
, ushort_t synd
, uint64_t afsr
, uint64_t afar
,
135 int cpuid
, int flt_in_memory
, ushort_t flt_status
, char *buf
,
136 int buflen
, int *lenp
)
137 { return (ENOTSUP
); }
141 cpu_get_mem_unum_aflt(int synd_stat
, struct async_flt
*aflt
,
142 char *buf
, int buflen
, int *lenp
)
143 { return (ENOTSUP
); }
147 cpu_get_cpu_unum(int cpuid
, char *buf
, int buflen
, int *lenp
)
148 { return (ENOTSUP
); }
152 cpu_get_mem_name(uint64_t synd
, uint64_t *afsr
, uint64_t afar
,
153 char *buf
, int buflen
, int *lenp
)
154 { return (ENOTSUP
); }
158 cpu_get_name_bufsize()
163 cpu_get_mem_info(uint64_t synd
, uint64_t afar
,
164 uint64_t *mem_sizep
, uint64_t *seg_sizep
, uint64_t *bank_sizep
,
165 int *segsp
, int *banksp
, int *mcidp
)
166 { return (ENOTSUP
); }
170 cpu_ereport_post(struct async_flt
*aflt
)
175 cpu_run_bus_error_handlers(struct async_flt
*aflt
, int expected
)
179 cpu_errorq_dispatch(char *error_class
, void *payload
, size_t payload_sz
,
180 errorq_t
*eqp
, uint_t flag
)
189 read_ecc_data(struct async_flt
*ecc
, short verbose
, short ce_err
)
194 itlb_rd_entry(uint_t entry
, tte_t
*tte
, uint64_t *va_tag
)
199 dtlb_rd_entry(uint_t entry
, tte_t
*tte
, uint64_t *va_tag
)
207 cpu_clearticknpt(void)
211 * Ecache scrub operations
214 cpu_init_cache_scrub(void)
219 cpu_busy_ecache_scrub(struct cpu
*cp
)
224 cpu_idle_ecache_scrub(struct cpu
*cp
)
229 cpu_check_ce(int flag
, uint64_t pa
, caddr_t va
, uint_t bpp
)
234 prefetch_page_w(void *pp
)
236 #define ECACHE_SUBBLOCKS_PER_PAGE 2
237 #define ECACHE_SUBBLOCK_SIZE_BYTES 64
238 #define ECACHE_PAGE_BYTE_MAX \
239 (ECACHE_SUBBLOCKS_PER_PAGE*ECACHE_SUBBLOCK_SIZE_BYTES+1)
242 * The following line is intended to cause an error
243 * whenever the sun4u page_t grows beyond 128
246 * If you get an error here, you'll need to change
247 * the 'prefetch_page_w' assembly language code
248 * (see also prefetch_page_w prologue comment)
251 volatile int garbage
[ECACHE_PAGE_BYTE_MAX
- sizeof (page_t
)];
256 prefetch_page_r(void *pp
)
258 #define ECACHE_SUBBLOCKS_PER_PAGE 2
259 #define ECACHE_SUBBLOCK_SIZE_BYTES 64
260 #define ECACHE_PAGE_BYTE_MAX \
261 (ECACHE_SUBBLOCKS_PER_PAGE*ECACHE_SUBBLOCK_SIZE_BYTES+1)
264 * The following line is intended to cause an error
265 * whenever the sun4u page_t grows beyond 128
268 * If you get an error here, you'll need to change
269 * the 'prefetch_page_r' assembly language code
270 * (see also prefetch_page_w prologue comment)
273 volatile int garbage
[ECACHE_PAGE_BYTE_MAX
- sizeof (page_t
)];
277 #ifdef SEGKPM_SUPPORT
285 prefetch_smap_w(void *smp
)
289 * The following lines are intended to cause an error
290 * whenever the smap object size changes from the current
291 * size of 48 bytes. If you get an error here, you'll
292 * need to update the code in the 'prefetch_smap_w' assembly
296 volatile int smap_size_changed
[SMAP_SIZE
- sizeof (struct smap
) + 1];
297 volatile int smap_size_changed2
[sizeof (struct smap
) - SMAP_SIZE
+ 1];
301 kdi_flush_caches(void)
306 mmu_init_kernel_pgsz(struct hat
*hat
)
311 mmu_get_kernel_lpsize(size_t value
)