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