summaryrefslogtreecommitdiff
path: root/usr/src/uts/intel/io/intel_nhm/nhm_log.h
blob: 13c1be5ae94837236e1dfb511cc4a137631d0cb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */

/*
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _NHM_LOG_H
#define	_NHM_LOG_H

#ifdef __cplusplus
extern "C" {
#endif

#include <sys/cpu_module.h>

typedef struct nhm_dimm {
	uint64_t dimm_size;
	uint8_t nranks;
	uint8_t nbanks;
	uint8_t ncolumn;
	uint8_t nrow;
	uint8_t width;
	char manufacturer[64];
	char serial_number[64];
	char part_number[16];
	char revision[2];
	char label[64];
} nhm_dimm_t;

extern nhm_dimm_t **nhm_dimms;
extern uint32_t nhm_chipset;

extern errorq_t *nhm_queue;
extern kmutex_t nhm_mutex;

extern void nhm_drain(void *, const void *, const errorq_elem_t *);

extern int nhm_init(void);
extern int nhm_dev_init(void);
extern void nhm_dev_reinit(void);
extern void nhm_unload(void);
extern void nhm_dev_unload(void);

extern int inhm_mc_register(cmi_hdl_t, void *, void *, void *);
extern void nhm_scrubber_enable(void);
extern void nhm_error_trap(cmi_hdl_t, boolean_t, boolean_t);

extern void nhm_pci_cfg_setup(dev_info_t *);
extern void nhm_pci_cfg_free(void);

extern uint8_t nhm_pci_getb(int, int, int, int, int *);
extern uint16_t nhm_pci_getw(int, int, int, int, int *);
extern uint32_t nhm_pci_getl(int, int, int, int, int *);
extern void nhm_pci_putb(int, int, int, int, uint8_t);
extern void nhm_pci_putw(int, int, int, int, uint16_t);
extern void nhm_pci_putl(int, int, int, int, uint32_t);

extern uint64_t dimm_to_addr(int, int, int, uint64_t, uint64_t *, uint64_t *,
    uint32_t *, uint32_t *, uint32_t *, uint32_t *, uint32_t *, uint32_t *);

#ifdef __cplusplus
}
#endif

#endif /* _NHM_LOG_H */