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 377532SSean.Ye@Sun.COM #define FM_DRV_VERSION 1 387532SSean.Ye@Sun.COM 397532SSean.Ye@Sun.COM #define FM_VERSIONS_VERSION "fm-versions-version" 407532SSean.Ye@Sun.COM #define FM_PAGE_OP_VERSION "page-operation-version" 417532SSean.Ye@Sun.COM #define FM_CPU_OP_VERSION "cpu-operation-version" 427532SSean.Ye@Sun.COM #define FM_CPU_INFO_VERSION "cpu-info-version" 4310942STom.Pothier@Sun.COM #define FM_TOPO_LEGACY_VERSION "topo-legacy-version" 447532SSean.Ye@Sun.COM 457532SSean.Ye@Sun.COM /* 467532SSean.Ye@Sun.COM * FMA driver ioctl interfaces 477532SSean.Ye@Sun.COM */ 487532SSean.Ye@Sun.COM #define FM_IOC (0xFA << 16) 497532SSean.Ye@Sun.COM #define FM_IOC_VERSIONS (FM_IOC | 1) 507532SSean.Ye@Sun.COM #define FM_IOC_PAGE_RETIRE (FM_IOC | 2) 517532SSean.Ye@Sun.COM #define FM_IOC_PAGE_STATUS (FM_IOC | 3) 527532SSean.Ye@Sun.COM #define FM_IOC_PAGE_UNRETIRE (FM_IOC | 4) 537532SSean.Ye@Sun.COM 547532SSean.Ye@Sun.COM #if defined(__x86) 557532SSean.Ye@Sun.COM #define FM_IOC_PHYSCPU_INFO (FM_IOC | 5) 567532SSean.Ye@Sun.COM #define FM_IOC_CPU_RETIRE (FM_IOC | 6) 577532SSean.Ye@Sun.COM #define FM_IOC_CPU_STATUS (FM_IOC | 7) 587532SSean.Ye@Sun.COM #define FM_IOC_CPU_UNRETIRE (FM_IOC | 8) 5910942STom.Pothier@Sun.COM #define FM_IOC_GENTOPO_LEGACY (FM_IOC | 9) 607532SSean.Ye@Sun.COM #endif /* __x86 */ 617532SSean.Ye@Sun.COM 627532SSean.Ye@Sun.COM /* 637532SSean.Ye@Sun.COM * Types 647532SSean.Ye@Sun.COM */ 657532SSean.Ye@Sun.COM typedef struct fm_ioc_data { 667532SSean.Ye@Sun.COM uint32_t fid_version; /* interface version */ 677532SSean.Ye@Sun.COM size_t fid_insz; /* size of packed input nvlist */ 687532SSean.Ye@Sun.COM caddr_t fid_inbuf; /* buf containing packed input nvl */ 697532SSean.Ye@Sun.COM size_t fid_outsz; /* size of packed output nvlist */ 707532SSean.Ye@Sun.COM caddr_t fid_outbuf; /* buf containing packed output nvl */ 717532SSean.Ye@Sun.COM } fm_ioc_data_t; 727532SSean.Ye@Sun.COM 737532SSean.Ye@Sun.COM #ifdef _KERNEL 747532SSean.Ye@Sun.COM typedef struct fm_ioc_data32 { 757532SSean.Ye@Sun.COM uint32_t fid_version; /* interface version */ 767532SSean.Ye@Sun.COM size32_t fid_insz; /* size of packed input nvlist */ 777532SSean.Ye@Sun.COM caddr32_t fid_inbuf; /* buf containing packed input nvl */ 787532SSean.Ye@Sun.COM size32_t fid_outsz; /* size of packed output nvlist */ 797532SSean.Ye@Sun.COM caddr32_t fid_outbuf; /* buf containing packed output nvl */ 807532SSean.Ye@Sun.COM } fm_ioc_data32_t; 817532SSean.Ye@Sun.COM #endif /* _KERNEL */ 827532SSean.Ye@Sun.COM 837532SSean.Ye@Sun.COM /* 847532SSean.Ye@Sun.COM * Constants 857532SSean.Ye@Sun.COM */ 86*10947SSrihari.Venkatesan@Sun.COM #define FM_PAGE_RETIRE_FMRI "fmri" 87*10947SSrihari.Venkatesan@Sun.COM #define FM_PHYSCPU_INFO_CPUS "cpus" 88*10947SSrihari.Venkatesan@Sun.COM #define FM_CPU_RETIRE_CHIP_ID "chip_id" 89*10947SSrihari.Venkatesan@Sun.COM #define FM_PHYSCPU_INFO_NPROCNODES "procnodes_per_pkg" 90*10947SSrihari.Venkatesan@Sun.COM #define FM_PHYSCPU_INFO_PROCNODE_ID "procnodeid" 91*10947SSrihari.Venkatesan@Sun.COM #define FM_CPU_RETIRE_CORE_ID "core_id" 92*10947SSrihari.Venkatesan@Sun.COM #define FM_CPU_RETIRE_STRAND_ID "strand_id" 93*10947SSrihari.Venkatesan@Sun.COM #define FM_CPU_RETIRE_OLDSTATUS "oldstatus" 94*10947SSrihari.Venkatesan@Sun.COM #define FM_GENTOPO_LEGACY "gentopolegacy" 957532SSean.Ye@Sun.COM 967532SSean.Ye@Sun.COM /* 977532SSean.Ye@Sun.COM * Properties set by FM_PHYSCPU_INFO 987532SSean.Ye@Sun.COM */ 997532SSean.Ye@Sun.COM #define FM_PHYSCPU_INFO_VENDOR_ID "vendor_id" 1007532SSean.Ye@Sun.COM #define FM_PHYSCPU_INFO_FAMILY "family" 1017532SSean.Ye@Sun.COM #define FM_PHYSCPU_INFO_MODEL "model" 1027532SSean.Ye@Sun.COM #define FM_PHYSCPU_INFO_STEPPING "stepping" 10310942STom.Pothier@Sun.COM 10410942STom.Pothier@Sun.COM /* 10510942STom.Pothier@Sun.COM * When Multi-Chip-Module(MCM) support is added 10610942STom.Pothier@Sun.COM * chip_id should map to the processor package 10710942STom.Pothier@Sun.COM * and not the die in the processor package. 10810942STom.Pothier@Sun.COM * This is for FMA; kernel's perception of 10910942STom.Pothier@Sun.COM * chip_id could differ for MCM. 11010942STom.Pothier@Sun.COM */ 1117532SSean.Ye@Sun.COM #define FM_PHYSCPU_INFO_CHIP_ID "chip_id" 11210942STom.Pothier@Sun.COM 1137532SSean.Ye@Sun.COM #define FM_PHYSCPU_INFO_CORE_ID "core_id" 1147532SSean.Ye@Sun.COM #define FM_PHYSCPU_INFO_STRAND_ID "strand_id" 11510942STom.Pothier@Sun.COM #define FM_PHYSCPU_INFO_STRAND_APICID "strand_initial_apicid" 11610942STom.Pothier@Sun.COM #define FM_PHYSCPU_INFO_SMBIOS_ID "smbios_id" 11710942STom.Pothier@Sun.COM #define FM_PHYSCPU_INFO_CHIP_ROOTS "chip_roots" 1187532SSean.Ye@Sun.COM #define FM_PHYSCPU_INFO_CHIP_REV "chip_rev" 1197532SSean.Ye@Sun.COM #define FM_PHYSCPU_INFO_SOCKET_TYPE "socket_type" 1207532SSean.Ye@Sun.COM #define FM_PHYSCPU_INFO_CPU_ID "cpuid" 1217532SSean.Ye@Sun.COM 1227532SSean.Ye@Sun.COM #ifdef __cplusplus 1237532SSean.Ye@Sun.COM } 1247532SSean.Ye@Sun.COM #endif 1257532SSean.Ye@Sun.COM 1267532SSean.Ye@Sun.COM #endif /* _SYS_DEVFM_H */ 127