xref: /titanic_41/usr/src/uts/intel/sys/mc.h (revision 5aefb6555731130ca4fd295960123d71f2d21fe8)
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  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_MC_H
27 #define	_SYS_MC_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 /*
32  * Public interfaces exposed by the memory controller driver
33  */
34 
35 #include <sys/cpuvar.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 #define	MC_UNUM_NAMLEN		192
42 #define	MC_UNUM_NDIMM		8
43 
44 typedef struct mc_unum {
45 	int unum_board;
46 	int unum_chip;
47 	int unum_mc;
48 	int unum_cs;
49 	uint64_t unum_offset;
50 	int unum_dimms[MC_UNUM_NDIMM];
51 } mc_unum_t;
52 
53 #define	MC_AMD_DEV_OFFSET	24	/* node ID + offset == PCI dev num */
54 
55 #define	MC_IOC			(0x4d43 << 16)
56 #define	MC_IOC_SNAPSHOT_INFO	(MC_IOC | 1)
57 #define	MC_IOC_SNAPSHOT		(MC_IOC | 2)
58 
59 /*
60  * Prior to requesting a copy of the snapshot, consumers are advised to request
61  * information regarding the snapshot.  An mc_snapshot_info_t will be returned,
62  * containing the snapshot size as well as the snapshot generation number.  Note
63  * that, due to the potentially dynamic nature of the system, the snapshot may
64  * change at any time.  As such, the information in the mc_snapshot_info_t may
65  * be out of date by the time it is used.  The generation number is used to
66  * track snapshot changes.  That is, the generation number will be updated each
67  * time the source data for the snapshot is updated.  The consumer should not
68  * attach any meaning to the magnitude of a generation number change, and pay
69  * attention only to the fact that the number has changed.
70  */
71 typedef struct mc_snapshot_info {
72 	uint32_t mcs_size;	/* snapshot size */
73 	uint_t mcs_gen;		/* snapshot generation number */
74 } mc_snapshot_info_t;
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif /* _SYS_MC_H */
81