xref: /onnv-gate/usr/src/uts/intel/sys/mc.h (revision 1414)
1*1414Scindi /*
2*1414Scindi  * CDDL HEADER START
3*1414Scindi  *
4*1414Scindi  * The contents of this file are subject to the terms of the
5*1414Scindi  * Common Development and Distribution License, Version 1.0 only
6*1414Scindi  * (the "License").  You may not use this file except in compliance
7*1414Scindi  * with the License.
8*1414Scindi  *
9*1414Scindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*1414Scindi  * or http://www.opensolaris.org/os/licensing.
11*1414Scindi  * See the License for the specific language governing permissions
12*1414Scindi  * and limitations under the License.
13*1414Scindi  *
14*1414Scindi  * When distributing Covered Code, include this CDDL HEADER in each
15*1414Scindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*1414Scindi  * If applicable, add the following below this CDDL HEADER, with the
17*1414Scindi  * fields enclosed by brackets "[]" replaced with your own identifying
18*1414Scindi  * information: Portions Copyright [yyyy] [name of copyright owner]
19*1414Scindi  *
20*1414Scindi  * CDDL HEADER END
21*1414Scindi  *
22*1414Scindi  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23*1414Scindi  * Use is subject to license terms.
24*1414Scindi  */
25*1414Scindi 
26*1414Scindi #ifndef _SYS_MC_H
27*1414Scindi #define	_SYS_MC_H
28*1414Scindi 
29*1414Scindi #pragma ident	"%Z%%M%	%I%	%E% SMI"
30*1414Scindi 
31*1414Scindi /*
32*1414Scindi  * Public interfaces exposed by the memory controller driver
33*1414Scindi  */
34*1414Scindi 
35*1414Scindi #include <sys/cpuvar.h>
36*1414Scindi 
37*1414Scindi #ifdef __cplusplus
38*1414Scindi extern "C" {
39*1414Scindi #endif
40*1414Scindi 
41*1414Scindi #define	MC_UNUM_NAMLEN		192
42*1414Scindi #define	MC_UNUM_NDIMM		8
43*1414Scindi 
44*1414Scindi typedef struct mc_unum {
45*1414Scindi 	int unum_board;
46*1414Scindi 	int unum_chip;
47*1414Scindi 	int unum_mc;
48*1414Scindi 	int unum_cs;
49*1414Scindi 	uint64_t unum_offset;
50*1414Scindi 	int unum_dimms[MC_UNUM_NDIMM];
51*1414Scindi } mc_unum_t;
52*1414Scindi 
53*1414Scindi #define	MC_AMD_DEV_OFFSET	24	/* node ID + offset == PCI dev num */
54*1414Scindi 
55*1414Scindi #define	MC_IOC			(0x4d43 << 16)
56*1414Scindi #define	MC_IOC_SNAPSHOT_INFO	(MC_IOC | 1)
57*1414Scindi #define	MC_IOC_SNAPSHOT		(MC_IOC | 2)
58*1414Scindi 
59*1414Scindi /*
60*1414Scindi  * Prior to requesting a copy of the snapshot, consumers are advised to request
61*1414Scindi  * information regarding the snapshot.  An mc_snapshot_info_t will be returned,
62*1414Scindi  * containing the snapshot size as well as the snapshot generation number.  Note
63*1414Scindi  * that, due to the potentially dynamic nature of the system, the snapshot may
64*1414Scindi  * change at any time.  As such, the information in the mc_snapshot_info_t may
65*1414Scindi  * be out of date by the time it is used.  The generation number is used to
66*1414Scindi  * track snapshot changes.  That is, the generation number will be updated each
67*1414Scindi  * time the source data for the snapshot is updated.  The consumer should not
68*1414Scindi  * attach any meaning to the magnitude of a generation number change, and pay
69*1414Scindi  * attention only to the fact that the number has changed.
70*1414Scindi  */
71*1414Scindi typedef struct mc_snapshot_info {
72*1414Scindi 	uint32_t mcs_size;	/* snapshot size */
73*1414Scindi 	uint_t mcs_gen;		/* snapshot generation number */
74*1414Scindi } mc_snapshot_info_t;
75*1414Scindi 
76*1414Scindi #ifdef __cplusplus
77*1414Scindi }
78*1414Scindi #endif
79*1414Scindi 
80*1414Scindi #endif /* _SYS_MC_H */
81