xref: /onnv-gate/usr/src/uts/intel/sys/mc.h (revision 5254:38162db71c7d)
11414Scindi /*
21414Scindi  * CDDL HEADER START
31414Scindi  *
41414Scindi  * The contents of this file are subject to the terms of the
52869Sgavinm  * Common Development and Distribution License (the "License").
62869Sgavinm  * 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  *
21*5254Sgavinm  * Copyright 2007 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
412869Sgavinm #define	MC_UNUM_NDIMM		2
421414Scindi 
431414Scindi typedef struct mc_unum {
44*5254Sgavinm 	int unum_board;			/* system board */
45*5254Sgavinm 	int unum_chip;			/* chip/socket */
46*5254Sgavinm 	int unum_mc;			/* memory-controller or branch */
47*5254Sgavinm 	int unum_chan;			/* DRAM channel */
48*5254Sgavinm 	int unum_cs;			/* chip-select */
49*5254Sgavinm 	int unum_rank;			/* rank */
50*5254Sgavinm 	uint64_t unum_offset;		/* row, column, bank-select etc */
511414Scindi 	int unum_dimms[MC_UNUM_NDIMM];
521414Scindi } mc_unum_t;
531414Scindi 
542869Sgavinm /*
552869Sgavinm  * Invalid marker used in some numeric properties
562869Sgavinm  */
572869Sgavinm #define	MC_INVALNUM		((uint32_t)-1)
582869Sgavinm 
592869Sgavinm /*
602869Sgavinm  * /dev/mc/mc* ioctl cmds
612869Sgavinm  */
621414Scindi #define	MC_IOC			(0x4d43 << 16)
631414Scindi #define	MC_IOC_SNAPSHOT_INFO	(MC_IOC | 1)
641414Scindi #define	MC_IOC_SNAPSHOT		(MC_IOC | 2)
652869Sgavinm #define	MC_IOC_ONLINESPARE_EN	(MC_IOC | 4)
661414Scindi 
671414Scindi /*
681414Scindi  * Prior to requesting a copy of the snapshot, consumers are advised to request
691414Scindi  * information regarding the snapshot.  An mc_snapshot_info_t will be returned,
701414Scindi  * containing the snapshot size as well as the snapshot generation number.  Note
711414Scindi  * that, due to the potentially dynamic nature of the system, the snapshot may
721414Scindi  * change at any time.  As such, the information in the mc_snapshot_info_t may
731414Scindi  * be out of date by the time it is used.  The generation number is used to
741414Scindi  * track snapshot changes.  That is, the generation number will be updated each
751414Scindi  * time the source data for the snapshot is updated.  The consumer should not
761414Scindi  * attach any meaning to the magnitude of a generation number change, and pay
771414Scindi  * attention only to the fact that the number has changed.
781414Scindi  */
791414Scindi typedef struct mc_snapshot_info {
801414Scindi 	uint32_t mcs_size;	/* snapshot size */
811414Scindi 	uint_t mcs_gen;		/* snapshot generation number */
821414Scindi } mc_snapshot_info_t;
831414Scindi 
841414Scindi #ifdef __cplusplus
851414Scindi }
861414Scindi #endif
871414Scindi 
881414Scindi #endif /* _SYS_MC_H */
89