xref: /titanic_50/usr/src/uts/i86pc/cpu/generic_cpu/gcpu.h (revision d8260c5137b0926a897a3763eca8997922ad7401)
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 _GCPU_H
29 #define	_GCPU_H
30 
31 #pragma ident	"%Z%%M%	%I%	%E% SMI"
32 
33 #include <sys/types.h>
34 #include <sys/cpu_module.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 typedef struct gcpu_mca_bank {
41 	uint_t bank_ctl;		/* MCi_CTL MSR */
42 	uint_t bank_status;		/* MCi_STATUS MSR */
43 	uint_t bank_addr;		/* MCi_ADDR MSR */
44 	uint_t bank_misc;		/* MCi_MISC MSR */
45 } gcpu_mca_bank_t;
46 
47 typedef struct gcpu_mca_data {
48 	uint64_t bank_status_data;	/* MCi_STATUS value from exception */
49 	uint64_t bank_addr_data;	/* MCi_ADDR value from exception */
50 	uint64_t bank_misc_data;	/* MCi_MISC value from exception */
51 } gcpu_mca_data_t;
52 
53 typedef struct gcpu_mca {
54 	const gcpu_mca_bank_t *gcpu_mca_banks;
55 	gcpu_mca_data_t *gcpu_mca_data;
56 	uint_t gcpu_mca_nbanks;
57 } gcpu_mca_t;
58 
59 typedef struct gcpu_data {
60 	gcpu_mca_t gcpu_mca;
61 } gcpu_data_t;
62 
63 struct regs;
64 
65 extern void gcpu_mca_init(void *);
66 extern int gcpu_mca_trap(void *, struct regs *);
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif /* _GCPU_H */
73