xref: /illumos-gate/usr/src/uts/common/sys/devfm.h (revision defc4c8acfa01dba1ef3c13ca0cafccfcede51c0)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_DEVFM_H
27 #define	_SYS_DEVFM_H
28 
29 #include <sys/types.h>
30 #include <sys/nvpair.h>
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	FM_IOC_MAXBUFSZ		32768
37 #define	FM_IOC_OUT_BUFSZ	32768
38 #define	FM_IOC_OUT_MAXBUFSZ	524288
39 #define	FM_DRV_VERSION		1
40 
41 #define	FM_VERSIONS_VERSION	"fm-versions-version"
42 #define	FM_PAGE_OP_VERSION	"page-operation-version"
43 #define	FM_CPU_OP_VERSION	"cpu-operation-version"
44 #define	FM_CPU_INFO_VERSION	"cpu-info-version"
45 #define	FM_TOPO_LEGACY_VERSION	"topo-legacy-version"
46 
47 /*
48  * FMA driver ioctl interfaces
49  */
50 #define	FM_IOC			(0xFA << 16)
51 #define	FM_IOC_VERSIONS		(FM_IOC | 1)
52 #define	FM_IOC_PAGE_RETIRE	(FM_IOC | 2)
53 #define	FM_IOC_PAGE_STATUS	(FM_IOC | 3)
54 #define	FM_IOC_PAGE_UNRETIRE	(FM_IOC | 4)
55 
56 #if defined(__x86)
57 #define	FM_IOC_PHYSCPU_INFO	(FM_IOC | 5)
58 #define	FM_IOC_CPU_RETIRE	(FM_IOC | 6)
59 #define	FM_IOC_CPU_STATUS	(FM_IOC | 7)
60 #define	FM_IOC_CPU_UNRETIRE	(FM_IOC | 8)
61 #define	FM_IOC_GENTOPO_LEGACY	(FM_IOC | 9)
62 #endif	/* __x86 */
63 
64 /*
65  * Types
66  */
67 typedef struct fm_ioc_data {
68 	uint32_t	fid_version;	/* interface version */
69 	size_t		fid_insz;	/* size of packed input nvlist */
70 	caddr_t		fid_inbuf;	/* buf containing packed input nvl */
71 	size_t		fid_outsz;	/* size of packed output nvlist */
72 	caddr_t		fid_outbuf;	/* buf containing packed output nvl */
73 } fm_ioc_data_t;
74 
75 #ifdef _KERNEL
76 typedef struct fm_ioc_data32 {
77 	uint32_t	fid_version;	/* interface version */
78 	size32_t	fid_insz;	/* size of packed input nvlist */
79 	caddr32_t	fid_inbuf;	/* buf containing packed input nvl */
80 	size32_t	fid_outsz;	/* size of packed output nvlist */
81 	caddr32_t	fid_outbuf;	/* buf containing packed output nvl */
82 } fm_ioc_data32_t;
83 #endif	/* _KERNEL */
84 
85 /*
86  * Constants
87  */
88 #define	FM_PAGE_RETIRE_FMRI		"fmri"
89 #define	FM_PHYSCPU_INFO_CPUS		"cpus"
90 #define	FM_CPU_RETIRE_CHIP_ID		"chip_id"
91 #define	FM_PHYSCPU_INFO_NPROCNODES	"procnodes_per_pkg"
92 #define	FM_PHYSCPU_INFO_PROCNODE_ID	"procnodeid"
93 #define	FM_CPU_RETIRE_CORE_ID		"core_id"
94 #define	FM_CPU_RETIRE_STRAND_ID		"strand_id"
95 #define	FM_CPU_RETIRE_OLDSTATUS		"oldstatus"
96 #define	FM_GENTOPO_LEGACY		"gentopolegacy"
97 
98 /*
99  * Properties set by FM_PHYSCPU_INFO
100  */
101 #define	FM_PHYSCPU_INFO_VENDOR_ID	"vendor_id"
102 #define	FM_PHYSCPU_INFO_FAMILY		"family"
103 #define	FM_PHYSCPU_INFO_MODEL		"model"
104 #define	FM_PHYSCPU_INFO_STEPPING	"stepping"
105 
106 /*
107  * When Multi-Chip-Module(MCM) support is added
108  * chip_id should map to the processor package
109  * and not the die in the processor package.
110  * This is for FMA; kernel's perception of
111  * chip_id could differ for MCM.
112  */
113 #define	FM_PHYSCPU_INFO_CHIP_ID		"chip_id"
114 
115 #define	FM_PHYSCPU_INFO_CORE_ID		"core_id"
116 #define	FM_PHYSCPU_INFO_STRAND_ID	"strand_id"
117 #define	FM_PHYSCPU_INFO_STRAND_APICID	"strand_initial_apicid"
118 #define	FM_PHYSCPU_INFO_SMBIOS_ID	"smbios_id"
119 #define	FM_PHYSCPU_INFO_CHIP_ROOTS	"chip_roots"
120 #define	FM_PHYSCPU_INFO_CHIP_REV	"chip_rev"
121 #define	FM_PHYSCPU_INFO_SOCKET_TYPE	"socket_type"
122 #define	FM_PHYSCPU_INFO_CPU_ID		"cpuid"
123 
124 #ifdef	__cplusplus
125 }
126 #endif
127 
128 #endif	/* _SYS_DEVFM_H */
129