xref: /onnv-gate/usr/src/uts/common/sys/devfm.h (revision 11264:99b4beb4e9f6)
17532SSean.Ye@Sun.COM /*
27532SSean.Ye@Sun.COM  * CDDL HEADER START
37532SSean.Ye@Sun.COM  *
47532SSean.Ye@Sun.COM  * The contents of this file are subject to the terms of the
57532SSean.Ye@Sun.COM  * Common Development and Distribution License (the "License").
67532SSean.Ye@Sun.COM  * You may not use this file except in compliance with the License.
77532SSean.Ye@Sun.COM  *
87532SSean.Ye@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97532SSean.Ye@Sun.COM  * or http://www.opensolaris.org/os/licensing.
107532SSean.Ye@Sun.COM  * See the License for the specific language governing permissions
117532SSean.Ye@Sun.COM  * and limitations under the License.
127532SSean.Ye@Sun.COM  *
137532SSean.Ye@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
147532SSean.Ye@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157532SSean.Ye@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
167532SSean.Ye@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
177532SSean.Ye@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
187532SSean.Ye@Sun.COM  *
197532SSean.Ye@Sun.COM  * CDDL HEADER END
207532SSean.Ye@Sun.COM  */
217532SSean.Ye@Sun.COM /*
2210942STom.Pothier@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237532SSean.Ye@Sun.COM  * Use is subject to license terms.
247532SSean.Ye@Sun.COM  */
257532SSean.Ye@Sun.COM 
267532SSean.Ye@Sun.COM #ifndef	_SYS_DEVFM_H
277532SSean.Ye@Sun.COM #define	_SYS_DEVFM_H
287532SSean.Ye@Sun.COM 
297532SSean.Ye@Sun.COM #include <sys/types.h>
307532SSean.Ye@Sun.COM #include <sys/nvpair.h>
317532SSean.Ye@Sun.COM 
327532SSean.Ye@Sun.COM #ifdef	__cplusplus
337532SSean.Ye@Sun.COM extern "C" {
347532SSean.Ye@Sun.COM #endif
357532SSean.Ye@Sun.COM 
367532SSean.Ye@Sun.COM #define	FM_IOC_MAXBUFSZ		32768
37*11264SAdrian.Frost@Sun.COM #define	FM_IOC_OUT_BUFSZ	32768
38*11264SAdrian.Frost@Sun.COM #define	FM_IOC_OUT_MAXBUFSZ	524288
397532SSean.Ye@Sun.COM #define	FM_DRV_VERSION		1
407532SSean.Ye@Sun.COM 
417532SSean.Ye@Sun.COM #define	FM_VERSIONS_VERSION	"fm-versions-version"
427532SSean.Ye@Sun.COM #define	FM_PAGE_OP_VERSION	"page-operation-version"
437532SSean.Ye@Sun.COM #define	FM_CPU_OP_VERSION	"cpu-operation-version"
447532SSean.Ye@Sun.COM #define	FM_CPU_INFO_VERSION	"cpu-info-version"
4510942STom.Pothier@Sun.COM #define	FM_TOPO_LEGACY_VERSION	"topo-legacy-version"
467532SSean.Ye@Sun.COM 
477532SSean.Ye@Sun.COM /*
487532SSean.Ye@Sun.COM  * FMA driver ioctl interfaces
497532SSean.Ye@Sun.COM  */
507532SSean.Ye@Sun.COM #define	FM_IOC			(0xFA << 16)
517532SSean.Ye@Sun.COM #define	FM_IOC_VERSIONS		(FM_IOC | 1)
527532SSean.Ye@Sun.COM #define	FM_IOC_PAGE_RETIRE	(FM_IOC | 2)
537532SSean.Ye@Sun.COM #define	FM_IOC_PAGE_STATUS	(FM_IOC | 3)
547532SSean.Ye@Sun.COM #define	FM_IOC_PAGE_UNRETIRE	(FM_IOC | 4)
557532SSean.Ye@Sun.COM 
567532SSean.Ye@Sun.COM #if defined(__x86)
577532SSean.Ye@Sun.COM #define	FM_IOC_PHYSCPU_INFO	(FM_IOC | 5)
587532SSean.Ye@Sun.COM #define	FM_IOC_CPU_RETIRE	(FM_IOC | 6)
597532SSean.Ye@Sun.COM #define	FM_IOC_CPU_STATUS	(FM_IOC | 7)
607532SSean.Ye@Sun.COM #define	FM_IOC_CPU_UNRETIRE	(FM_IOC | 8)
6110942STom.Pothier@Sun.COM #define	FM_IOC_GENTOPO_LEGACY	(FM_IOC | 9)
627532SSean.Ye@Sun.COM #endif	/* __x86 */
637532SSean.Ye@Sun.COM 
647532SSean.Ye@Sun.COM /*
657532SSean.Ye@Sun.COM  * Types
667532SSean.Ye@Sun.COM  */
677532SSean.Ye@Sun.COM typedef struct fm_ioc_data {
687532SSean.Ye@Sun.COM 	uint32_t	fid_version;	/* interface version */
697532SSean.Ye@Sun.COM 	size_t		fid_insz;	/* size of packed input nvlist */
707532SSean.Ye@Sun.COM 	caddr_t		fid_inbuf;	/* buf containing packed input nvl */
717532SSean.Ye@Sun.COM 	size_t		fid_outsz;	/* size of packed output nvlist */
727532SSean.Ye@Sun.COM 	caddr_t		fid_outbuf;	/* buf containing packed output nvl */
737532SSean.Ye@Sun.COM } fm_ioc_data_t;
747532SSean.Ye@Sun.COM 
757532SSean.Ye@Sun.COM #ifdef _KERNEL
767532SSean.Ye@Sun.COM typedef struct fm_ioc_data32 {
777532SSean.Ye@Sun.COM 	uint32_t	fid_version;	/* interface version */
787532SSean.Ye@Sun.COM 	size32_t	fid_insz;	/* size of packed input nvlist */
797532SSean.Ye@Sun.COM 	caddr32_t	fid_inbuf;	/* buf containing packed input nvl */
807532SSean.Ye@Sun.COM 	size32_t	fid_outsz;	/* size of packed output nvlist */
817532SSean.Ye@Sun.COM 	caddr32_t	fid_outbuf;	/* buf containing packed output nvl */
827532SSean.Ye@Sun.COM } fm_ioc_data32_t;
837532SSean.Ye@Sun.COM #endif	/* _KERNEL */
847532SSean.Ye@Sun.COM 
857532SSean.Ye@Sun.COM /*
867532SSean.Ye@Sun.COM  * Constants
877532SSean.Ye@Sun.COM  */
8810947SSrihari.Venkatesan@Sun.COM #define	FM_PAGE_RETIRE_FMRI		"fmri"
8910947SSrihari.Venkatesan@Sun.COM #define	FM_PHYSCPU_INFO_CPUS		"cpus"
9010947SSrihari.Venkatesan@Sun.COM #define	FM_CPU_RETIRE_CHIP_ID		"chip_id"
9110947SSrihari.Venkatesan@Sun.COM #define	FM_PHYSCPU_INFO_NPROCNODES	"procnodes_per_pkg"
9210947SSrihari.Venkatesan@Sun.COM #define	FM_PHYSCPU_INFO_PROCNODE_ID	"procnodeid"
9310947SSrihari.Venkatesan@Sun.COM #define	FM_CPU_RETIRE_CORE_ID		"core_id"
9410947SSrihari.Venkatesan@Sun.COM #define	FM_CPU_RETIRE_STRAND_ID		"strand_id"
9510947SSrihari.Venkatesan@Sun.COM #define	FM_CPU_RETIRE_OLDSTATUS		"oldstatus"
9610947SSrihari.Venkatesan@Sun.COM #define	FM_GENTOPO_LEGACY		"gentopolegacy"
977532SSean.Ye@Sun.COM 
987532SSean.Ye@Sun.COM /*
997532SSean.Ye@Sun.COM  * Properties set by FM_PHYSCPU_INFO
1007532SSean.Ye@Sun.COM  */
1017532SSean.Ye@Sun.COM #define	FM_PHYSCPU_INFO_VENDOR_ID	"vendor_id"
1027532SSean.Ye@Sun.COM #define	FM_PHYSCPU_INFO_FAMILY		"family"
1037532SSean.Ye@Sun.COM #define	FM_PHYSCPU_INFO_MODEL		"model"
1047532SSean.Ye@Sun.COM #define	FM_PHYSCPU_INFO_STEPPING	"stepping"
10510942STom.Pothier@Sun.COM 
10610942STom.Pothier@Sun.COM /*
10710942STom.Pothier@Sun.COM  * When Multi-Chip-Module(MCM) support is added
10810942STom.Pothier@Sun.COM  * chip_id should map to the processor package
10910942STom.Pothier@Sun.COM  * and not the die in the processor package.
11010942STom.Pothier@Sun.COM  * This is for FMA; kernel's perception of
11110942STom.Pothier@Sun.COM  * chip_id could differ for MCM.
11210942STom.Pothier@Sun.COM  */
1137532SSean.Ye@Sun.COM #define	FM_PHYSCPU_INFO_CHIP_ID		"chip_id"
11410942STom.Pothier@Sun.COM 
1157532SSean.Ye@Sun.COM #define	FM_PHYSCPU_INFO_CORE_ID		"core_id"
1167532SSean.Ye@Sun.COM #define	FM_PHYSCPU_INFO_STRAND_ID	"strand_id"
11710942STom.Pothier@Sun.COM #define	FM_PHYSCPU_INFO_STRAND_APICID	"strand_initial_apicid"
11810942STom.Pothier@Sun.COM #define	FM_PHYSCPU_INFO_SMBIOS_ID	"smbios_id"
11910942STom.Pothier@Sun.COM #define	FM_PHYSCPU_INFO_CHIP_ROOTS	"chip_roots"
1207532SSean.Ye@Sun.COM #define	FM_PHYSCPU_INFO_CHIP_REV	"chip_rev"
1217532SSean.Ye@Sun.COM #define	FM_PHYSCPU_INFO_SOCKET_TYPE	"socket_type"
1227532SSean.Ye@Sun.COM #define	FM_PHYSCPU_INFO_CPU_ID		"cpuid"
1237532SSean.Ye@Sun.COM 
1247532SSean.Ye@Sun.COM #ifdef	__cplusplus
1257532SSean.Ye@Sun.COM }
1267532SSean.Ye@Sun.COM #endif
1277532SSean.Ye@Sun.COM 
1287532SSean.Ye@Sun.COM #endif	/* _SYS_DEVFM_H */
129