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 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_CPU_MODULE_IMPL_H
28 #define	_SYS_CPU_MODULE_IMPL_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/cpu_module.h>
33 #include <sys/cpuvar.h>
34 #include <sys/types.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 typedef struct cmi_mc_ops {
41 	int (*cmi_mc_patounum)(void *, uint64_t, uint8_t, uint8_t, uint32_t,
42 	    int, mc_unum_t *);
43 	int (*cmi_mc_unumtopa)(void *, mc_unum_t *, nvlist_t *, uint64_t *);
44 } cmi_mc_ops_t;
45 
46 typedef struct cmi_ops {
47 	int (*cmi_init)(cpu_t *, void **);
48 	void (*cmi_post_init)(void *);
49 	void (*cmi_post_mpstartup)(void *);
50 	void (*cmi_fini)(void *);
51 	void (*cmi_faulted_enter)(void *);
52 	void (*cmi_faulted_exit)(void *);
53 	int (*cmi_scrubber_enable)(void *, uint64_t, uint64_t, int);
54 	void (*cmi_mca_init)(void *);
55 	int (*cmi_mca_trap)(void *, struct regs *);
56 	int (*cmi_mca_inject)(void *, cmi_mca_regs_t *, uint_t);
57 	void (*cmi_mca_poke)(void *);
58 	void (*cmi_mc_register)(void *, const cmi_mc_ops_t *, void *);
59 	const struct cmi_mc_ops *(*cmi_mc_getops)(void *);
60 } cmi_ops_t;
61 
62 typedef struct cmi {
63 	struct cmi *cmi_next;
64 	const cmi_ops_t *cmi_ops;
65 	struct modctl *cmi_modp;
66 	uint_t cmi_refcnt;
67 } cmi_t;
68 
69 extern int cmi_panic_on_uncorrectable_error;
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif /* _SYS_CPU_MODULE_IMPL_H */
76