xref: /illumos-gate/usr/src/uts/common/sys/devfm.h (revision 67dbe2be0c0f1e2eb428b89088bb5667e8f0b9f6)
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_DRV_VERSION		1
38 
39 #define	FM_VERSIONS_VERSION	"fm-versions-version"
40 #define	FM_PAGE_OP_VERSION	"page-operation-version"
41 #define	FM_CPU_OP_VERSION	"cpu-operation-version"
42 #define	FM_CPU_INFO_VERSION	"cpu-info-version"
43 #define	FM_TOPO_LEGACY_VERSION	"topo-legacy-version"
44 
45 /*
46  * FMA driver ioctl interfaces
47  */
48 #define	FM_IOC			(0xFA << 16)
49 #define	FM_IOC_VERSIONS		(FM_IOC | 1)
50 #define	FM_IOC_PAGE_RETIRE	(FM_IOC | 2)
51 #define	FM_IOC_PAGE_STATUS	(FM_IOC | 3)
52 #define	FM_IOC_PAGE_UNRETIRE	(FM_IOC | 4)
53 
54 #if defined(__x86)
55 #define	FM_IOC_PHYSCPU_INFO	(FM_IOC | 5)
56 #define	FM_IOC_CPU_RETIRE	(FM_IOC | 6)
57 #define	FM_IOC_CPU_STATUS	(FM_IOC | 7)
58 #define	FM_IOC_CPU_UNRETIRE	(FM_IOC | 8)
59 #define	FM_IOC_GENTOPO_LEGACY	(FM_IOC | 9)
60 #endif	/* __x86 */
61 
62 /*
63  * Types
64  */
65 typedef struct fm_ioc_data {
66 	uint32_t	fid_version;	/* interface version */
67 	size_t		fid_insz;	/* size of packed input nvlist */
68 	caddr_t		fid_inbuf;	/* buf containing packed input nvl */
69 	size_t		fid_outsz;	/* size of packed output nvlist */
70 	caddr_t		fid_outbuf;	/* buf containing packed output nvl */
71 } fm_ioc_data_t;
72 
73 #ifdef _KERNEL
74 typedef struct fm_ioc_data32 {
75 	uint32_t	fid_version;	/* interface version */
76 	size32_t	fid_insz;	/* size of packed input nvlist */
77 	caddr32_t	fid_inbuf;	/* buf containing packed input nvl */
78 	size32_t	fid_outsz;	/* size of packed output nvlist */
79 	caddr32_t	fid_outbuf;	/* buf containing packed output nvl */
80 } fm_ioc_data32_t;
81 #endif	/* _KERNEL */
82 
83 /*
84  * Constants
85  */
86 #define	FM_PAGE_RETIRE_FMRI		"fmri"
87 #define	FM_PHYSCPU_INFO_CPUS		"cpus"
88 #define	FM_CPU_RETIRE_CHIP_ID		"chip_id"
89 #define	FM_PHYSCPU_INFO_NPROCNODES	"procnodes_per_pkg"
90 #define	FM_PHYSCPU_INFO_PROCNODE_ID	"procnodeid"
91 #define	FM_CPU_RETIRE_CORE_ID		"core_id"
92 #define	FM_CPU_RETIRE_STRAND_ID		"strand_id"
93 #define	FM_CPU_RETIRE_OLDSTATUS		"oldstatus"
94 #define	FM_GENTOPO_LEGACY		"gentopolegacy"
95 
96 /*
97  * Properties set by FM_PHYSCPU_INFO
98  */
99 #define	FM_PHYSCPU_INFO_VENDOR_ID	"vendor_id"
100 #define	FM_PHYSCPU_INFO_FAMILY		"family"
101 #define	FM_PHYSCPU_INFO_MODEL		"model"
102 #define	FM_PHYSCPU_INFO_STEPPING	"stepping"
103 
104 /*
105  * When Multi-Chip-Module(MCM) support is added
106  * chip_id should map to the processor package
107  * and not the die in the processor package.
108  * This is for FMA; kernel's perception of
109  * chip_id could differ for MCM.
110  */
111 #define	FM_PHYSCPU_INFO_CHIP_ID		"chip_id"
112 
113 #define	FM_PHYSCPU_INFO_CORE_ID		"core_id"
114 #define	FM_PHYSCPU_INFO_STRAND_ID	"strand_id"
115 #define	FM_PHYSCPU_INFO_STRAND_APICID	"strand_initial_apicid"
116 #define	FM_PHYSCPU_INFO_SMBIOS_ID	"smbios_id"
117 #define	FM_PHYSCPU_INFO_CHIP_ROOTS	"chip_roots"
118 #define	FM_PHYSCPU_INFO_CHIP_REV	"chip_rev"
119 #define	FM_PHYSCPU_INFO_SOCKET_TYPE	"socket_type"
120 #define	FM_PHYSCPU_INFO_CPU_ID		"cpuid"
121 
122 #ifdef	__cplusplus
123 }
124 #endif
125 
126 #endif	/* _SYS_DEVFM_H */
127