xref: /onnv-gate/usr/src/uts/intel/sys/mc.h (revision 2869)
11414Scindi /*
21414Scindi  * CDDL HEADER START
31414Scindi  *
41414Scindi  * The contents of this file are subject to the terms of the
5*2869Sgavinm  * Common Development and Distribution License (the "License").
6*2869Sgavinm  * You may not use this file except in compliance with the License.
71414Scindi  *
81414Scindi  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
91414Scindi  * or http://www.opensolaris.org/os/licensing.
101414Scindi  * See the License for the specific language governing permissions
111414Scindi  * and limitations under the License.
121414Scindi  *
131414Scindi  * When distributing Covered Code, include this CDDL HEADER in each
141414Scindi  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
151414Scindi  * If applicable, add the following below this CDDL HEADER, with the
161414Scindi  * fields enclosed by brackets "[]" replaced with your own identifying
171414Scindi  * information: Portions Copyright [yyyy] [name of copyright owner]
181414Scindi  *
191414Scindi  * CDDL HEADER END
201414Scindi  *
211414Scindi  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
221414Scindi  * Use is subject to license terms.
231414Scindi  */
241414Scindi 
251414Scindi #ifndef _SYS_MC_H
261414Scindi #define	_SYS_MC_H
271414Scindi 
281414Scindi #pragma ident	"%Z%%M%	%I%	%E% SMI"
291414Scindi 
301414Scindi /*
311414Scindi  * Public interfaces exposed by the memory controller driver
321414Scindi  */
331414Scindi 
341414Scindi #include <sys/cpuvar.h>
351414Scindi 
361414Scindi #ifdef __cplusplus
371414Scindi extern "C" {
381414Scindi #endif
391414Scindi 
401414Scindi #define	MC_UNUM_NAMLEN		192
41*2869Sgavinm #define	MC_UNUM_NDIMM		2
421414Scindi 
431414Scindi typedef struct mc_unum {
441414Scindi 	int unum_board;
451414Scindi 	int unum_chip;
461414Scindi 	int unum_mc;
471414Scindi 	int unum_cs;
48*2869Sgavinm 	int unum_rank;
491414Scindi 	uint64_t unum_offset;
501414Scindi 	int unum_dimms[MC_UNUM_NDIMM];
511414Scindi } mc_unum_t;
521414Scindi 
53*2869Sgavinm /*
54*2869Sgavinm  * Invalid marker used in some numeric properties
55*2869Sgavinm  */
56*2869Sgavinm #define	MC_INVALNUM		((uint32_t)-1)
57*2869Sgavinm 
581414Scindi #define	MC_AMD_DEV_OFFSET	24	/* node ID + offset == PCI dev num */
591414Scindi 
60*2869Sgavinm /*
61*2869Sgavinm  * /dev/mc/mc* ioctl cmds
62*2869Sgavinm  */
631414Scindi #define	MC_IOC			(0x4d43 << 16)
641414Scindi #define	MC_IOC_SNAPSHOT_INFO	(MC_IOC | 1)
651414Scindi #define	MC_IOC_SNAPSHOT		(MC_IOC | 2)
66*2869Sgavinm #define	MC_IOC_ONLINESPARE_EN	(MC_IOC | 4)
671414Scindi 
681414Scindi /*
691414Scindi  * Prior to requesting a copy of the snapshot, consumers are advised to request
701414Scindi  * information regarding the snapshot.  An mc_snapshot_info_t will be returned,
711414Scindi  * containing the snapshot size as well as the snapshot generation number.  Note
721414Scindi  * that, due to the potentially dynamic nature of the system, the snapshot may
731414Scindi  * change at any time.  As such, the information in the mc_snapshot_info_t may
741414Scindi  * be out of date by the time it is used.  The generation number is used to
751414Scindi  * track snapshot changes.  That is, the generation number will be updated each
761414Scindi  * time the source data for the snapshot is updated.  The consumer should not
771414Scindi  * attach any meaning to the magnitude of a generation number change, and pay
781414Scindi  * attention only to the fact that the number has changed.
791414Scindi  */
801414Scindi typedef struct mc_snapshot_info {
811414Scindi 	uint32_t mcs_size;	/* snapshot size */
821414Scindi 	uint_t mcs_gen;		/* snapshot generation number */
831414Scindi } mc_snapshot_info_t;
841414Scindi 
851414Scindi #ifdef __cplusplus
861414Scindi }
871414Scindi #endif
881414Scindi 
891414Scindi #endif /* _SYS_MC_H */
90