xref: /illumos-gate/usr/src/uts/i86pc/sys/cpu_module_ms_impl.h (revision 6e375c8351497b82ffa4f33cbf61d712999b4605)
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 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_CPU_MODULE_MS_IMPL_H
28 #define	_CPU_MODULE_MS_IMPL_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/cpu_module_ms.h>
33 #include <sys/cpuvar.h>
34 #include <sys/x86_archext.h>
35 #include <sys/nvpair.h>
36 
37 #ifdef  __cplusplus
38 extern "C" {
39 #endif
40 
41 typedef uint32_t cms_api_ver_t;
42 
43 #define	_CMS_API_VERSION_MAGIC	0xc5500000
44 #define	_CMS_API_VERSION(n)	(_CMS_API_VERSION_MAGIC | (n))
45 
46 #define	CMS_API_VERSION_CHKMAGIC(v) \
47 	(((v) & 0xfff00000) == _CMS_API_VERSION_MAGIC)
48 #define	CMS_API_VERSION_TOPRINT(v) ((v) & 0x000fffff)
49 
50 #define	CMS_API_VERSION_0	_CMS_API_VERSION(0)
51 
52 #define	CMS_API_VERSION		CMS_API_VERSION_0
53 
54 typedef struct cms_ops {
55 	int (*cms_init)(cmi_hdl_t, void **);
56 	void (*cms_post_startup)(cmi_hdl_t);
57 	void (*cms_post_mpstartup)(cmi_hdl_t);
58 	size_t (*cms_logout_size)(cmi_hdl_t);
59 	uint64_t (*cms_mcgctl_val)(cmi_hdl_t, int, uint64_t);
60 	boolean_t (*cms_bankctl_skipinit)(cmi_hdl_t, int);
61 	uint64_t (*cms_bankctl_val)(cmi_hdl_t, int, uint64_t);
62 	boolean_t (*cms_bankstatus_skipinit)(cmi_hdl_t, int);
63 	uint64_t (*cms_bankstatus_val)(cmi_hdl_t, int, uint64_t);
64 	void (*cms_mca_init)(cmi_hdl_t, int);
65 	uint64_t (*cms_poll_ownermask)(cmi_hdl_t, hrtime_t);
66 	void (*cms_bank_logout)(cmi_hdl_t, int, uint64_t,
67 	    uint64_t, uint64_t, void *);
68 	uint32_t (*cms_error_action)(cmi_hdl_t, int, int, uint64_t,
69 	    uint64_t, uint64_t, void *);
70 	cms_cookie_t (*cms_disp_match)(cmi_hdl_t, int, uint64_t, uint64_t,
71 	    uint64_t, void *);
72 	void (*cms_ereport_class)(cmi_hdl_t, cms_cookie_t, const char **,
73 	    const char **);
74 	nvlist_t *(*cms_ereport_detector)(cmi_hdl_t, cms_cookie_t,
75 	    nv_alloc_t *);
76 	boolean_t (*cms_ereport_includestack)(cmi_hdl_t, cms_cookie_t);
77 	void (*cms_ereport_add_logout)(cmi_hdl_t, nvlist_t *,
78 	    nv_alloc_t *, int, uint64_t, uint64_t, uint64_t, void *,
79 	    cms_cookie_t);
80 	cms_errno_t (*cms_msrinject)(cmi_hdl_t, uint_t, uint64_t);
81 	void (*cms_fini)(cmi_hdl_t);
82 } cms_ops_t;
83 
84 #ifdef	__cplusplus
85 }
86 #endif
87 
88 #endif /* _CPU_MODULE_MS_IMPL_H */
89