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