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 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _NHM_LOG_H
28 #define	_NHM_LOG_H
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #include <sys/cpu_module.h>
35 
36 typedef struct nhm_dimm {
37 	uint64_t dimm_size;
38 	uint8_t nranks;
39 	uint8_t nbanks;
40 	uint8_t ncolumn;
41 	uint8_t nrow;
42 	uint8_t width;
43 	char manufacturer[64];
44 	char serial_number[64];
45 	char part_number[16];
46 	char revision[2];
47 	char label[64];
48 } nhm_dimm_t;
49 
50 extern nhm_dimm_t **nhm_dimms;
51 extern uint32_t nhm_chipset;
52 
53 extern errorq_t *nhm_queue;
54 extern kmutex_t nhm_mutex;
55 
56 extern void nhm_drain(void *, const void *, const errorq_elem_t *);
57 
58 extern int nhm_init(void);
59 extern int nhm_dev_init(void);
60 extern void nhm_dev_reinit(void);
61 extern void nhm_unload(void);
62 extern void nhm_dev_unload(void);
63 
64 extern int inhm_mc_register(cmi_hdl_t, void *, void *, void *);
65 extern void nhm_scrubber_enable(void);
66 extern void nhm_error_trap(cmi_hdl_t, boolean_t, boolean_t);
67 
68 extern void nhm_pci_cfg_setup(dev_info_t *);
69 extern void nhm_pci_cfg_free(void);
70 
71 extern uint8_t nhm_pci_getb(int, int, int, int, int *);
72 extern uint16_t nhm_pci_getw(int, int, int, int, int *);
73 extern uint32_t nhm_pci_getl(int, int, int, int, int *);
74 extern void nhm_pci_putb(int, int, int, int, uint8_t);
75 extern void nhm_pci_putw(int, int, int, int, uint16_t);
76 extern void nhm_pci_putl(int, int, int, int, uint32_t);
77 
78 extern uint64_t dimm_to_addr(int, int, int, uint64_t, uint64_t *, uint64_t *,
79     uint32_t *, uint32_t *, uint32_t *, uint32_t *, uint32_t *, uint32_t *);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif /* _NHM_LOG_H */
86