xref: /illumos-gate/usr/src/uts/common/sys/devfm.h (revision 909c9a9f5171df17baed828a2889f1817ee87cfa)
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 2008 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 
44 /*
45  * FMA driver ioctl interfaces
46  */
47 #define	FM_IOC			(0xFA << 16)
48 #define	FM_IOC_VERSIONS		(FM_IOC | 1)
49 #define	FM_IOC_PAGE_RETIRE	(FM_IOC | 2)
50 #define	FM_IOC_PAGE_STATUS	(FM_IOC | 3)
51 #define	FM_IOC_PAGE_UNRETIRE	(FM_IOC | 4)
52 
53 #if defined(__x86)
54 #define	FM_IOC_PHYSCPU_INFO	(FM_IOC | 5)
55 #define	FM_IOC_CPU_RETIRE	(FM_IOC | 6)
56 #define	FM_IOC_CPU_STATUS	(FM_IOC | 7)
57 #define	FM_IOC_CPU_UNRETIRE	(FM_IOC | 8)
58 #endif	/* __x86 */
59 
60 /*
61  * Types
62  */
63 typedef struct fm_ioc_data {
64 	uint32_t	fid_version;	/* interface version */
65 	size_t		fid_insz;	/* size of packed input nvlist */
66 	caddr_t		fid_inbuf;	/* buf containing packed input nvl */
67 	size_t		fid_outsz;	/* size of packed output nvlist */
68 	caddr_t		fid_outbuf;	/* buf containing packed output nvl */
69 } fm_ioc_data_t;
70 
71 #ifdef _KERNEL
72 typedef struct fm_ioc_data32 {
73 	uint32_t	fid_version;	/* interface version */
74 	size32_t	fid_insz;	/* size of packed input nvlist */
75 	caddr32_t	fid_inbuf;	/* buf containing packed input nvl */
76 	size32_t	fid_outsz;	/* size of packed output nvlist */
77 	caddr32_t	fid_outbuf;	/* buf containing packed output nvl */
78 } fm_ioc_data32_t;
79 #endif	/* _KERNEL */
80 
81 /*
82  * Constants
83  */
84 #define	FM_PAGE_RETIRE_FMRI	"fmri"
85 #define	FM_PHYSCPU_INFO_CPUS	"cpus"
86 #define	FM_CPU_RETIRE_CHIP_ID	"chip_id"
87 #define	FM_CPU_RETIRE_CORE_ID	"core_id"
88 #define	FM_CPU_RETIRE_STRAND_ID	"strand_id"
89 #define	FM_CPU_RETIRE_OLDSTATUS	"oldstatus"
90 
91 /*
92  * Properties set by FM_PHYSCPU_INFO
93  */
94 #define	FM_PHYSCPU_INFO_VENDOR_ID	"vendor_id"
95 #define	FM_PHYSCPU_INFO_FAMILY		"family"
96 #define	FM_PHYSCPU_INFO_MODEL		"model"
97 #define	FM_PHYSCPU_INFO_STEPPING	"stepping"
98 #define	FM_PHYSCPU_INFO_CHIP_ID		"chip_id"
99 #define	FM_PHYSCPU_INFO_CORE_ID		"core_id"
100 #define	FM_PHYSCPU_INFO_STRAND_ID	"strand_id"
101 #define	FM_PHYSCPU_INFO_CHIP_REV	"chip_rev"
102 #define	FM_PHYSCPU_INFO_SOCKET_TYPE	"socket_type"
103 #define	FM_PHYSCPU_INFO_CPU_ID		"cpuid"
104 
105 #ifdef	__cplusplus
106 }
107 #endif
108 
109 #endif	/* _SYS_DEVFM_H */
110