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