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 /* 23 * Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved. 24 * Copyright (c) 2018, Joyent, Inc. 25 * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 26 * Use is subject to license terms. 27 */ 28 29 /* 30 * This header file defines the interfaces available from the SMBIOS access 31 * library, libsmbios, and an equivalent kernel module. This API can be used 32 * to access DMTF SMBIOS data from a device, file, or raw memory buffer. 33 * 34 * This is NOT a Public interface, and should be considered Unstable, as it is 35 * subject to change without notice as the DMTF SMBIOS specification evolves. 36 * Therefore, be aware that any program linked with this API in this 37 * instance of illumos is almost guaranteed to break in the next release. 38 */ 39 40 #ifndef _SYS_SMBIOS_H 41 #define _SYS_SMBIOS_H 42 43 #include <sys/types.h> 44 45 #ifdef __cplusplus 46 extern "C" { 47 #endif 48 49 typedef enum smbios_entry_point_type { 50 SMBIOS_ENTRY_POINT_21, 51 SMBIOS_ENTRY_POINT_30 52 } smbios_entry_point_t; 53 54 /* 55 * SMBIOS Structure Table Entry Point. See DSP0134 5.2.1 for more information. 56 * The structure table entry point is located by searching for the anchor. 57 */ 58 #pragma pack(1) 59 60 typedef struct smbios_21_entry { 61 char smbe_eanchor[4]; /* anchor tag (SMB_ENTRY_EANCHOR) */ 62 uint8_t smbe_ecksum; /* checksum of entry point structure */ 63 uint8_t smbe_elen; /* length in bytes of entry point */ 64 uint8_t smbe_major; /* major version of the SMBIOS spec */ 65 uint8_t smbe_minor; /* minor version of the SMBIOS spec */ 66 uint16_t smbe_maxssize; /* maximum size in bytes of a struct */ 67 uint8_t smbe_revision; /* entry point structure revision */ 68 uint8_t smbe_format[5]; /* entry point revision-specific data */ 69 char smbe_ianchor[5]; /* intermed. tag (SMB_ENTRY_IANCHOR) */ 70 uint8_t smbe_icksum; /* intermed. checksum */ 71 uint16_t smbe_stlen; /* length in bytes of structure table */ 72 uint32_t smbe_staddr; /* physical addr of structure table */ 73 uint16_t smbe_stnum; /* number of structure table entries */ 74 uint8_t smbe_bcdrev; /* BCD value representing DMI version */ 75 } smbios_21_entry_t; 76 77 /* 78 * The 64-bit SMBIOS 3.0 Entry Point. See DSP0134 5.2.2 for more information. 79 * The structure table entry point is located by searching for the anchor. 80 */ 81 82 typedef struct smbios_30_entry { 83 char smbe_eanchor[5]; /* anchor tag (SMB3_ENTRY_EANCHOR) */ 84 uint8_t smbe_ecksum; /* checksum of entry point structure */ 85 uint8_t smbe_elen; /* length in bytes of entry point */ 86 uint8_t smbe_major; /* major version of the SMBIOS spec */ 87 uint8_t smbe_minor; /* minor version of the SMBIOS spec */ 88 uint8_t smbe_docrev; /* specification docrev */ 89 uint8_t smbe_revision; /* entry point structure revision */ 90 uint8_t smbe_reserved; 91 uint32_t smbe_stlen; /* length in bytes of structure table */ 92 uint64_t smbe_staddr; /* physical addr of structure table */ 93 } smbios_30_entry_t; 94 95 typedef union { 96 smbios_21_entry_t ep21; 97 smbios_30_entry_t ep30; 98 } smbios_entry_t; 99 100 #pragma pack() 101 102 #define SMB_ENTRY_EANCHOR "_SM_" /* structure table entry point anchor */ 103 #define SMB_ENTRY_EANCHORLEN 4 /* length of entry point anchor */ 104 #define SMB3_ENTRY_EANCHOR "_SM3_" /* structure table entry point anchor */ 105 #define SMB3_ENTRY_EANCHORLEN 5 /* length of entry point anchor */ 106 #define SMB_ENTRY_IANCHOR "_DMI_" /* intermediate anchor string */ 107 #define SMB_ENTRY_IANCHORLEN 5 /* length of intermediate anchor */ 108 #define SMB_ENTRY_MAXLEN 255 /* maximum length of entry point */ 109 110 /* 111 * Structure type codes. The comments next to each type include an (R) note to 112 * indicate a structure that is required as of SMBIOS v2.8 and an (O) note to 113 * indicate a structure that is obsolete as of SMBIOS v2.8. 114 */ 115 #define SMB_TYPE_BIOS 0 /* BIOS information (R) */ 116 #define SMB_TYPE_SYSTEM 1 /* system information (R) */ 117 #define SMB_TYPE_BASEBOARD 2 /* base board */ 118 #define SMB_TYPE_CHASSIS 3 /* system enclosure or chassis (R) */ 119 #define SMB_TYPE_PROCESSOR 4 /* processor (R) */ 120 #define SMB_TYPE_MEMCTL 5 /* memory controller (O) */ 121 #define SMB_TYPE_MEMMOD 6 /* memory module (O) */ 122 #define SMB_TYPE_CACHE 7 /* processor cache (R) */ 123 #define SMB_TYPE_PORT 8 /* port connector */ 124 #define SMB_TYPE_SLOT 9 /* upgradeable system slot (R) */ 125 #define SMB_TYPE_OBDEVS 10 /* on-board devices (O) */ 126 #define SMB_TYPE_OEMSTR 11 /* OEM string table */ 127 #define SMB_TYPE_SYSCONFSTR 12 /* system configuration string table */ 128 #define SMB_TYPE_LANG 13 /* BIOS language information */ 129 #define SMB_TYPE_GROUP 14 /* group associations */ 130 #define SMB_TYPE_EVENTLOG 15 /* system event log */ 131 #define SMB_TYPE_MEMARRAY 16 /* physical memory array (R) */ 132 #define SMB_TYPE_MEMDEVICE 17 /* memory device (R) */ 133 #define SMB_TYPE_MEMERR32 18 /* 32-bit memory error information */ 134 #define SMB_TYPE_MEMARRAYMAP 19 /* memory array mapped address (R) */ 135 #define SMB_TYPE_MEMDEVICEMAP 20 /* memory device mapped address */ 136 #define SMB_TYPE_POINTDEV 21 /* built-in pointing device */ 137 #define SMB_TYPE_BATTERY 22 /* portable battery */ 138 #define SMB_TYPE_RESET 23 /* system reset settings */ 139 #define SMB_TYPE_SECURITY 24 /* hardware security settings */ 140 #define SMB_TYPE_POWERCTL 25 /* system power controls */ 141 #define SMB_TYPE_VPROBE 26 /* voltage probe */ 142 #define SMB_TYPE_COOLDEV 27 /* cooling device */ 143 #define SMB_TYPE_TPROBE 28 /* temperature probe */ 144 #define SMB_TYPE_IPROBE 29 /* current probe */ 145 #define SMB_TYPE_OOBRA 30 /* out-of-band remote access facility */ 146 #define SMB_TYPE_BIS 31 /* boot integrity services */ 147 #define SMB_TYPE_BOOT 32 /* system boot status (R) */ 148 #define SMB_TYPE_MEMERR64 33 /* 64-bit memory error information */ 149 #define SMB_TYPE_MGMTDEV 34 /* management device */ 150 #define SMB_TYPE_MGMTDEVCP 35 /* management device component */ 151 #define SMB_TYPE_MGMTDEVDATA 36 /* management device threshold data */ 152 #define SMB_TYPE_MEMCHAN 37 /* memory channel */ 153 #define SMB_TYPE_IPMIDEV 38 /* IPMI device information */ 154 #define SMB_TYPE_POWERSUP 39 /* system power supply */ 155 #define SMB_TYPE_ADDINFO 40 /* additional information */ 156 #define SMB_TYPE_OBDEVEXT 41 /* on-board device extended info */ 157 #define SMB_TYPE_MCHI 42 /* mgmt controller host interface */ 158 #define SMB_TYPE_TPM 43 /* TPM device */ 159 #define SMB_TYPE_PROCESSOR_INFO 44 /* Processor Additional Information */ 160 #define SMB_TYPE_INACTIVE 126 /* inactive table entry */ 161 #define SMB_TYPE_EOT 127 /* end of table */ 162 163 #define SMB_TYPE_OEM_LO 128 /* start of OEM-specific type range */ 164 #define SUN_OEM_EXT_PROCESSOR 132 /* processor extended info */ 165 #define SUN_OEM_EXT_PORT 136 /* port exteded info */ 166 #define SUN_OEM_PCIEXRC 138 /* PCIE RootComplex/RootPort info */ 167 #define SUN_OEM_EXT_MEMARRAY 144 /* phys memory array extended info */ 168 #define SUN_OEM_EXT_MEMDEVICE 145 /* memory device extended info */ 169 #define SMB_TYPE_OEM_HI 256 /* end of OEM-specific type range */ 170 171 /* 172 * OEM string indicating "Platform Resource Management Specification" 173 * compliance. 174 */ 175 #define SMB_PRMS1 "SUNW-PRMS-1" 176 177 /* 178 * Some default values set by BIOS vendor 179 */ 180 #define SMB_DEFAULT1 "To Be Filled By O.E.M." 181 #define SMB_DEFAULT2 "Not Available" 182 #define SMB_DEFAULT3 "Default string" 183 184 /* 185 * SMBIOS Common Information. These structures do not correspond to anything 186 * in the SMBIOS specification, but allow library clients to more easily read 187 * information that is frequently encoded into the various SMBIOS structures. 188 */ 189 typedef struct smbios_info { 190 const char *smbi_manufacturer; /* manufacturer */ 191 const char *smbi_product; /* product name */ 192 const char *smbi_version; /* version */ 193 const char *smbi_serial; /* serial number */ 194 const char *smbi_asset; /* asset tag */ 195 const char *smbi_location; /* location tag */ 196 const char *smbi_part; /* part number */ 197 } smbios_info_t; 198 199 typedef struct smbios_version { 200 uint8_t smbv_major; /* version major number */ 201 uint8_t smbv_minor; /* version minor number */ 202 } smbios_version_t; 203 204 #define SMB_CONT_BYTE 1 /* contained elements are byte size */ 205 #define SMB_CONT_WORD 2 /* contained elements are word size */ 206 #define SMB_CONT_MAX 255 /* maximum contained objects */ 207 208 /* 209 * SMBIOS Bios Information. See DSP0134 Section 7.1 for more information. 210 * smbb_romsize is converted from the implementation format into bytes. Note, if 211 * we do not have an extended BIOS ROM size, it is filled in with the default 212 * BIOS ROM size. 213 */ 214 typedef struct smbios_bios { 215 const char *smbb_vendor; /* bios vendor string */ 216 const char *smbb_version; /* bios version string */ 217 const char *smbb_reldate; /* bios release date */ 218 uint32_t smbb_segment; /* bios address segment location */ 219 uint32_t smbb_romsize; /* bios rom size in bytes */ 220 uint32_t smbb_runsize; /* bios image size in bytes */ 221 uint64_t smbb_cflags; /* bios characteristics */ 222 const uint8_t *smbb_xcflags; /* bios characteristics extensions */ 223 size_t smbb_nxcflags; /* number of smbb_xcflags[] bytes */ 224 smbios_version_t smbb_biosv; /* bios version */ 225 smbios_version_t smbb_ecfwv; /* bios embedded ctrl f/w version */ 226 uint64_t smbb_extromsize; /* Extended bios ROM Size */ 227 } smbios_bios_t; 228 229 #define SMB_BIOSFL_RSV0 0x00000001 /* reserved bit zero */ 230 #define SMB_BIOSFL_RSV1 0x00000002 /* reserved bit one */ 231 #define SMB_BIOSFL_UNKNOWN 0x00000004 /* unknown */ 232 #define SMB_BIOSFL_BCNOTSUP 0x00000008 /* BIOS chars not supported */ 233 #define SMB_BIOSFL_ISA 0x00000010 /* ISA is supported */ 234 #define SMB_BIOSFL_MCA 0x00000020 /* MCA is supported */ 235 #define SMB_BIOSFL_EISA 0x00000040 /* EISA is supported */ 236 #define SMB_BIOSFL_PCI 0x00000080 /* PCI is supported */ 237 #define SMB_BIOSFL_PCMCIA 0x00000100 /* PCMCIA is supported */ 238 #define SMB_BIOSFL_PLUGNPLAY 0x00000200 /* Plug and Play is supported */ 239 #define SMB_BIOSFL_APM 0x00000400 /* APM is supported */ 240 #define SMB_BIOSFL_FLASH 0x00000800 /* BIOS is Flash Upgradeable */ 241 #define SMB_BIOSFL_SHADOW 0x00001000 /* BIOS shadowing is allowed */ 242 #define SMB_BIOSFL_VLVESA 0x00002000 /* VL-VESA is supported */ 243 #define SMB_BIOSFL_ESCD 0x00004000 /* ESCD support is available */ 244 #define SMB_BIOSFL_CDBOOT 0x00008000 /* Boot from CD is supported */ 245 #define SMB_BIOSFL_SELBOOT 0x00010000 /* Selectable Boot supported */ 246 #define SMB_BIOSFL_ROMSOCK 0x00020000 /* BIOS ROM is socketed */ 247 #define SMB_BIOSFL_PCMBOOT 0x00040000 /* Boot from PCMCIA supported */ 248 #define SMB_BIOSFL_EDD 0x00080000 /* EDD Spec is supported */ 249 #define SMB_BIOSFL_NEC9800 0x00100000 /* int 0x13 NEC 9800 floppy */ 250 #define SMB_BIOSFL_TOSHIBA 0x00200000 /* int 0x13 Toshiba floppy */ 251 #define SMB_BIOSFL_525_360K 0x00400000 /* int 0x13 5.25" 360K floppy */ 252 #define SMB_BIOSFL_525_12M 0x00800000 /* int 0x13 5.25" 1.2M floppy */ 253 #define SMB_BIOSFL_35_720K 0x01000000 /* int 0x13 3.5" 720K floppy */ 254 #define SMB_BIOSFL_35_288M 0x02000000 /* int 0x13 3.5" 2.88M floppy */ 255 #define SMB_BIOSFL_I5_PRINT 0x04000000 /* int 0x5 print screen svcs */ 256 #define SMB_BIOSFL_I9_KBD 0x08000000 /* int 0x9 8042 keyboard svcs */ 257 #define SMB_BIOSFL_I14_SER 0x10000000 /* int 0x14 serial svcs */ 258 #define SMB_BIOSFL_I17_PRINTER 0x20000000 /* int 0x17 printer svcs */ 259 #define SMB_BIOSFL_I10_CGA 0x40000000 /* int 0x10 CGA svcs */ 260 #define SMB_BIOSFL_NEC_PC98 0x80000000 /* NEC PC-98 */ 261 262 /* 263 * These values are used to allow consumers to have raw access to the extended 264 * characteristic flags. We explicitly don't include the extended BIOS 265 * information from section 3.1 as part of this as it has its own member. 266 */ 267 #define SMB_BIOSXB_1 0 /* bios extension byte 1 (7.1.2.1) */ 268 #define SMB_BIOSXB_2 1 /* bios extension byte 2 (7.1.2.2) */ 269 #define SMB_BIOSXB_BIOS_MAJ 2 /* bios major version */ 270 #define SMB_BIOSXB_BIOS_MIN 3 /* bios minor version */ 271 #define SMB_BIOSXB_ECFW_MAJ 4 /* extended ctlr f/w major version */ 272 #define SMB_BIOSXB_ECFW_MIN 5 /* extended ctlr f/w minor version */ 273 274 #define SMB_BIOSXB1_ACPI 0x01 /* ACPI is supported */ 275 #define SMB_BIOSXB1_USBL 0x02 /* USB legacy is supported */ 276 #define SMB_BIOSXB1_AGP 0x04 /* AGP is supported */ 277 #define SMB_BIOSXB1_I20 0x08 /* I2O boot is supported */ 278 #define SMB_BIOSXB1_LS120 0x10 /* LS-120 boot is supported */ 279 #define SMB_BIOSXB1_ATZIP 0x20 /* ATAPI ZIP drive boot is supported */ 280 #define SMB_BIOSXB1_1394 0x40 /* 1394 boot is supported */ 281 #define SMB_BIOSXB1_SMBAT 0x80 /* Smart Battery is supported */ 282 283 #define SMB_BIOSXB2_BBOOT 0x01 /* BIOS Boot Specification supported */ 284 #define SMB_BIOSXB2_FKNETSVC 0x02 /* F-key Network Svc boot supported */ 285 #define SMB_BIOSXB2_ETCDIST 0x04 /* Enable Targeted Content Distrib. */ 286 #define SMB_BIOSXB2_UEFI 0x08 /* UEFI Specification supported */ 287 #define SMB_BIOSXB2_VM 0x10 /* SMBIOS table describes a VM */ 288 289 /* 290 * SMBIOS System Information. See DSP0134 Section 7.2 for more information. 291 * The current set of smbs_wakeup values is defined after the structure. 292 */ 293 typedef struct smbios_system { 294 const uint8_t *smbs_uuid; /* UUID byte array */ 295 uint8_t smbs_uuidlen; /* UUID byte array length */ 296 uint8_t smbs_wakeup; /* wake-up event */ 297 const char *smbs_sku; /* SKU number */ 298 const char *smbs_family; /* family */ 299 } smbios_system_t; 300 301 #define SMB_WAKEUP_RSV0 0x00 /* reserved */ 302 #define SMB_WAKEUP_OTHER 0x01 /* other */ 303 #define SMB_WAKEUP_UNKNOWN 0x02 /* unknown */ 304 #define SMB_WAKEUP_APM 0x03 /* APM timer */ 305 #define SMB_WAKEUP_MODEM 0x04 /* modem ring */ 306 #define SMB_WAKEUP_LAN 0x05 /* LAN remote */ 307 #define SMB_WAKEUP_SWITCH 0x06 /* power switch */ 308 #define SMB_WAKEUP_PCIPME 0x07 /* PCI PME# */ 309 #define SMB_WAKEUP_AC 0x08 /* AC power restored */ 310 311 /* 312 * SMBIOS Base Board description. See DSP0134 Section 7.3 for more 313 * information. smbb_flags and smbb_type definitions are below. 314 */ 315 typedef struct smbios_bboard { 316 id_t smbb_chassis; /* chassis containing this board */ 317 uint8_t smbb_flags; /* flags (see below) */ 318 uint8_t smbb_type; /* board type (see below) */ 319 uint8_t smbb_contn; /* number of contained object hdls */ 320 } smbios_bboard_t; 321 322 #define SMB_BBFL_MOTHERBOARD 0x01 /* board is a motherboard */ 323 #define SMB_BBFL_NEEDAUX 0x02 /* auxiliary card or daughter req'd */ 324 #define SMB_BBFL_REMOVABLE 0x04 /* board is removable */ 325 #define SMB_BBFL_REPLACABLE 0x08 /* board is field-replacable */ 326 #define SMB_BBFL_HOTSWAP 0x10 /* board is hot-swappable */ 327 328 #define SMB_BBT_UNKNOWN 0x1 /* unknown */ 329 #define SMB_BBT_OTHER 0x2 /* other */ 330 #define SMB_BBT_SBLADE 0x3 /* server blade */ 331 #define SMB_BBT_CSWITCH 0x4 /* connectivity switch */ 332 #define SMB_BBT_SMM 0x5 /* system management module */ 333 #define SMB_BBT_PROC 0x6 /* processor module */ 334 #define SMB_BBT_IO 0x7 /* i/o module */ 335 #define SMB_BBT_MEM 0x8 /* memory module */ 336 #define SMB_BBT_DAUGHTER 0x9 /* daughterboard */ 337 #define SMB_BBT_MOTHER 0xA /* motherboard */ 338 #define SMB_BBT_PROCMEM 0xB /* processor/memory module */ 339 #define SMB_BBT_PROCIO 0xC /* processor/i/o module */ 340 #define SMB_BBT_INTER 0xD /* interconnect board */ 341 342 /* 343 * SMBIOS Chassis description. See DSP0134 Section 7.4 for more information. 344 * We move the lock bit of the type field into smbc_lock for easier processing. 345 */ 346 typedef struct smbios_chassis { 347 uint32_t smbc_oemdata; /* OEM-specific data */ 348 uint8_t smbc_lock; /* lock present? */ 349 uint8_t smbc_type; /* type */ 350 uint8_t smbc_bustate; /* boot-up state */ 351 uint8_t smbc_psstate; /* power supply state */ 352 uint8_t smbc_thstate; /* thermal state */ 353 uint8_t smbc_security; /* security status */ 354 uint8_t smbc_uheight; /* enclosure height in U's */ 355 uint8_t smbc_cords; /* number of power cords */ 356 uint8_t smbc_elems; /* number of element records (n) */ 357 uint8_t smbc_elemlen; /* length of contained element (m) */ 358 char smbc_sku[256]; /* SKU number (as a string) */ 359 } smbios_chassis_t; 360 361 #define SMB_CHT_OTHER 0x01 /* other */ 362 #define SMB_CHT_UNKNOWN 0x02 /* unknown */ 363 #define SMB_CHT_DESKTOP 0x03 /* desktop */ 364 #define SMB_CHT_LPDESKTOP 0x04 /* low-profile desktop */ 365 #define SMB_CHT_PIZZA 0x05 /* pizza box */ 366 #define SMB_CHT_MINITOWER 0x06 /* mini-tower */ 367 #define SMB_CHT_TOWER 0x07 /* tower */ 368 #define SMB_CHT_PORTABLE 0x08 /* portable */ 369 #define SMB_CHT_LAPTOP 0x09 /* laptop */ 370 #define SMB_CHT_NOTEBOOK 0x0A /* notebook */ 371 #define SMB_CHT_HANDHELD 0x0B /* hand-held */ 372 #define SMB_CHT_DOCK 0x0C /* docking station */ 373 #define SMB_CHT_ALLIN1 0x0D /* all-in-one */ 374 #define SMB_CHT_SUBNOTE 0x0E /* sub-notebook */ 375 #define SMB_CHT_SPACESAVE 0x0F /* space-saving */ 376 #define SMB_CHT_LUNCHBOX 0x10 /* lunchbox */ 377 #define SMB_CHT_MAIN 0x11 /* main server chassis */ 378 #define SMB_CHT_EXPANSION 0x12 /* expansion chassis */ 379 #define SMB_CHT_SUB 0x13 /* sub-chassis */ 380 #define SMB_CHT_BUS 0x14 /* bus expansion chassis */ 381 #define SMB_CHT_PERIPHERAL 0x15 /* peripheral chassis */ 382 #define SMB_CHT_RAID 0x16 /* raid chassis */ 383 #define SMB_CHT_RACK 0x17 /* rack mount chassis */ 384 #define SMB_CHT_SEALED 0x18 /* sealed case pc */ 385 #define SMB_CHT_MULTI 0x19 /* multi-system chassis */ 386 #define SMB_CHT_CPCI 0x1A /* compact PCI */ 387 #define SMB_CHT_ATCA 0x1B /* advanced TCA */ 388 #define SMB_CHT_BLADE 0x1C /* blade */ 389 #define SMB_CHT_BLADEENC 0x1D /* blade enclosure */ 390 #define SMB_CHT_TABLET 0x1E /* tablet */ 391 #define SMB_CHT_CONVERTIBLE 0x1F /* convertible */ 392 #define SMB_CHT_DETACHABLE 0x20 /* detachable */ 393 #define SMB_CHT_IOTGW 0x21 /* IoT Gateway */ 394 #define SMB_CHT_EMBEDPC 0x22 /* Embedded PC */ 395 #define SMB_CHT_MINIPC 0x23 /* Mini PC */ 396 #define SMB_CHT_STICKPC 0x24 /* Stick PC */ 397 398 #define SMB_CHST_OTHER 0x01 /* other */ 399 #define SMB_CHST_UNKNOWN 0x02 /* unknown */ 400 #define SMB_CHST_SAFE 0x03 /* safe */ 401 #define SMB_CHST_WARNING 0x04 /* warning */ 402 #define SMB_CHST_CRITICAL 0x05 /* critical */ 403 #define SMB_CHST_NONREC 0x06 /* non-recoverable */ 404 405 #define SMB_CHSC_OTHER 0x01 /* other */ 406 #define SMB_CHSC_UNKNOWN 0x02 /* unknown */ 407 #define SMB_CHSC_NONE 0x03 /* none */ 408 #define SMB_CHSC_EILOCK 0x04 /* external interface locked out */ 409 #define SMB_CHSC_EIENAB 0x05 /* external interface enabled */ 410 411 /* 412 * SMBIOS Processor description. See DSP0134 Section 7.5 for more details. 413 * If the L1, L2, or L3 cache handle is -1, the cache information is unknown. 414 * If the handle refers to something of size 0, that type of cache is absent. 415 * 416 * NOTE: Although SMBIOS exports a 64-bit CPUID result, this value should not 417 * be used for any purpose other than BIOS debugging. illumos itself computes 418 * its own CPUID value and applies knowledge of additional errata and processor 419 * specific CPUID variations, so this value should not be used for anything. 420 */ 421 typedef struct smbios_processor { 422 uint64_t smbp_cpuid; /* processor cpuid information */ 423 uint32_t smbp_family; /* processor family */ 424 uint8_t smbp_type; /* processor type (SMB_PRT_*) */ 425 uint8_t smbp_voltage; /* voltage (SMB_PRV_*) */ 426 uint8_t smbp_status; /* status (SMB_PRS_*) */ 427 uint8_t smbp_upgrade; /* upgrade (SMB_PRU_*) */ 428 uint32_t smbp_clkspeed; /* external clock speed in MHz */ 429 uint32_t smbp_maxspeed; /* maximum speed in MHz */ 430 uint32_t smbp_curspeed; /* current speed in MHz */ 431 id_t smbp_l1cache; /* L1 cache handle */ 432 id_t smbp_l2cache; /* L2 cache handle */ 433 id_t smbp_l3cache; /* L3 cache handle */ 434 uint32_t smbp_corecount; 435 /* number of cores per processor socket */ 436 uint32_t smbp_coresenabled; 437 /* number of enabled cores per processor socket */ 438 uint32_t smbp_threadcount; 439 /* number of threads per processor socket */ 440 uint16_t smbp_cflags; 441 /* processor characteristics (SMB_PRC_*) */ 442 } smbios_processor_t; 443 444 #define SMB_PRT_OTHER 0x01 /* other */ 445 #define SMB_PRT_UNKNOWN 0x02 /* unknown */ 446 #define SMB_PRT_CENTRAL 0x03 /* central processor */ 447 #define SMB_PRT_MATH 0x04 /* math processor */ 448 #define SMB_PRT_DSP 0x05 /* DSP processor */ 449 #define SMB_PRT_VIDEO 0x06 /* video processor */ 450 451 #define SMB_PRV_LEGACY(v) (!((v) & 0x80)) /* legacy voltage mode */ 452 #define SMB_PRV_FIXED(v) ((v) & 0x80) /* fixed voltage mode */ 453 454 #define SMB_PRV_5V 0x01 /* 5V is supported */ 455 #define SMB_PRV_33V 0x02 /* 3.3V is supported */ 456 #define SMB_PRV_29V 0x04 /* 2.9V is supported */ 457 458 #define SMB_PRV_VOLTAGE(v) ((v) & 0x7f) 459 460 #define SMB_PRSTATUS_PRESENT(s) ((s) & 0x40) /* socket is populated */ 461 #define SMB_PRSTATUS_STATUS(s) ((s) & 0x07) /* status (see below) */ 462 463 #define SMB_PRS_UNKNOWN 0x0 /* unknown */ 464 #define SMB_PRS_ENABLED 0x1 /* enabled */ 465 #define SMB_PRS_BDISABLED 0x2 /* disabled in bios user setup */ 466 #define SMB_PRS_PDISABLED 0x3 /* disabled in bios from post error */ 467 #define SMB_PRS_IDLE 0x4 /* waiting to be enabled */ 468 #define SMB_PRS_OTHER 0x7 /* other */ 469 470 #define SMB_PRU_OTHER 0x01 /* other */ 471 #define SMB_PRU_UNKNOWN 0x02 /* unknown */ 472 #define SMB_PRU_DAUGHTER 0x03 /* daughter board */ 473 #define SMB_PRU_ZIF 0x04 /* ZIF socket */ 474 #define SMB_PRU_PIGGY 0x05 /* replaceable piggy back */ 475 #define SMB_PRU_NONE 0x06 /* none */ 476 #define SMB_PRU_LIF 0x07 /* LIF socket */ 477 #define SMB_PRU_SLOT1 0x08 /* slot 1 */ 478 #define SMB_PRU_SLOT2 0x09 /* slot 2 */ 479 #define SMB_PRU_370PIN 0x0A /* 370-pin socket */ 480 #define SMB_PRU_SLOTA 0x0B /* slot A */ 481 #define SMB_PRU_SLOTM 0x0C /* slot M */ 482 #define SMB_PRU_423 0x0D /* socket 423 */ 483 #define SMB_PRU_A 0x0E /* socket A (socket 462) */ 484 #define SMB_PRU_478 0x0F /* socket 478 */ 485 #define SMB_PRU_754 0x10 /* socket 754 */ 486 #define SMB_PRU_940 0x11 /* socket 940 */ 487 #define SMB_PRU_939 0x12 /* socket 939 */ 488 #define SMB_PRU_MPGA604 0x13 /* mPGA604 */ 489 #define SMB_PRU_LGA771 0x14 /* LGA771 */ 490 #define SMB_PRU_LGA775 0x15 /* LGA775 */ 491 #define SMB_PRU_S1 0x16 /* socket S1 */ 492 #define SMB_PRU_AM2 0x17 /* socket AM2 */ 493 #define SMB_PRU_F 0x18 /* socket F */ 494 #define SMB_PRU_LGA1366 0x19 /* LGA1366 */ 495 #define SMB_PRU_G34 0x1A /* socket G34 */ 496 #define SMB_PRU_AM3 0x1B /* socket AM3 */ 497 #define SMB_PRU_C32 0x1C /* socket C32 */ 498 #define SMB_PRU_LGA1156 0x1D /* LGA1156 */ 499 #define SMB_PRU_LGA1567 0x1E /* LGA1567 */ 500 #define SMB_PRU_PGA988A 0x1F /* PGA988A */ 501 #define SMB_PRU_BGA1288 0x20 /* BGA1288 */ 502 #define SMB_PRU_RPGA988B 0x21 /* rPGA988B */ 503 #define SMB_PRU_BGA1023 0x22 /* BGA1023 */ 504 #define SMB_PRU_BGA1224 0x23 /* BGA1224 */ 505 #define SMB_PRU_LGA1155 0x24 /* LGA1155 */ 506 #define SMB_PRU_LGA1356 0x25 /* LGA1356 */ 507 #define SMB_PRU_LGA2011 0x26 /* LGA2011 */ 508 #define SMB_PRU_FS1 0x27 /* socket FS1 */ 509 #define SMB_PRU_FS2 0x28 /* socket FS2 */ 510 #define SMB_PRU_FM1 0x29 /* socket FM1 */ 511 #define SMB_PRU_FM2 0x2A /* socket FM2 */ 512 #define SMB_PRU_LGA20113 0x2B /* LGA2011-3 */ 513 #define SMB_PRU_LGA13563 0x2C /* LGA1356-3 */ 514 #define SMB_PRU_LGA1150 0x2D /* LGA1150 */ 515 #define SMB_PRU_BGA1168 0x2E /* BGA1168 */ 516 #define SMB_PRU_BGA1234 0x2F /* BGA1234 */ 517 #define SMB_PRU_BGA1364 0x30 /* BGA1364 */ 518 #define SMB_PRU_AM4 0x31 /* socket AM4 */ 519 #define SMB_PRU_LGA1151 0x32 /* LGA1151 */ 520 #define SMB_PRU_BGA1356 0x33 /* BGA1356 */ 521 #define SMB_PRU_BGA1440 0x34 /* BGA1440 */ 522 #define SMB_PRU_BGA1515 0x35 /* BGA1515 */ 523 #define SMB_PRU_LGA36471 0x36 /* LGA3647-1 */ 524 #define SMB_PRU_SP3 0x37 /* socket SP3 */ 525 #define SMB_PRU_SP3r2 0x38 /* socket SP3r2 */ 526 #define SMB_PRU_LGA2066 0x39 /* Socket LGA2066 */ 527 #define SMB_PRU_BGA1392 0x3A /* Socket BGA1392 */ 528 #define SMB_PRU_BGA1510 0x3B /* Socket BGA1510 */ 529 #define SMB_PRU_BGA1528 0x3C /* Socket BGA1528 */ 530 531 #define SMB_PRC_RESERVED 0x0001 /* reserved */ 532 #define SMB_PRC_UNKNOWN 0x0002 /* unknown */ 533 #define SMB_PRC_64BIT 0x0004 /* 64-bit capable */ 534 #define SMB_PRC_MC 0x0008 /* multi-core */ 535 #define SMB_PRC_HT 0x0010 /* hardware thread */ 536 #define SMB_PRC_NX 0x0020 /* execution protection */ 537 #define SMB_PRC_VT 0x0040 /* enhanced virtualization */ 538 #define SMB_PRC_PM 0x0080 /* power/performance control */ 539 #define SMB_PRC_128BIT 0x0100 /* 128-bit capable */ 540 541 #define SMB_PRF_OTHER 0x01 /* other */ 542 #define SMB_PRF_UNKNOWN 0x02 /* unknown */ 543 #define SMB_PRF_8086 0x03 /* 8086 */ 544 #define SMB_PRF_80286 0x04 /* 80286 */ 545 #define SMB_PRF_I386 0x05 /* Intel 386 */ 546 #define SMB_PRF_I486 0x06 /* Intel 486 */ 547 #define SMB_PRF_8087 0x07 /* 8087 */ 548 #define SMB_PRF_80287 0x08 /* 80287 */ 549 #define SMB_PRF_80387 0x09 /* 80387 */ 550 #define SMB_PRF_80487 0x0A /* 80487 */ 551 #define SMB_PRF_PENTIUM 0x0B /* Pentium Family */ 552 #define SMB_PRF_PENTIUMPRO 0x0C /* Pentium Pro */ 553 #define SMB_PRF_PENTIUMII 0x0D /* Pentium II */ 554 #define SMB_PRF_PENTIUM_MMX 0x0E /* Pentium w/ MMX */ 555 #define SMB_PRF_CELERON 0x0F /* Celeron */ 556 #define SMB_PRF_PENTIUMII_XEON 0x10 /* Pentium II Xeon */ 557 #define SMB_PRF_PENTIUMIII 0x11 /* Pentium III */ 558 #define SMB_PRF_M1 0x12 /* M1 */ 559 #define SMB_PRF_M2 0x13 /* M2 */ 560 #define SMB_PRF_CELERON_M 0x14 /* Celeron M */ 561 #define SMB_PRF_PENTIUMIV_HT 0x15 /* Pentium 4 HT */ 562 #define SMB_PRF_DURON 0x18 /* AMD Duron */ 563 #define SMB_PRF_K5 0x19 /* K5 */ 564 #define SMB_PRF_K6 0x1A /* K6 */ 565 #define SMB_PRF_K6_2 0x1B /* K6-2 */ 566 #define SMB_PRF_K6_3 0x1C /* K6-3 */ 567 #define SMB_PRF_ATHLON 0x1D /* Athlon */ 568 #define SMB_PRF_2900 0x1E /* AMD 2900 */ 569 #define SMB_PRF_K6_2PLUS 0x1F /* K6-2+ */ 570 #define SMB_PRF_PPC 0x20 /* PowerPC */ 571 #define SMB_PRF_PPC_601 0x21 /* PowerPC 601 */ 572 #define SMB_PRF_PPC_603 0x22 /* PowerPC 603 */ 573 #define SMB_PRF_PPC_603PLUS 0x23 /* PowerPC 603+ */ 574 #define SMB_PRF_PPC_604 0x24 /* PowerPC 604 */ 575 #define SMB_PRF_PPC_620 0x25 /* PowerPC 620 */ 576 #define SMB_PRF_PPC_704 0x26 /* PowerPC x704 */ 577 #define SMB_PRF_PPC_750 0x27 /* PowerPC 750 */ 578 #define SMB_PRF_CORE_DUO 0x28 /* Core Duo */ 579 #define SMB_PRF_CORE_DUO_M 0x29 /* Core Duo mobile */ 580 #define SMB_PRF_CORE_SOLO_M 0x2A /* Core Solo mobile */ 581 #define SMB_PRF_ATOM 0x2B /* Intel Atom */ 582 #define SMB_PRF_CORE_M 0x2C /* Intel Core M */ 583 #define SMB_PRF_CORE_M3 0x2D /* Intel Core m3 */ 584 #define SMB_PRF_CORE_M5 0x2E /* Intel Core m5 */ 585 #define SMB_PRF_CORE_M7 0x2F /* Intel Core m7 */ 586 #define SMB_PRF_ALPHA 0x30 /* Alpha */ 587 #define SMB_PRF_ALPHA_21064 0x31 /* Alpha 21064 */ 588 #define SMB_PRF_ALPHA_21066 0x32 /* Alpha 21066 */ 589 #define SMB_PRF_ALPHA_21164 0x33 /* Alpha 21164 */ 590 #define SMB_PRF_ALPHA_21164PC 0x34 /* Alpha 21164PC */ 591 #define SMB_PRF_ALPHA_21164A 0x35 /* Alpha 21164a */ 592 #define SMB_PRF_ALPHA_21264 0x36 /* Alpha 21264 */ 593 #define SMB_PRF_ALPHA_21364 0x37 /* Alpha 21364 */ 594 #define SMB_PRF_TURION2U_2C_MM 0x38 595 /* AMD Turion II Ultra Dual-Core Mobile M */ 596 #define SMB_PRF_TURION2_2C_MM 0x39 /* AMD Turion II Dual-Core Mobile M */ 597 #define SMB_PRF_ATHLON2_2C_M 0x3A /* AMD Athlon II Dual-Core M */ 598 #define SMB_PRF_OPTERON_6100 0x3B /* AMD Opteron 6100 series */ 599 #define SMB_PRF_OPTERON_4100 0x3C /* AMD Opteron 4100 series */ 600 #define SMB_PRF_OPTERON_6200 0x3D /* AMD Opteron 6200 series */ 601 #define SMB_PRF_OPTERON_4200 0x3E /* AMD Opteron 4200 series */ 602 #define SMB_PRF_AMD_FX 0x3F /* AMD FX series */ 603 #define SMB_PRF_MIPS 0x40 /* MIPS */ 604 #define SMB_PRF_MIPS_R4000 0x41 /* MIPS R4000 */ 605 #define SMB_PRF_MIPS_R4200 0x42 /* MIPS R4200 */ 606 #define SMB_PRF_MIPS_R4400 0x43 /* MIPS R4400 */ 607 #define SMB_PRF_MIPS_R4600 0x44 /* MIPS R4600 */ 608 #define SMB_PRF_MIPS_R10000 0x45 /* MIPS R10000 */ 609 #define SMB_PRF_AMD_C 0x46 /* AMD C-series */ 610 #define SMB_PRF_AMD_E 0x47 /* AMD E-series */ 611 #define SMB_PRF_AMD_A 0x48 /* AMD A-series */ 612 #define SMB_PRF_AMD_G 0x49 /* AMD G-series */ 613 #define SMB_PRF_AMD_Z 0x4A /* AMD Z-series */ 614 #define SMB_PRF_AMD_R 0x4B /* AMD R-series */ 615 #define SMB_PRF_OPTERON_4300 0x4C /* AMD Opteron 4300 series */ 616 #define SMB_PRF_OPTERON_6300 0x4D /* AMD Opteron 6300 series */ 617 #define SMB_PRF_OPTERON_3300 0x4E /* AMD Opteron 3300 series */ 618 #define SMB_PRF_AMD_FIREPRO 0x4F /* AMD FirePro series */ 619 #define SMB_PRF_SPARC 0x50 /* SPARC */ 620 #define SMB_PRF_SUPERSPARC 0x51 /* SuperSPARC */ 621 #define SMB_PRF_MICROSPARCII 0x52 /* microSPARC II */ 622 #define SMB_PRF_MICROSPARCIIep 0x53 /* microSPARC IIep */ 623 #define SMB_PRF_ULTRASPARC 0x54 /* UltraSPARC */ 624 #define SMB_PRF_USII 0x55 /* UltraSPARC II */ 625 #define SMB_PRF_USIIi 0x56 /* UltraSPARC IIi */ 626 #define SMB_PRF_USIII 0x57 /* UltraSPARC III */ 627 #define SMB_PRF_USIIIi 0x58 /* UltraSPARC IIIi */ 628 #define SMB_PRF_68040 0x60 /* 68040 */ 629 #define SMB_PRF_68XXX 0x61 /* 68XXX */ 630 #define SMB_PRF_68000 0x62 /* 68000 */ 631 #define SMB_PRF_68010 0x63 /* 68010 */ 632 #define SMB_PRF_68020 0x64 /* 68020 */ 633 #define SMB_PRF_68030 0x65 /* 68030 */ 634 #define SMB_PRF_ATHLON_X4 0x66 /* AMD Athlon X4 Quad-Core */ 635 #define SMB_PRF_OPTERON_X1K 0x67 /* AMD Opteron X1000 */ 636 #define SMB_PRF_OPTERON_X2K 0x68 /* AMD Opteron X2000 APU */ 637 #define SMB_PRF_OPTERON_A 0x69 /* AMD Opteron A Series */ 638 #define SMB_PRF_OPTERON_X3K 0x6A /* AMD Opteron X3000 APU */ 639 #define SMB_PRF_ZEN 0x6B /* AMD Zen Processor Family */ 640 #define SMB_PRF_HOBBIT 0x70 /* Hobbit */ 641 #define SMB_PRF_TM5000 0x78 /* Crusoe TM5000 */ 642 #define SMB_PRF_TM3000 0x79 /* Crusoe TM3000 */ 643 #define SMB_PRF_TM8000 0x7A /* Efficeon TM8000 */ 644 #define SMB_PRF_WEITEK 0x80 /* Weitek */ 645 #define SMB_PRF_ITANIC 0x82 /* Itanium */ 646 #define SMB_PRF_ATHLON64 0x83 /* Athlon64 */ 647 #define SMB_PRF_OPTERON 0x84 /* Opteron */ 648 #define SMB_PRF_SEMPRON 0x85 /* Sempron */ 649 #define SMB_PRF_TURION64_M 0x86 /* Turion 64 Mobile */ 650 #define SMB_PRF_OPTERON_2C 0x87 /* AMD Opteron Dual-Core */ 651 #define SMB_PRF_ATHLON64_X2_2C 0x88 /* AMD Athlon 64 X2 Dual-Core */ 652 #define SMB_PRF_TURION64_X2_M 0x89 /* AMD Turion 64 X2 Mobile */ 653 #define SMB_PRF_OPTERON_4C 0x8A /* AMD Opteron Quad-Core */ 654 #define SMB_PRF_OPTERON_3G 0x8B /* AMD Opteron 3rd Generation */ 655 #define SMB_PRF_PHENOM_FX_4C 0x8C /* AMD Phenom FX Quad-Core */ 656 #define SMB_PRF_PHENOM_X4_4C 0x8D /* AMD Phenom X4 Quad-Core */ 657 #define SMB_PRF_PHENOM_X2_2C 0x8E /* AMD Phenom X2 Dual-Core */ 658 #define SMB_PRF_ATHLON_X2_2C 0x8F /* AMD Athlon X2 Dual-Core */ 659 #define SMB_PRF_PA 0x90 /* PA-RISC */ 660 #define SMB_PRF_PA8500 0x91 /* PA-RISC 8500 */ 661 #define SMB_PRF_PA8000 0x92 /* PA-RISC 8000 */ 662 #define SMB_PRF_PA7300LC 0x93 /* PA-RISC 7300LC */ 663 #define SMB_PRF_PA7200 0x94 /* PA-RISC 7200 */ 664 #define SMB_PRF_PA7100LC 0x95 /* PA-RISC 7100LC */ 665 #define SMB_PRF_PA7100 0x96 /* PA-RISC 7100 */ 666 #define SMB_PRF_V30 0xA0 /* V30 */ 667 #define SMB_PRF_XEON_4C_3200 0xA1 /* Xeon Quad Core 3200 */ 668 #define SMB_PRF_XEON_2C_3000 0xA2 /* Xeon Dual Core 3000 */ 669 #define SMB_PRF_XEON_4C_5300 0xA3 /* Xeon Quad Core 5300 */ 670 #define SMB_PRF_XEON_2C_5100 0xA4 /* Xeon Dual Core 5100 */ 671 #define SMB_PRF_XEON_2C_5000 0xA5 /* Xeon Dual Core 5000 */ 672 #define SMB_PRF_XEON_2C_LV 0xA6 /* Xeon Dual Core LV */ 673 #define SMB_PRF_XEON_2C_ULV 0xA7 /* Xeon Dual Core ULV */ 674 #define SMB_PRF_XEON_2C_7100 0xA8 /* Xeon Dual Core 7100 */ 675 #define SMB_PRF_XEON_4C_5400 0xA9 /* Xeon Quad Core 5400 */ 676 #define SMB_PRF_XEON_4C 0xAA /* Xeon Quad Core */ 677 #define SMB_PRF_XEON_2C_5200 0xAB /* Xeon Dual Core 5200 */ 678 #define SMB_PRF_XEON_2C_7200 0xAC /* Xeon Dual Core 7200 */ 679 #define SMB_PRF_XEON_4C_7300 0xAD /* Xeon Quad Core 7300 */ 680 #define SMB_PRF_XEON_4C_7400 0xAE /* Xeon Quad Core 7400 */ 681 #define SMB_PRF_XEON_XC_7400 0xAF /* Xeon Multi Core 7400 */ 682 #define SMB_PRF_PENTIUMIII_XEON 0xB0 /* Pentium III Xeon */ 683 #define SMB_PRF_PENTIUMIII_SS 0xB1 /* Pentium III with SpeedStep */ 684 #define SMB_PRF_P4 0xB2 /* Pentium 4 */ 685 #define SMB_PRF_XEON 0xB3 /* Intel Xeon */ 686 #define SMB_PRF_AS400 0xB4 /* AS400 */ 687 #define SMB_PRF_XEON_MP 0xB5 /* Intel Xeon MP */ 688 #define SMB_PRF_ATHLON_XP 0xB6 /* AMD Athlon XP */ 689 #define SMB_PRF_ATHLON_MP 0xB7 /* AMD Athlon MP */ 690 #define SMB_PRF_ITANIC2 0xB8 /* Itanium 2 */ 691 #define SMB_PRF_PENTIUM_M 0xB9 /* Pentium M */ 692 #define SMB_PRF_CELERON_D 0xBA /* Celeron D */ 693 #define SMB_PRF_PENTIUM_D 0xBB /* Pentium D */ 694 #define SMB_PRF_PENTIUM_EE 0xBC /* Pentium Extreme Edition */ 695 #define SMB_PRF_CORE_SOLO 0xBD /* Intel Core Solo */ 696 #define SMB_PRF_CORE2_DUO 0xBF /* Intel Core 2 Duo */ 697 #define SMB_PRF_CORE2_SOLO 0xC0 /* Intel Core 2 Solo */ 698 #define SMB_PRF_CORE2_EX 0xC1 /* Intel Core 2 Extreme */ 699 #define SMB_PRF_CORE2_QUAD 0xC2 /* Intel Core 2 Quad */ 700 #define SMB_PRF_CORE2_EX_M 0xC3 /* Intel Core 2 Extreme mobile */ 701 #define SMB_PRF_CORE2_DUO_M 0xC4 /* Intel Core 2 Duo mobile */ 702 #define SMB_PRF_CORE2_SOLO_M 0xC5 /* Intel Core 2 Solo mobile */ 703 #define SMB_PRF_CORE_I7 0xC6 /* Intel Core i7 */ 704 #define SMB_PRF_CELERON_2C 0xC7 /* Celeron Dual-Core */ 705 #define SMB_PRF_IBM390 0xC8 /* IBM 390 */ 706 #define SMB_PRF_G4 0xC9 /* G4 */ 707 #define SMB_PRF_G5 0xCA /* G5 */ 708 #define SMB_PRF_ESA390 0xCB /* ESA390 */ 709 #define SMB_PRF_ZARCH 0xCC /* z/Architecture */ 710 #define SMB_PRF_CORE_I5 0xCD /* Intel Core i5 */ 711 #define SMB_PRF_CORE_I3 0xCE /* Intel Core i3 */ 712 #define SMB_PRF_CORE_I9 0xCF /* Intel Core i9 */ 713 #define SMB_PRF_C7M 0xD2 /* VIA C7-M */ 714 #define SMB_PRF_C7D 0xD3 /* VIA C7-D */ 715 #define SMB_PRF_C7 0xD4 /* VIA C7 */ 716 #define SMB_PRF_EDEN 0xD5 /* VIA Eden */ 717 #define SMB_PRF_XEON_XC 0xD6 /* Intel Xeon Multi-Core */ 718 #define SMB_PRF_XEON_2C_3XXX 0xD7 /* Intel Xeon Dual-Core 3xxx */ 719 #define SMB_PRF_XEON_4C_3XXX 0xD8 /* Intel Xeon Quad-Core 3xxx */ 720 #define SMB_PRF_VIA_NANO 0xD9 /* VIA Nano */ 721 #define SMB_PRF_XEON_2C_5XXX 0xDA /* Intel Xeon Dual-Core 5xxx */ 722 #define SMB_PRF_XEON_4C_5XXX 0xDB /* Intel Xeon Quad-Core 5xxx */ 723 #define SMB_PRF_XEON_2C_7XXX 0xDD /* Intel Xeon Dual-Core 7xxx */ 724 #define SMB_PRF_XEON_4C_7XXX 0xDE /* Intel Xeon Quad-Core 7xxx */ 725 #define SMB_PRF_XEON_XC_7XXX 0xDF /* Intel Xeon Multi-Core 7xxx */ 726 #define SMB_PRF_XEON_XC_3400 0xE0 /* Intel Xeon Multi-Core 3400 */ 727 #define SMB_PRF_OPTERON_3000 0xE4 /* AMD Opteron 3000 */ 728 #define SMB_PRF_SEMPRON_II 0xE5 /* AMD Sempron II */ 729 #define SMB_PRF_OPTERON_4C_EM 0xE6 /* AMD Opteron Quad-Core embedded */ 730 #define SMB_PRF_PHENOM_3C 0xE7 /* AMD Phenom Triple-Core */ 731 #define SMB_PRF_TURIONU_2C_M 0xE8 /* AMD Turion Ultra Dual-Core mobile */ 732 #define SMB_PRF_TURION_2C_M 0xE9 /* AMD Turion Dual-Core mobile */ 733 #define SMB_PRF_ATHLON_2C 0xEA /* AMD Athlon Dual-Core */ 734 #define SMB_PRF_SEMPRON_SI 0xEB /* AMD Sempron SI */ 735 #define SMB_PRF_PHENOM_II 0xEC /* AMD Phenom II */ 736 #define SMB_PRF_ATHLON_II 0xED /* AMD Athlon II */ 737 #define SMB_PRF_OPTERON_6C 0xEE /* AMD Opteron Six-Core */ 738 #define SMB_PRF_SEMPRON_M 0xEF /* AMD Sempron M */ 739 #define SMB_PRF_I860 0xFA /* i860 */ 740 #define SMB_PRF_I960 0xFB /* i960 */ 741 #define SMB_PRF_ARMv7 0x100 /* ARMv7 */ 742 #define SMB_PRF_ARMv8 0x101 /* ARMv8 */ 743 #define SMB_PRF_SH3 0x104 /* SH-3 */ 744 #define SMB_PRF_SH4 0x105 /* SH-4 */ 745 #define SMB_PRF_ARM 0x118 /* ARM */ 746 #define SMB_PRF_SARM 0x119 /* StrongARM */ 747 #define SMB_PRF_6X86 0x12C /* 6x86 */ 748 #define SMB_PRF_MEDIAGX 0x12D /* MediaGX */ 749 #define SMB_PRF_MII 0x12E /* MII */ 750 #define SMB_PRF_WINCHIP 0x140 /* WinChip */ 751 #define SMB_PRF_DSP 0x15E /* DSP */ 752 #define SMB_PRF_VIDEO 0x1F4 /* Video Processor */ 753 #define SMB_PRF_RV32 0x200 /* RISC-V RV32 */ 754 #define SMB_PRF_RV64 0x201 /* RISC-V RV64 */ 755 #define SMB_PRF_RV128 0x202 /* RISC-V RV128 */ 756 757 /* 758 * SMBIOS Cache Information. See DSP0134 Section 7.8 for more information. 759 * If smba_size is zero, this indicates the specified cache is not present. 760 * 761 * SMBIOS 3.1 added extended cache sizes. Unfortunately, we had already baked in 762 * the uint32_t sizes, so we added extended uint64_t's that correspond to the 763 * new fields. To make life easier for consumers, we always make sure that the 764 * _maxsize2 and _size2 members are filled in with the old value if no other 765 * value is present. 766 */ 767 typedef struct smbios_cache { 768 uint32_t smba_maxsize; /* maximum installed size in bytes */ 769 uint32_t smba_size; /* installed size in bytes */ 770 uint16_t smba_stype; /* supported SRAM types (SMB_CAT_*) */ 771 uint16_t smba_ctype; /* current SRAM type (SMB_CAT_*) */ 772 uint8_t smba_speed; /* speed in nanoseconds */ 773 uint8_t smba_etype; /* error correction type (SMB_CAE_*) */ 774 uint8_t smba_ltype; /* logical cache type (SMB_CAG_*) */ 775 uint8_t smba_assoc; /* associativity (SMB_CAA_*) */ 776 uint8_t smba_level; /* cache level */ 777 uint8_t smba_mode; /* cache mode (SMB_CAM_*) */ 778 uint8_t smba_location; /* cache location (SMB_CAL_*) */ 779 uint8_t smba_flags; /* cache flags (SMB_CAF_*) */ 780 uint64_t smba_maxsize2; /* maximum installed size in bytes */ 781 uint64_t smba_size2; /* installed size in bytes */ 782 } smbios_cache_t; 783 784 #define SMB_CAT_OTHER 0x0001 /* other */ 785 #define SMB_CAT_UNKNOWN 0x0002 /* unknown */ 786 #define SMB_CAT_NONBURST 0x0004 /* non-burst */ 787 #define SMB_CAT_BURST 0x0008 /* burst */ 788 #define SMB_CAT_PBURST 0x0010 /* pipeline burst */ 789 #define SMB_CAT_SYNC 0x0020 /* synchronous */ 790 #define SMB_CAT_ASYNC 0x0040 /* asynchronous */ 791 792 #define SMB_CAE_OTHER 0x01 /* other */ 793 #define SMB_CAE_UNKNOWN 0x02 /* unknown */ 794 #define SMB_CAE_NONE 0x03 /* none */ 795 #define SMB_CAE_PARITY 0x04 /* parity */ 796 #define SMB_CAE_SBECC 0x05 /* single-bit ECC */ 797 #define SMB_CAE_MBECC 0x06 /* multi-bit ECC */ 798 799 #define SMB_CAG_OTHER 0x01 /* other */ 800 #define SMB_CAG_UNKNOWN 0x02 /* unknown */ 801 #define SMB_CAG_INSTR 0x03 /* instruction */ 802 #define SMB_CAG_DATA 0x04 /* data */ 803 #define SMB_CAG_UNIFIED 0x05 /* unified */ 804 805 #define SMB_CAA_OTHER 0x01 /* other */ 806 #define SMB_CAA_UNKNOWN 0x02 /* unknown */ 807 #define SMB_CAA_DIRECT 0x03 /* direct mapped */ 808 #define SMB_CAA_2WAY 0x04 /* 2-way set associative */ 809 #define SMB_CAA_4WAY 0x05 /* 4-way set associative */ 810 #define SMB_CAA_FULL 0x06 /* fully associative */ 811 #define SMB_CAA_8WAY 0x07 /* 8-way set associative */ 812 #define SMB_CAA_16WAY 0x08 /* 16-way set associative */ 813 #define SMB_CAA_12WAY 0x09 /* 12-way set associative */ 814 #define SMB_CAA_24WAY 0x0A /* 24-way set associative */ 815 #define SMB_CAA_32WAY 0x0B /* 32-way set associative */ 816 #define SMB_CAA_48WAY 0x0C /* 48-way set associative */ 817 #define SMB_CAA_64WAY 0x0D /* 64-way set associative */ 818 #define SMB_CAA_20WAY 0x0E /* 20-way set associative */ 819 820 #define SMB_CAM_WT 0x00 /* write-through */ 821 #define SMB_CAM_WB 0x01 /* write-back */ 822 #define SMB_CAM_VARY 0x02 /* varies by address */ 823 #define SMB_CAM_UNKNOWN 0x03 /* unknown */ 824 825 #define SMB_CAL_INTERNAL 0x00 /* internal */ 826 #define SMB_CAL_EXTERNAL 0x01 /* external */ 827 #define SMB_CAL_RESERVED 0x02 /* reserved */ 828 #define SMB_CAL_UNKNOWN 0x03 /* unknown */ 829 830 #define SMB_CAF_ENABLED 0x01 /* enabled at boot time */ 831 #define SMB_CAF_SOCKETED 0x02 /* cache is socketed */ 832 833 /* 834 * SMBIOS Port Information. See DSP0134 Section 7.9 for more information. 835 * The internal reference designator string is also mapped to the location. 836 */ 837 typedef struct smbios_port { 838 const char *smbo_iref; /* internal reference designator */ 839 const char *smbo_eref; /* external reference designator */ 840 uint8_t smbo_itype; /* internal connector type (SMB_POC_*) */ 841 uint8_t smbo_etype; /* external connector type (SMB_POC_*) */ 842 uint8_t smbo_ptype; /* port type (SMB_POT_*) */ 843 uint8_t smbo_pad; /* padding */ 844 } smbios_port_t; 845 846 #define SMB_POC_NONE 0x00 /* none */ 847 #define SMB_POC_CENT 0x01 /* Centronics */ 848 #define SMB_POC_MINICENT 0x02 /* Mini-Centronics */ 849 #define SMB_POC_PROPRIETARY 0x03 /* proprietary */ 850 #define SMB_POC_DB25M 0x04 /* DB-25 pin male */ 851 #define SMB_POC_DB25F 0x05 /* DB-25 pin female */ 852 #define SMB_POC_DB15M 0x06 /* DB-15 pin male */ 853 #define SMB_POC_DB15F 0x07 /* DB-15 pin female */ 854 #define SMB_POC_DB9M 0x08 /* DB-9 pin male */ 855 #define SMB_POC_DB9F 0x09 /* DB-9 pin female */ 856 #define SMB_POC_RJ11 0x0A /* RJ-11 */ 857 #define SMB_POC_RJ45 0x0B /* RJ-45 */ 858 #define SMB_POC_MINISCSI 0x0C /* 50-pin MiniSCSI */ 859 #define SMB_POC_MINIDIN 0x0D /* Mini-DIN */ 860 #define SMB_POC_MICRODIN 0x0E /* Micro-DIN */ 861 #define SMB_POC_PS2 0x0F /* PS/2 */ 862 #define SMB_POC_IR 0x10 /* Infrared */ 863 #define SMB_POC_HPHIL 0x11 /* HP-HIL */ 864 #define SMB_POC_USB 0x12 /* USB */ 865 #define SMB_POC_SSA 0x13 /* SSA SCSI */ 866 #define SMB_POC_DIN8M 0x14 /* Circular DIN-8 male */ 867 #define SMB_POC_DIN8F 0x15 /* Circular DIN-8 female */ 868 #define SMB_POC_OBIDE 0x16 /* on-board IDE */ 869 #define SMB_POC_OBFLOPPY 0x17 /* on-board floppy */ 870 #define SMB_POC_DI9 0x18 /* 9p dual inline (p10 cut) */ 871 #define SMB_POC_DI25 0x19 /* 25p dual inline (p26 cut) */ 872 #define SMB_POC_DI50 0x1A /* 50p dual inline */ 873 #define SMB_POC_DI68 0x1B /* 68p dual inline */ 874 #define SMB_POC_CDROM 0x1C /* on-board sound from CDROM */ 875 #define SMB_POC_MINI14 0x1D /* Mini-Centronics Type 14 */ 876 #define SMB_POC_MINI26 0x1E /* Mini-Centronics Type 26 */ 877 #define SMB_POC_MINIJACK 0x1F /* Mini-jack (headphones) */ 878 #define SMB_POC_BNC 0x20 /* BNC */ 879 #define SMB_POC_1394 0x21 /* 1394 */ 880 #define SMB_POC_SATA 0x22 /* SAS/SATA plug receptacle */ 881 #define SMB_POC_USB_C 0x23 /* USB Type-C receptacle */ 882 #define SMB_POC_PC98 0xA0 /* PC-98 */ 883 #define SMB_POC_PC98HR 0xA1 /* PC-98Hireso */ 884 #define SMB_POC_PCH98 0xA2 /* PC-H98 */ 885 #define SMB_POC_PC98NOTE 0xA3 /* PC-98Note */ 886 #define SMB_POC_PC98FULL 0xA4 /* PC-98Full */ 887 #define SMB_POC_OTHER 0xFF /* other */ 888 889 #define SMB_POT_NONE 0x00 /* none */ 890 #define SMB_POT_PP_XTAT 0x01 /* Parallel Port XT/AT compat */ 891 #define SMB_POT_PP_PS2 0x02 /* Parallel Port PS/2 */ 892 #define SMB_POT_PP_ECP 0x03 /* Parallel Port ECP */ 893 #define SMB_POT_PP_EPP 0x04 /* Parallel Port EPP */ 894 #define SMB_POT_PP_ECPEPP 0x05 /* Parallel Port ECP/EPP */ 895 #define SMB_POT_SP_XTAT 0x06 /* Serial Port XT/AT compat */ 896 #define SMB_POT_SP_16450 0x07 /* Serial Port 16450 compat */ 897 #define SMB_POT_SP_16550 0x08 /* Serial Port 16550 compat */ 898 #define SMB_POT_SP_16550A 0x09 /* Serial Port 16550A compat */ 899 #define SMB_POT_SCSI 0x0A /* SCSI port */ 900 #define SMB_POT_MIDI 0x0B /* MIDI port */ 901 #define SMB_POT_JOYSTICK 0x0C /* Joystick port */ 902 #define SMB_POT_KEYBOARD 0x0D /* Keyboard port */ 903 #define SMB_POT_MOUSE 0x0E /* Mouse port */ 904 #define SMB_POT_SSA 0x0F /* SSA SCSI */ 905 #define SMB_POT_USB 0x10 /* USB */ 906 #define SMB_POT_FIREWIRE 0x11 /* FireWrite (IEEE P1394) */ 907 #define SMB_POT_PCMII 0x12 /* PCMCIA Type II */ 908 #define SMB_POT_PCMIIa 0x13 /* PCMCIA Type II (alternate) */ 909 #define SMB_POT_PCMIII 0x14 /* PCMCIA Type III */ 910 #define SMB_POT_CARDBUS 0x15 /* Cardbus */ 911 #define SMB_POT_ACCESS 0x16 /* Access Bus Port */ 912 #define SMB_POT_SCSI2 0x17 /* SCSI II */ 913 #define SMB_POT_SCSIW 0x18 /* SCSI Wide */ 914 #define SMB_POT_PC98 0x19 /* PC-98 */ 915 #define SMB_POT_PC98HR 0x1A /* PC-98Hireso */ 916 #define SMB_POT_PCH98 0x1B /* PC-H98 */ 917 #define SMB_POT_VIDEO 0x1C /* Video port */ 918 #define SMB_POT_AUDIO 0x1D /* Audio port */ 919 #define SMB_POT_MODEM 0x1E /* Modem port */ 920 #define SMB_POT_NETWORK 0x1F /* Network port */ 921 #define SMB_POT_SATA 0x20 /* SATA */ 922 #define SMB_POT_SAS 0x21 /* SAS */ 923 #define SMB_POT_MFDP 0x22 /* MFDP (Multi-Function Display Port) */ 924 #define SMB_POT_THUNDERBOLT 0x23 /* Thunderbolt */ 925 #define SMB_POT_8251 0xA0 /* 8251 compatible */ 926 #define SMB_POT_8251F 0xA1 /* 8251 FIFO compatible */ 927 #define SMB_POT_OTHER 0xFF /* other */ 928 929 /* 930 * SMBIOS Slot Information. See DSP0134 Section 7.10 for more information. 931 * See DSP0134 7.10.5 for how to interpret the value of smbl_id. 932 */ 933 typedef struct smbios_slot { 934 const char *smbl_name; /* reference designation */ 935 uint8_t smbl_type; /* slot type */ 936 uint8_t smbl_width; /* slot data bus width */ 937 uint8_t smbl_usage; /* current usage */ 938 uint8_t smbl_length; /* slot length */ 939 uint16_t smbl_id; /* slot ID */ 940 uint8_t smbl_ch1; /* slot characteristics 1 */ 941 uint8_t smbl_ch2; /* slot characteristics 2 */ 942 uint16_t smbl_sg; /* segment group number */ 943 uint8_t smbl_bus; /* bus number */ 944 uint8_t smbl_df; /* device/function number */ 945 uint8_t smbl_dbw; /* data bus width */ 946 uint8_t smbl_npeers; /* PCIe bifurcation peers */ 947 } smbios_slot_t; 948 949 #define SMB_SLT_OTHER 0x01 /* other */ 950 #define SMB_SLT_UNKNOWN 0x02 /* unknown */ 951 #define SMB_SLT_ISA 0x03 /* ISA */ 952 #define SMB_SLT_MCA 0x04 /* MCA */ 953 #define SMB_SLT_EISA 0x05 /* EISA */ 954 #define SMB_SLT_PCI 0x06 /* PCI */ 955 #define SMB_SLT_PCMCIA 0x07 /* PCMCIA */ 956 #define SMB_SLT_VLVESA 0x08 /* VL-VESA */ 957 #define SMB_SLT_PROPRIETARY 0x09 /* proprietary */ 958 #define SMB_SLT_PROC 0x0A /* processor card slot */ 959 #define SMB_SLT_MEM 0x0B /* proprietary memory card slot */ 960 #define SMB_SLT_IOR 0x0C /* I/O riser card slot */ 961 #define SMB_SLT_NUBUS 0x0D /* NuBus */ 962 #define SMB_SLT_PCI66 0x0E /* PCI (66MHz capable) */ 963 #define SMB_SLT_AGP 0x0F /* AGP */ 964 #define SMB_SLT_AGP2X 0x10 /* AGP 2X */ 965 #define SMB_SLT_AGP4X 0x11 /* AGP 4X */ 966 #define SMB_SLT_PCIX 0x12 /* PCI-X */ 967 #define SMB_SLT_AGP8X 0x13 /* AGP 8X */ 968 #define SMB_SLT_M2_1DP 0x14 /* M.2 Socket 1-DP (Mechanical Key A) */ 969 #define SMB_SLT_M2_1SD 0x15 /* M.2 Socket 1-SD (Mechanical Key E) */ 970 #define SMB_SLT_M2_2 0x16 /* M.2 Socket 2 (Mechanical Key B) */ 971 #define SMB_SLT_M2_3 0x17 /* M.2 Socket 3 (Mechanical Key M) */ 972 #define SMB_SLT_MXM_I 0x18 /* MXM Type I */ 973 #define SMB_SLT_MXM_II 0x19 /* MXM Type II */ 974 #define SMB_SLT_MXM_III 0x1A /* MXM Type III (standard connector) */ 975 #define SMB_SLT_MXM_III_HE 0x1B /* MXM Type III (HE connector) */ 976 #define SMB_SLT_MXM_V 0x1C /* MXM Type IV */ 977 #define SMB_SLT_MXM3_A 0x1D /* MXM 3.0 Type A */ 978 #define SMB_SLT_MXM3_B 0x1E /* MXM 3.0 Type B */ 979 #define SMB_SLT_PCIEG2_SFF 0x1F /* PCI Express Gen 2 SFF-8639 */ 980 #define SMB_SLT_PCIEG3_SFF 0x20 /* PCI Express Gen 3 SFF-8639 */ 981 /* 982 * These lines must be on one line for the string generating code. 983 */ 984 /* BEGIN CSTYLED */ 985 #define SMB_SLT_PCIE_M52_WBSKO 0x21 /* PCI Express Mini 52-pin with bottom-side keep-outs */ 986 #define SMB_SLT_PCIE_M52_WOBSKO 0x22 /* PCI Express Mini 52-pin without bottom-side keep-outs */ 987 /* END CSTYLED */ 988 #define SMB_SLT_PCIE_M76 0x23 /* PCI Express Mini 72-pin */ 989 #define SMB_SLT_CXL1 0x30 /* CXL Flexbus 1.0 */ 990 #define SMB_SLT_PC98_C20 0xA0 /* PC-98/C20 */ 991 #define SMB_SLT_PC98_C24 0xA1 /* PC-98/C24 */ 992 #define SMB_SLT_PC98_E 0xA2 /* PC-98/E */ 993 #define SMB_SLT_PC98_LB 0xA3 /* PC-98/Local Bus */ 994 #define SMB_SLT_PC98_C 0xA4 /* PC-98/Card */ 995 #define SMB_SLT_PCIE 0xA5 /* PCI Express */ 996 #define SMB_SLT_PCIE1 0xA6 /* PCI Express x1 */ 997 #define SMB_SLT_PCIE2 0xA7 /* PCI Express x2 */ 998 #define SMB_SLT_PCIE4 0xA8 /* PCI Express x4 */ 999 #define SMB_SLT_PCIE8 0xA9 /* PCI Express x8 */ 1000 #define SMB_SLT_PCIE16 0xAA /* PCI Express x16 */ 1001 #define SMB_SLT_PCIE2G 0xAB /* PCI Exp. Gen 2 */ 1002 #define SMB_SLT_PCIE2G1 0xAC /* PCI Exp. Gen 2 x1 */ 1003 #define SMB_SLT_PCIE2G2 0xAD /* PCI Exp. Gen 2 x2 */ 1004 #define SMB_SLT_PCIE2G4 0xAE /* PCI Exp. Gen 2 x4 */ 1005 #define SMB_SLT_PCIE2G8 0xAF /* PCI Exp. Gen 2 x8 */ 1006 #define SMB_SLT_PCIE2G16 0xB0 /* PCI Exp. Gen 2 x16 */ 1007 #define SMB_SLT_PCIE3G 0xB1 /* PCI Exp. Gen 3 */ 1008 #define SMB_SLT_PCIE3G1 0xB2 /* PCI Exp. Gen 3 x1 */ 1009 #define SMB_SLT_PCIE3G2 0xB3 /* PCI Exp. Gen 3 x2 */ 1010 #define SMB_SLT_PCIE3G4 0xB4 /* PCI Exp. Gen 3 x4 */ 1011 #define SMB_SLT_PCIE3G8 0xB5 /* PCI Exp. Gen 3 x8 */ 1012 #define SMB_SLT_PCIE3G16 0xB6 /* PCI Exp. Gen 3 x16 */ 1013 #define SMB_SLT_PCIE4G 0xB8 /* PCI Exp. Gen 4 */ 1014 #define SMB_SLT_PCIE4G1 0xB9 /* PCI Exp. Gen 4 x1 */ 1015 #define SMB_SLT_PCIE4G2 0xBA /* PCI Exp. Gen 4 x2 */ 1016 #define SMB_SLT_PCIE4G4 0xBB /* PCI Exp. Gen 4 x4 */ 1017 #define SMB_SLT_PCIE4G8 0xBC /* PCI Exp. Gen 4 x8 */ 1018 #define SMB_SLT_PCIE4G16 0xBD /* PCI Exp. Gen 4 x16 */ 1019 1020 #define SMB_SLW_OTHER 0x01 /* other */ 1021 #define SMB_SLW_UNKNOWN 0x02 /* unknown */ 1022 #define SMB_SLW_8 0x03 /* 8 bit */ 1023 #define SMB_SLW_16 0x04 /* 16 bit */ 1024 #define SMB_SLW_32 0x05 /* 32 bit */ 1025 #define SMB_SLW_64 0x06 /* 64 bit */ 1026 #define SMB_SLW_128 0x07 /* 128 bit */ 1027 #define SMB_SLW_1X 0x08 /* 1x or x1 */ 1028 #define SMB_SLW_2X 0x09 /* 2x or x2 */ 1029 #define SMB_SLW_4X 0x0A /* 4x or x4 */ 1030 #define SMB_SLW_8X 0x0B /* 8x or x8 */ 1031 #define SMB_SLW_12X 0x0C /* 12x or x12 */ 1032 #define SMB_SLW_16X 0x0D /* 16x or x16 */ 1033 #define SMB_SLW_32X 0x0E /* 32x or x32 */ 1034 1035 #define SMB_SLU_OTHER 0x01 /* other */ 1036 #define SMB_SLU_UNKNOWN 0x02 /* unknown */ 1037 #define SMB_SLU_AVAIL 0x03 /* available */ 1038 #define SMB_SLU_INUSE 0x04 /* in use */ 1039 1040 #define SMB_SLL_OTHER 0x01 /* other */ 1041 #define SMB_SLL_UNKNOWN 0x02 /* unknown */ 1042 #define SMB_SLL_SHORT 0x03 /* short length */ 1043 #define SMB_SLL_LONG 0x04 /* long length */ 1044 1045 #define SMB_SLCH1_UNKNOWN 0x01 /* characteristics unknown */ 1046 #define SMB_SLCH1_5V 0x02 /* provides 5.0V */ 1047 #define SMB_SLCH1_33V 0x04 /* provides 3.3V */ 1048 #define SMB_SLCH1_SHARED 0x08 /* opening shared with other slot */ 1049 #define SMB_SLCH1_PC16 0x10 /* slot supports PC Card-16 */ 1050 #define SMB_SLCH1_PCCB 0x20 /* slot supports CardBus */ 1051 #define SMB_SLCH1_PCZV 0x40 /* slot supports Zoom Video */ 1052 #define SMB_SLCH1_PCMRR 0x80 /* slot supports Modem Ring Resume */ 1053 1054 #define SMB_SLCH2_PME 0x01 /* slot supports PME# signal */ 1055 #define SMB_SLCH2_HOTPLUG 0x02 /* slot supports hot-plug devices */ 1056 #define SMB_SLCH2_SMBUS 0x04 /* slot supports SMBus signal */ 1057 #define SMB_SLCH2_BIFUR 0x08 /* slot supports PCIe bifurcation */ 1058 1059 /* 1060 * SMBIOS 7.10.9 Slot Peer Devices 1061 * 1062 * This structure represents an optional peer device that may be part of an 1063 * SMBIOS 3.2 slot. 1064 */ 1065 typedef struct smbios_slot_peer { 1066 uint16_t smblp_group; /* peer segment group number */ 1067 uint8_t smblp_bus; /* peer bus number */ 1068 uint8_t smblp_device; /* peer device number */ 1069 uint8_t smblp_function; /* peer function number */ 1070 uint8_t smblp_data_width; /* peer data bus width */ 1071 } smbios_slot_peer_t; 1072 1073 /* 1074 * SMBIOS On-Board Device Information. See DSP0134 Section 7.11 for more 1075 * information. Any number of on-board device sections may be present, each 1076 * containing one or more records. The smbios_info_obdevs() function permits 1077 * the caller to retrieve one or more of the records from a given section. 1078 */ 1079 typedef struct smbios_obdev { 1080 const char *smbd_name; /* description string for this device */ 1081 uint8_t smbd_type; /* type code (SMB_OBT_*) */ 1082 uint8_t smbd_enabled; /* boolean (device is enabled) */ 1083 } smbios_obdev_t; 1084 1085 #define SMB_OBT_OTHER 0x01 /* other */ 1086 #define SMB_OBT_UNKNOWN 0x02 /* unknown */ 1087 #define SMB_OBT_VIDEO 0x03 /* video */ 1088 #define SMB_OBT_SCSI 0x04 /* scsi */ 1089 #define SMB_OBT_ETHERNET 0x05 /* ethernet */ 1090 #define SMB_OBT_TOKEN 0x06 /* token ring */ 1091 #define SMB_OBT_SOUND 0x07 /* sound */ 1092 #define SMB_OBT_PATA 0x08 /* pata */ 1093 #define SMB_OBT_SATA 0x09 /* sata */ 1094 #define SMB_OBT_SAS 0x0A /* sas */ 1095 1096 /* 1097 * SMBIOS BIOS Language Information. See DSP0134 Section 7.14 for more 1098 * information. The smbios_info_strtab() function can be applied using a 1099 * count of smbla_num to retrieve the other possible language settings. 1100 */ 1101 typedef struct smbios_lang { 1102 const char *smbla_cur; /* current language setting */ 1103 uint_t smbla_fmt; /* language name format (see below) */ 1104 uint_t smbla_num; /* number of installed languages */ 1105 } smbios_lang_t; 1106 1107 #define SMB_LFMT_LONG 0 /* <ISO639>|<ISO3166>|Encoding Method */ 1108 #define SMB_LFMT_SHORT 1 /* <ISO930><ISO3166> */ 1109 1110 /* 1111 * SMBIOS System Event Log Information. See DSP0134 Section 7.16 for more 1112 * information. Accessing the event log itself requires additional interfaces. 1113 */ 1114 typedef struct smbios_evtype { 1115 uint8_t smbevt_ltype; /* log type */ 1116 uint8_t smbevt_dtype; /* variable data format type */ 1117 } smbios_evtype_t; 1118 1119 typedef struct smbios_evlog { 1120 size_t smbev_size; /* size in bytes of log area */ 1121 size_t smbev_hdr; /* offset or index of header */ 1122 size_t smbev_data; /* offset or index of data */ 1123 uint8_t smbev_method; /* data access method (see below) */ 1124 uint8_t smbev_flags; /* flags (see below) */ 1125 uint8_t smbev_format; /* log header format (see below) */ 1126 uint8_t smbev_pad; /* padding */ 1127 uint32_t smbev_token; /* data update change token */ 1128 union { 1129 struct { 1130 uint16_t evi_iaddr; /* index address */ 1131 uint16_t evi_daddr; /* data address */ 1132 } eva_io; /* i/o address for SMB_EVM_XxY */ 1133 uint32_t eva_addr; /* address for SMB_EVM_MEM32 */ 1134 uint16_t eva_gpnv; /* handle for SMB_EVM_GPNV */ 1135 } smbev_addr; 1136 uint32_t smbev_typec; /* number of type descriptors */ 1137 const smbios_evtype_t *smbev_typev; /* type descriptor array */ 1138 } smbios_evlog_t; 1139 1140 #define SMB_EVM_1x1i_1x1d 0 /* I/O: 1 1b idx port, 1 1b data port */ 1141 #define SMB_EVM_2x1i_1x1d 1 /* I/O: 2 1b idx port, 1 1b data port */ 1142 #define SMB_EVM_1x2i_1x1d 2 /* I/O: 1 2b idx port, 1 1b data port */ 1143 #define SMB_EVM_MEM32 3 /* Memory-Mapped 32-bit Physical Addr */ 1144 #define SMB_EVM_GPNV 4 /* GP Non-Volatile API Access */ 1145 1146 #define SMB_EVFL_VALID 0x1 /* log area valid */ 1147 #define SMB_EVFL_FULL 0x2 /* log area full */ 1148 1149 #define SMB_EVHF_NONE 0 /* no log headers used */ 1150 #define SMB_EVHF_F1 1 /* DMTF log header type 1 */ 1151 1152 /* 1153 * SMBIOS Physical Memory Array Information. See DSP0134 Section 7.17 for 1154 * more information. This describes a collection of physical memory devices. 1155 */ 1156 typedef struct smbios_memarray { 1157 uint8_t smbma_location; /* physical device location */ 1158 uint8_t smbma_use; /* physical device functional purpose */ 1159 uint8_t smbma_ecc; /* error detect/correct mechanism */ 1160 uint8_t smbma_pad0; /* padding */ 1161 uint32_t smbma_pad1; /* padding */ 1162 uint32_t smbma_ndevs; /* number of slots or sockets */ 1163 id_t smbma_err; /* handle of error (if any) */ 1164 uint64_t smbma_size; /* maximum capacity in bytes */ 1165 } smbios_memarray_t; 1166 1167 #define SMB_MAL_OTHER 0x01 /* other */ 1168 #define SMB_MAL_UNKNOWN 0x02 /* unknown */ 1169 #define SMB_MAL_SYSMB 0x03 /* system board or motherboard */ 1170 #define SMB_MAL_ISA 0x04 /* ISA add-on card */ 1171 #define SMB_MAL_EISA 0x05 /* EISA add-on card */ 1172 #define SMB_MAL_PCI 0x06 /* PCI add-on card */ 1173 #define SMB_MAL_MCA 0x07 /* MCA add-on card */ 1174 #define SMB_MAL_PCMCIA 0x08 /* PCMCIA add-on card */ 1175 #define SMB_MAL_PROP 0x09 /* proprietary add-on card */ 1176 #define SMB_MAL_NUBUS 0x0A /* NuBus */ 1177 #define SMB_MAL_PC98C20 0xA0 /* PC-98/C20 add-on card */ 1178 #define SMB_MAL_PC98C24 0xA1 /* PC-98/C24 add-on card */ 1179 #define SMB_MAL_PC98E 0xA2 /* PC-98/E add-on card */ 1180 #define SMB_MAL_PC98LB 0xA3 /* PC-98/Local bus add-on card */ 1181 #define SMB_MAL_CXL1 0xA4 /* CXL Flexbus 1.0 add-on card */ 1182 1183 #define SMB_MAU_OTHER 0x01 /* other */ 1184 #define SMB_MAU_UNKNOWN 0x02 /* unknown */ 1185 #define SMB_MAU_SYSTEM 0x03 /* system memory */ 1186 #define SMB_MAU_VIDEO 0x04 /* video memory */ 1187 #define SMB_MAU_FLASH 0x05 /* flash memory */ 1188 #define SMB_MAU_NVRAM 0x06 /* non-volatile RAM */ 1189 #define SMB_MAU_CACHE 0x07 /* cache memory */ 1190 1191 #define SMB_MAE_OTHER 0x01 /* other */ 1192 #define SMB_MAE_UNKNOWN 0x02 /* unknown */ 1193 #define SMB_MAE_NONE 0x03 /* none */ 1194 #define SMB_MAE_PARITY 0x04 /* parity */ 1195 #define SMB_MAE_SECC 0x05 /* single-bit ECC */ 1196 #define SMB_MAE_MECC 0x06 /* multi-bit ECC */ 1197 #define SMB_MAE_CRC 0x07 /* CRC */ 1198 1199 /* 1200 * SMBIOS Memory Device Information. See DSP0134 Section 7.18 for more 1201 * information. One or more of these structures are associated with each 1202 * smbios_memarray_t. A structure is present even for unpopulated sockets. 1203 * Unknown values are set to -1. A smbmd_size of 0 indicates unpopulated. 1204 * WARNING: Some BIOSes appear to export the *maximum* size of the device 1205 * that can appear in the corresponding socket as opposed to the current one. 1206 */ 1207 typedef struct smbios_memdevice { 1208 id_t smbmd_array; /* handle of physical memory array */ 1209 id_t smbmd_error; /* handle of memory error data */ 1210 uint32_t smbmd_twidth; /* total width in bits including ecc */ 1211 uint32_t smbmd_dwidth; /* data width in bits */ 1212 uint64_t smbmd_size; /* size in bytes (see note above) */ 1213 uint8_t smbmd_form; /* form factor */ 1214 uint8_t smbmd_set; /* set (0x00=none, 0xFF=unknown) */ 1215 uint8_t smbmd_type; /* memory type */ 1216 uint8_t smbmd_pad; /* padding */ 1217 uint32_t smbmd_flags; /* flags (see below) */ 1218 uint32_t smbmd_speed; /* speed in MT/s */ 1219 const char *smbmd_dloc; /* physical device locator string */ 1220 const char *smbmd_bloc; /* physical bank locator string */ 1221 uint8_t smbmd_rank; /* rank */ 1222 uint16_t smbmd_clkspeed; /* configured clock speed */ 1223 uint16_t smbmd_minvolt; /* minimum voltage */ 1224 uint16_t smbmd_maxvolt; /* maximum voltage */ 1225 uint16_t smbmd_confvolt; /* configured voltage */ 1226 uint8_t smbmd_memtech; /* memory technology */ 1227 uint32_t smbmd_opcap_flags; /* operating mode capability */ 1228 const char *smbmd_firmware_rev; /* firmware rev */ 1229 uint16_t smbmd_modmfg_id; /* JEDEC module mfg id */ 1230 uint16_t smbmd_modprod_id; /* JEDEC module product id */ 1231 uint16_t smbmd_cntrlmfg_id; /* JEDEC controller mfg id */ 1232 uint16_t smbmd_cntrlprod_id; /* JEDEC controller prod id */ 1233 uint64_t smbmd_nvsize; /* non-volatile size in bytes */ 1234 uint64_t smbmd_volatile_size; /* volatile size in bytes */ 1235 uint64_t smbmd_cache_size; /* cache size in bytes */ 1236 uint64_t smbmd_logical_size; /* logical size in bytes */ 1237 uint64_t smbmd_extspeed; /* extended device speed */ 1238 uint64_t smbmd_extclkspeed; /* extended configured speed */ 1239 } smbios_memdevice_t; 1240 1241 #define SMB_MDFF_OTHER 0x01 /* other */ 1242 #define SMB_MDFF_UNKNOWN 0x02 /* unknown */ 1243 #define SMB_MDFF_SIMM 0x03 /* SIMM */ 1244 #define SMB_MDFF_SIP 0x04 /* SIP */ 1245 #define SMB_MDFF_CHIP 0x05 /* chip */ 1246 #define SMB_MDFF_DIP 0x06 /* DIP */ 1247 #define SMB_MDFF_ZIP 0x07 /* ZIP */ 1248 #define SMB_MDFF_PROP 0x08 /* proprietary card */ 1249 #define SMB_MDFF_DIMM 0x09 /* DIMM */ 1250 #define SMB_MDFF_TSOP 0x0A /* TSOP */ 1251 #define SMB_MDFF_CHIPROW 0x0B /* row of chips */ 1252 #define SMB_MDFF_RIMM 0x0C /* RIMM */ 1253 #define SMB_MDFF_SODIMM 0x0D /* SODIMM */ 1254 #define SMB_MDFF_SRIMM 0x0E /* SRIMM */ 1255 #define SMB_MDFF_FBDIMM 0x0F /* FBDIMM */ 1256 #define SMB_MDFF_DIE 0x10 /* die */ 1257 1258 #define SMB_MDT_OTHER 0x01 /* other */ 1259 #define SMB_MDT_UNKNOWN 0x02 /* unknown */ 1260 #define SMB_MDT_DRAM 0x03 /* DRAM */ 1261 #define SMB_MDT_EDRAM 0x04 /* EDRAM */ 1262 #define SMB_MDT_VRAM 0x05 /* VRAM */ 1263 #define SMB_MDT_SRAM 0x06 /* SRAM */ 1264 #define SMB_MDT_RAM 0x07 /* RAM */ 1265 #define SMB_MDT_ROM 0x08 /* ROM */ 1266 #define SMB_MDT_FLASH 0x09 /* FLASH */ 1267 #define SMB_MDT_EEPROM 0x0A /* EEPROM */ 1268 #define SMB_MDT_FEPROM 0x0B /* FEPROM */ 1269 #define SMB_MDT_EPROM 0x0C /* EPROM */ 1270 #define SMB_MDT_CDRAM 0x0D /* CDRAM */ 1271 #define SMB_MDT_3DRAM 0x0E /* 3DRAM */ 1272 #define SMB_MDT_SDRAM 0x0F /* SDRAM */ 1273 #define SMB_MDT_SGRAM 0x10 /* SGRAM */ 1274 #define SMB_MDT_RDRAM 0x11 /* RDRAM */ 1275 #define SMB_MDT_DDR 0x12 /* DDR */ 1276 #define SMB_MDT_DDR2 0x13 /* DDR2 */ 1277 #define SMB_MDT_DDR2FBDIMM 0x14 /* DDR2 FBDIMM */ 1278 #define SMB_MDT_DDR3 0x18 /* DDR3 */ 1279 #define SMB_MDT_FBD2 0x19 /* FBD2 */ 1280 #define SMB_MDT_DDR4 0x1A /* DDR4 */ 1281 #define SMB_MDT_LPDDR 0x1B /* LPDDR */ 1282 #define SMB_MDT_LPDDR2 0x1C /* LPDDR2 */ 1283 #define SMB_MDT_LPDDR3 0x1D /* LPDDR3 */ 1284 #define SMB_MDT_LPDDR4 0x1E /* LPDDR4 */ 1285 #define SMB_MDT_LOGNV 0x1F /* Logical non-volatile device */ 1286 #define SMB_MDT_HBM 0x20 /* High Bandwidth Memory */ 1287 #define SMB_MDT_HBM2 0x21 /* High Bandwidth Memory 2 */ 1288 1289 #define SMB_MDF_OTHER 0x0002 /* other */ 1290 #define SMB_MDF_UNKNOWN 0x0004 /* unknown */ 1291 #define SMB_MDF_FASTPG 0x0008 /* fast-paged */ 1292 #define SMB_MDF_STATIC 0x0010 /* static column */ 1293 #define SMB_MDF_PSTATIC 0x0020 /* pseudo-static */ 1294 #define SMB_MDF_RAMBUS 0x0040 /* RAMBUS */ 1295 #define SMB_MDF_SYNC 0x0080 /* synchronous */ 1296 #define SMB_MDF_CMOS 0x0100 /* CMOS */ 1297 #define SMB_MDF_EDO 0x0200 /* EDO */ 1298 #define SMB_MDF_WDRAM 0x0400 /* Window DRAM */ 1299 #define SMB_MDF_CDRAM 0x0800 /* Cache DRAM */ 1300 #define SMB_MDF_NV 0x1000 /* non-volatile */ 1301 #define SMB_MDF_REG 0x2000 /* Registered (Buffered) */ 1302 #define SMB_MDF_UNREG 0x4000 /* Unregistered (Unbuffered) */ 1303 #define SMB_MDF_LRDIMM 0x8000 /* LRDIMM */ 1304 1305 #define SMB_MDR_SINGLE 0x01 /* single */ 1306 #define SMB_MDR_DUAL 0x02 /* dual */ 1307 #define SMB_MDR_QUAD 0x04 /* quad */ 1308 #define SMB_MDR_OCTAL 0x08 /* octal */ 1309 1310 #define SMB_MTECH_OTHER 0x01 /* other */ 1311 #define SMB_MTECH_UNKNOWN 0x02 /* unknown */ 1312 #define SMB_MTECH_DRAM 0x03 /* DRAM */ 1313 #define SMB_MTECH_NVDIMM_N 0x04 /* NVDIMM-N */ 1314 #define SMB_MTECH_NVDIMM_F 0x05 /* NVDIMM-F */ 1315 #define SMB_MTECH_NVDIMM_P 0x06 /* NVDIMM-P */ 1316 #define SMB_MTECH_INTCPM 0x07 /* Intel Optane DC Persistent Memory */ 1317 1318 #define SMB_MOMC_RESERVED 0x01 /* reserved */ 1319 #define SMB_MOMC_OTHER 0x02 /* other */ 1320 #define SMB_MOMC_UNKNOWN 0x04 /* unknown */ 1321 #define SMB_MOMC_VOLATILE 0x08 /* Volatile memory */ 1322 #define SMB_MOMC_BYTE_PM 0x10 /* Byte-accessible persistent memory */ 1323 #define SMB_MOMC_BLOCK_PM 0x20 /* Block-accessible persistent memory */ 1324 1325 /* 1326 * SMBIOS Memory Array Mapped Address. See DSP0134 Section 7.20 for more 1327 * information. We convert start/end addresses into addr/size for convenience. 1328 */ 1329 typedef struct smbios_memarrmap { 1330 id_t smbmam_array; /* physical memory array handle */ 1331 uint32_t smbmam_width; /* number of devices that form a row */ 1332 uint64_t smbmam_addr; /* physical address of mapping */ 1333 uint64_t smbmam_size; /* size in bytes of address range */ 1334 } smbios_memarrmap_t; 1335 1336 /* 1337 * SMBIOS Memory Device Mapped Address. See DSP0134 Section 7.21 for more 1338 * information. We convert start/end addresses into addr/size for convenience. 1339 */ 1340 typedef struct smbios_memdevmap { 1341 id_t smbmdm_device; /* memory device handle */ 1342 id_t smbmdm_arrmap; /* memory array mapped address handle */ 1343 uint64_t smbmdm_addr; /* physical address of mapping */ 1344 uint64_t smbmdm_size; /* size in bytes of address range */ 1345 uint8_t smbmdm_rpos; /* partition row position */ 1346 uint8_t smbmdm_ipos; /* interleave position */ 1347 uint8_t smbmdm_idepth; /* interleave data depth */ 1348 } smbios_memdevmap_t; 1349 1350 /* 1351 * SMBIOS Builtin Pointing Device (SMB_TYPE_POINTDEV). See DSP0134 Sectin 7.22 1352 * for more information. 1353 */ 1354 typedef struct smbios_pointdev { 1355 uint16_t smbpd_type; /* device type */ 1356 uint16_t smbpd_iface; /* device information */ 1357 uint8_t smbpd_nbuttons; /* number of buttons */ 1358 } smbios_pointdev_t; 1359 1360 #define SMB_PDT_OTHER 0x01 /* Other */ 1361 #define SMB_PDT_UNKNOWN 0x02 /* Unknown */ 1362 #define SMB_PDT_MOUSE 0x03 /* Mouse */ 1363 #define SMB_PDT_TRBALL 0x04 /* Track Ball */ 1364 #define SMB_PDT_TRPOINT 0x05 /* Track Point */ 1365 #define SMB_PDT_GLPOINT 0x06 /* Glide Point */ 1366 #define SMB_PDT_TOPAD 0x07 /* Touch Pad */ 1367 #define SMB_PDT_TOSCREEN 0x08 /* Touch Screen */ 1368 #define SMB_PDT_OPTSENSE 0x09 /* Optical Sensor */ 1369 1370 #define SMB_PDI_OTHER 0x01 /* Other */ 1371 #define SMB_PDI_UNKNOWN 0x02 /* Unknown */ 1372 #define SMB_PDI_SERIAL 0x03 /* Serial */ 1373 #define SMB_PDI_PS2 0x04 /* PS/2 */ 1374 #define SMB_PDI_INFRARED 0x05 /* Infrared */ 1375 #define SMB_PDI_HPHIL 0x06 /* HP-HIL */ 1376 #define SMB_PDI_BUSM 0x07 /* Bus mouse */ 1377 #define SMB_PDI_ADB 0x08 /* ADB (Apple Desktop Bus) */ 1378 #define SMB_PDI_BUSM_DB9 0xA0 /* Bus mouse DB-9 */ 1379 #define SMB_PDI_BUSM_UDIN 0xA1 /* Bus mouse micro-DIN */ 1380 #define SMB_PDI_BUSM_USB 0xA2 /* USB */ 1381 1382 /* 1383 * SMBIOS Portable Battery. See DSP0134 Section 7.23 for more information. 1384 */ 1385 typedef struct smbios_battery { 1386 const char *smbb_date; /* Manufacture date */ 1387 const char *smbb_serial; /* Serial number */ 1388 uint8_t smbb_chem; /* Device Chemistry */ 1389 uint32_t smbb_cap; /* Design Capacity */ 1390 uint16_t smbb_volt; /* Design Voltage */ 1391 const char *smbb_version; /* Smart Battery version */ 1392 uint8_t smbb_err; /* Maximum error */ 1393 uint16_t smbb_ssn; /* SBDS serial number */ 1394 uint16_t smbb_syear; /* SBDS manufacture year */ 1395 uint8_t smbb_smonth; /* SBDS manufacture month */ 1396 uint8_t smbb_sday; /* SBDS manufacture day */ 1397 const char *smbb_schem; /* SBDS chemistry */ 1398 uint32_t smbb_oemdata; /* OEM data */ 1399 } smbios_battery_t; 1400 1401 #define SMB_BDC_OTHER 0x01 /* Other */ 1402 #define SMB_BDC_UNKNOWN 0x02 /* Unknown */ 1403 #define SMB_BDC_LEADACID 0x03 /* Lead Acid */ 1404 #define SMB_BDC_NICD 0x04 /* Nickel Cadmium */ 1405 #define SMB_BDC_NIMH 0x05 /* Nickel Metal hydride */ 1406 #define SMB_BDC_LIB 0x06 /* Lithium-ion */ 1407 #define SMB_BDC_ZINCAIR 0x07 /* Zinc air */ 1408 #define SMB_BDC_LIPO 0x08 /* Lithium Polymer */ 1409 1410 /* 1411 * SMBIOS Hardware Security Settings. See DSP0134 Section 7.25 for more 1412 * information. Only one such record will be present in the SMBIOS. 1413 */ 1414 typedef struct smbios_hwsec { 1415 uint8_t smbh_pwr_ps; /* power-on password status */ 1416 uint8_t smbh_kbd_ps; /* keyboard password status */ 1417 uint8_t smbh_adm_ps; /* administrator password status */ 1418 uint8_t smbh_pan_ps; /* front panel reset status */ 1419 } smbios_hwsec_t; 1420 1421 #define SMB_HWSEC_PS_DISABLED 0x00 /* password disabled */ 1422 #define SMB_HWSEC_PS_ENABLED 0x01 /* password enabled */ 1423 #define SMB_HWSEC_PS_NOTIMPL 0x02 /* password not implemented */ 1424 #define SMB_HWSEC_PS_UNKNOWN 0x03 /* password status unknown */ 1425 1426 /* 1427 * This value is used to represent a probe that has an unknown value. 1428 */ 1429 #define SMB_PROBE_UNKNOWN_VALUE 0x8000 1430 1431 /* 1432 * SMBIOS Voltage Probe. See DSP0134 Section 7.27 for more information. 1433 * Please see the specification for the units of each value. 1434 */ 1435 typedef struct smbios_vprobe { 1436 const char *smbvp_description; /* description information */ 1437 uint8_t smbvp_location; /* probe location */ 1438 uint8_t smbvp_status; /* probe status */ 1439 uint16_t smbvp_maxval; /* maximum voltage */ 1440 uint16_t smbvp_minval; /* minimum voltage */ 1441 uint16_t smbvp_resolution; /* probe resolution */ 1442 uint16_t smbvp_tolerance; /* probe tolerance */ 1443 uint16_t smbvp_accuracy; /* probe accuracy */ 1444 uint32_t smbvp_oem; /* vendor-specific data */ 1445 uint16_t smbvp_nominal; /* nominal value */ 1446 } smbios_vprobe_t; 1447 1448 #define SMB_VPROBE_S_OTHER 0x01 /* other */ 1449 #define SMB_VPROBE_S_UNKNOWN 0x02 /* unknown */ 1450 #define SMB_VPROBE_S_OK 0x03 /* OK */ 1451 #define SMB_VPROBE_S_NONCRIT 0x04 /* non-critical */ 1452 #define SMB_VPROBE_S_CRIT 0x05 /* critical */ 1453 #define SMB_VPROBE_S_NONRECOV 0x06 /* non-recoverable */ 1454 1455 #define SMB_VPROBE_L_OTHER 0x01 /* other */ 1456 #define SMB_VPROBE_L_UNKNOWN 0x02 /* unknown */ 1457 #define SMB_VPROBE_L_PROC 0x03 /* processor */ 1458 #define SMB_VPROBE_L_DISK 0x04 /* disk */ 1459 #define SMB_VPROBE_L_PBAY 0x05 /* peripheral bay */ 1460 #define SMB_VPROBE_L_MGMT 0x06 /* system management module */ 1461 #define SMB_VPROBE_L_MOBO 0x07 /* motherboard */ 1462 #define SMB_VPROBE_L_MEMMOD 0x08 /* memory module */ 1463 #define SMB_VPROBE_L_PROCMOD 0x09 /* processor module */ 1464 #define SMB_VPROBE_L_POWER 0x0a /* power unit */ 1465 #define SMB_VPROBE_L_AIC 0x0b /* add-in card */ 1466 1467 /* 1468 * SMBIOS Cooling Device. See DSP0134 Section 7.28 for more information. 1469 * Please see the specification for the units of each value. 1470 */ 1471 typedef struct smbios_cooldev { 1472 id_t smbcd_tprobe; /* temperature probe handle */ 1473 uint8_t smbcd_type; /* cooling device type */ 1474 uint8_t smbcd_status; /* status */ 1475 uint8_t smbcd_group; /* group ID */ 1476 uint32_t smbcd_oem; /* vendor-specific data */ 1477 uint16_t smbcd_nominal; /* nominal speed */ 1478 const char *smbcd_descr; /* device description */ 1479 } smbios_cooldev_t; 1480 1481 #define SMB_COOLDEV_S_OTHER 0x01 /* other */ 1482 #define SMB_COOLDEV_S_UNKNOWN 0x02 /* unknown */ 1483 #define SMB_COOLDEV_S_OK 0x03 /* OK */ 1484 #define SMB_COOLDEV_S_NONCRIT 0x04 /* non-critical */ 1485 #define SMB_COOLDEV_S_CRIT 0x05 /* critical */ 1486 #define SMB_COOLDEV_S_NONRECOV 0x06 /* non-recoverable */ 1487 1488 #define SMB_COOLDEV_T_OTHER 0x01 /* other */ 1489 #define SMB_COOLDEV_T_UNKNOWN 0x02 /* unknown */ 1490 #define SMB_COOLDEV_T_FAN 0x03 /* fan */ 1491 #define SMB_COOLDEV_T_BLOWER 0x04 /* centrifugal blower */ 1492 #define SMB_COOLDEV_T_CHIPFAN 0x05 /* chip fan */ 1493 #define SMB_COOLDEV_T_CABFAN 0x06 /* cabinet fan */ 1494 #define SMB_COOLDEV_T_PSFAN 0x07 /* power supply fan */ 1495 #define SMB_COOLDEV_T_HEATPIPE 0x08 /* head pipe */ 1496 #define SMB_COOLDEV_T_IREFRIG 0x09 /* integrated refrigeration */ 1497 #define SMB_COOLDEV_T_ACTCOOL 0x10 /* active cooling */ 1498 #define SMB_COOLDEV_T_PASSCOOL 0x11 /* passive cooling */ 1499 1500 /* 1501 * SMBIOS Temperature Probe. See DSP0134 Section 7.29 for more information. 1502 * Please see the specification for the units of each value. 1503 */ 1504 typedef struct smbios_tprobe { 1505 const char *smbtp_description; /* description information */ 1506 uint8_t smbtp_location; /* probe location */ 1507 uint8_t smbtp_status; /* probe status */ 1508 uint16_t smbtp_maxval; /* maximum temperature */ 1509 uint16_t smbtp_minval; /* minimum temperature */ 1510 uint16_t smbtp_resolution; /* probe resolution */ 1511 uint16_t smbtp_tolerance; /* probe tolerance */ 1512 uint16_t smbtp_accuracy; /* probe accuracy */ 1513 uint32_t smbtp_oem; /* vendor-specific data */ 1514 uint16_t smbtp_nominal; /* nominal value */ 1515 } smbios_tprobe_t; 1516 1517 #define SMB_TPROBE_S_OTHER 0x01 /* other */ 1518 #define SMB_TPROBE_S_UNKNOWN 0x02 /* unknown */ 1519 #define SMB_TPROBE_S_OK 0x03 /* OK */ 1520 #define SMB_TPROBE_S_NONCRIT 0x04 /* non-critical */ 1521 #define SMB_TPROBE_S_CRIT 0x05 /* critical */ 1522 #define SMB_TPROBE_S_NONRECOV 0x06 /* non-recoverable */ 1523 1524 #define SMB_TPROBE_L_OTHER 0x01 /* other */ 1525 #define SMB_TPROBE_L_UNKNOWN 0x02 /* unknown */ 1526 #define SMB_TPROBE_L_PROC 0x03 /* processor */ 1527 #define SMB_TPROBE_L_DISK 0x04 /* disk */ 1528 #define SMB_TPROBE_L_PBAY 0x05 /* peripheral bay */ 1529 #define SMB_TPROBE_L_MGMT 0x06 /* system management module */ 1530 #define SMB_TPROBE_L_MOBO 0x07 /* motherboard */ 1531 #define SMB_TPROBE_L_MEMMOD 0x08 /* memory module */ 1532 #define SMB_TPROBE_L_PROCMOD 0x09 /* processor module */ 1533 #define SMB_TPROBE_L_POWER 0x0a /* power unit */ 1534 #define SMB_TPROBE_L_AIC 0x0b /* add-in card */ 1535 #define SMB_TPROBE_L_FPBOARD 0x0c /* front panel board */ 1536 #define SMB_TPROBE_L_BPBOARD 0x0d /* rear panel board */ 1537 #define SMB_TPROBE_L_PSBOARD 0x0e /* power system board */ 1538 #define SMB_TPROBE_L_DBPANE 0x0f /* drive back plane */ 1539 1540 /* 1541 * SMBIOS Current Probe. See DSP0134 Section 7.30 for more information. 1542 * Please see the specification for the units of each value. 1543 */ 1544 typedef struct smbios_iprobe { 1545 const char *smbip_description; /* description information */ 1546 uint8_t smbip_location; /* probe location */ 1547 uint8_t smbip_status; /* probe status */ 1548 uint16_t smbip_maxval; /* maximum current */ 1549 uint16_t smbip_minval; /* minimum current */ 1550 uint16_t smbip_resolution; /* probe resolution */ 1551 uint16_t smbip_tolerance; /* probe tolerance */ 1552 uint16_t smbip_accuracy; /* probe accuracy */ 1553 uint32_t smbip_oem; /* vendor-specific data */ 1554 uint16_t smbip_nominal; /* nominal value */ 1555 } smbios_iprobe_t; 1556 1557 #define SMB_IPROBE_S_OTHER 0x01 /* other */ 1558 #define SMB_IPROBE_S_UNKNOWN 0x02 /* unknown */ 1559 #define SMB_IPROBE_S_OK 0x03 /* OK */ 1560 #define SMB_IPROBE_S_NONCRIT 0x04 /* non-critical */ 1561 #define SMB_IPROBE_S_CRIT 0x05 /* critical */ 1562 #define SMB_IPROBE_S_NONRECOV 0x06 /* non-recoverable */ 1563 1564 #define SMB_IPROBE_L_OTHER 0x01 /* other */ 1565 #define SMB_IPROBE_L_UNKNOWN 0x02 /* unknown */ 1566 #define SMB_IPROBE_L_PROC 0x03 /* processor */ 1567 #define SMB_IPROBE_L_DISK 0x04 /* disk */ 1568 #define SMB_IPROBE_L_PBAY 0x05 /* peripheral bay */ 1569 #define SMB_IPROBE_L_MGMT 0x06 /* system management module */ 1570 #define SMB_IPROBE_L_MOBO 0x07 /* motherboard */ 1571 #define SMB_IPROBE_L_MEMMOD 0x08 /* memory module */ 1572 #define SMB_IPROBE_L_PROCMOD 0x09 /* processor module */ 1573 #define SMB_IPROBE_L_POWER 0x0a /* power unit */ 1574 #define SMB_IPROBE_L_AIC 0x0b /* add-in card */ 1575 1576 /* 1577 * SMBIOS System Boot Information. See DSP0134 Section 7.33 for more 1578 * information. The contents of the data varies by type and is undocumented 1579 * from the perspective of DSP0134 -- it seems to be left as vendor-specific. 1580 * The (D) annotation next to SMB_BOOT_* below indicates possible data payload. 1581 */ 1582 typedef struct smbios_boot { 1583 uint8_t smbt_status; /* boot status code (see below) */ 1584 const void *smbt_data; /* data buffer specific to status */ 1585 size_t smbt_size; /* size of smbt_data buffer in bytes */ 1586 } smbios_boot_t; 1587 1588 #define SMB_BOOT_NORMAL 0 /* no errors detected */ 1589 #define SMB_BOOT_NOMEDIA 1 /* no bootable media */ 1590 #define SMB_BOOT_OSFAIL 2 /* normal o/s failed to load */ 1591 #define SMB_BOOT_FWHWFAIL 3 /* firmware-detected hardware failure */ 1592 #define SMB_BOOT_OSHWFAIL 4 /* o/s-detected hardware failure */ 1593 #define SMB_BOOT_USERREQ 5 /* user-requested boot (keystroke) */ 1594 #define SMB_BOOT_SECURITY 6 /* system security violation */ 1595 #define SMB_BOOT_PREVREQ 7 /* previously requested image (D) */ 1596 #define SMB_BOOT_WATCHDOG 8 /* watchdog initiated reboot */ 1597 #define SMB_BOOT_RESV_LO 9 /* low end of reserved range */ 1598 #define SMB_BOOT_RESV_HI 127 /* high end of reserved range */ 1599 #define SMB_BOOT_OEM_LO 128 /* low end of OEM-specific range */ 1600 #define SMB_BOOT_OEM_HI 191 /* high end of OEM-specific range */ 1601 #define SMB_BOOT_PROD_LO 192 /* low end of product-specific range */ 1602 #define SMB_BOOT_PROD_HI 255 /* high end of product-specific range */ 1603 1604 /* 1605 * SMBIOS IPMI Device Information. See DSP0134 Section 7.39 and also 1606 * Appendix C1 of the IPMI specification for more information on this record. 1607 */ 1608 typedef struct smbios_ipmi { 1609 uint_t smbip_type; /* BMC interface type */ 1610 smbios_version_t smbip_vers; /* BMC's IPMI specification version */ 1611 uint32_t smbip_i2c; /* BMC I2C bus slave address */ 1612 uint32_t smbip_bus; /* bus ID of NV storage device, or -1 */ 1613 uint64_t smbip_addr; /* BMC base address */ 1614 uint32_t smbip_flags; /* flags (see below) */ 1615 uint16_t smbip_intr; /* interrupt number (or zero if none) */ 1616 uint16_t smbip_regspacing; /* i/o space register spacing (bytes) */ 1617 } smbios_ipmi_t; 1618 1619 #define SMB_IPMI_T_UNKNOWN 0x00 /* unknown */ 1620 #define SMB_IPMI_T_KCS 0x01 /* KCS: Keyboard Controller Style */ 1621 #define SMB_IPMI_T_SMIC 0x02 /* SMIC: Server Mgmt Interface Chip */ 1622 #define SMB_IPMI_T_BT 0x03 /* BT: Block Transfer */ 1623 #define SMB_IPMI_T_SSIF 0x04 /* SSIF: SMBus System Interface */ 1624 1625 #define SMB_IPMI_F_IOADDR 0x01 /* base address is in i/o space */ 1626 #define SMB_IPMI_F_INTRSPEC 0x02 /* intr information is specified */ 1627 #define SMB_IPMI_F_INTRHIGH 0x04 /* intr active high (else low) */ 1628 #define SMB_IPMI_F_INTREDGE 0x08 /* intr is edge triggered (else lvl) */ 1629 1630 /* 1631 * SMBIOS System Power Supply Information. See DSP0134 7.40 for more 1632 * information. 1633 */ 1634 typedef struct smbios_powersup { 1635 uint32_t smbps_group; /* group ID */ 1636 uint64_t smbps_maxout; /* max output in milliwatts */ 1637 uint32_t smbps_flags; /* see below */ 1638 uint8_t smbps_ivrs; /* input voltage range switching type */ 1639 uint8_t smbps_status; /* PSU status */ 1640 uint8_t smbps_pstype; /* PSU type */ 1641 id_t smbps_vprobe; /* voltage probe handle */ 1642 id_t smbps_cooldev; /* cooling device handle */ 1643 id_t smbps_iprobe; /* current probe handle */ 1644 } smbios_powersup_t; 1645 1646 /* smbpfs_flags */ 1647 #define SMB_POWERSUP_F_HOT 0x01 /* PSU is hot-replaceable */ 1648 #define SMB_POWERSUP_F_PRESENT 0x02 /* PSU is present */ 1649 #define SMB_POWERSUP_F_UNPLUG 0x04 /* PSU is unplugged from outlet */ 1650 1651 /* Values for smbps_ivrs */ 1652 #define SMB_POWERSUP_I_OTHER 0x01 /* other */ 1653 #define SMB_POWERSUP_I_UNKNOWN 0x02 /* unknown */ 1654 #define SMB_POWERSUP_I_MANUAL 0x03 /* manual */ 1655 #define SMB_POWERSUP_I_AUTO 0x04 /* auto-switch */ 1656 #define SMB_POWERSUP_I_WIDE 0x05 /* wide range */ 1657 #define SMB_POWERSUP_I_NA 0x06 /* not applicable */ 1658 1659 #define SMB_POWERSUP_S_OTHER 0x01 /* other */ 1660 #define SMB_POWERSUP_S_UNKNOWN 0x02 /* unknown */ 1661 #define SMB_POWERSUP_S_OK 0x03 /* OK */ 1662 #define SMB_POWERSUP_S_NONCRIT 0x04 /* non-critical */ 1663 #define SMB_POWERSUP_S_CRIT 0x05 /* critical; PSU failed */ 1664 1665 #define SMB_POWERSUP_T_OTHER 0x01 /* other */ 1666 #define SMB_POWERSUP_T_UNKNOWN 0x02 /* unknown */ 1667 #define SMB_POWERSUP_T_LINEAR 0x03 /* linear */ 1668 #define SMB_POWERSUP_T_SWITCH 0x04 /* switching */ 1669 #define SMB_POWERSUP_T_BAT 0x05 /* battery */ 1670 #define SMB_POWERSUP_T_UPS 0x06 /* UPS */ 1671 #define SMB_POWERSUP_T_CONV 0x07 /* converter */ 1672 #define SMB_POWERSUP_T_REGL 0x08 /* regulator */ 1673 1674 /* 1675 * SMBIOS Onboard Devices Extended Information. See DSP0134 Section 7.42 1676 * for more information. 1677 */ 1678 typedef struct smbios_obdev_ext { 1679 const char *smboe_name; /* reference designation */ 1680 uint8_t smboe_dtype; /* device type */ 1681 uint8_t smboe_dti; /* device type instance */ 1682 uint16_t smboe_sg; /* segment group number */ 1683 uint8_t smboe_bus; /* bus number */ 1684 uint8_t smboe_df; /* device/function number */ 1685 } smbios_obdev_ext_t; 1686 1687 /* 1688 * SMBIOS Processor Additional Information (Type 44). See sectoin 7.45 for more 1689 * information. 1690 */ 1691 typedef struct smbios_processor_info { 1692 id_t smbpi_processor; /* processor handle */ 1693 uint32_t smbpi_ptype; /* processor type */ 1694 } smbios_processor_info_t; 1695 1696 /* BEGIN CSTYLED */ 1697 #define SMB_PROCINFO_T_RESERVED 0x00 /* reserved */ 1698 #define SMB_PROCINFO_T_IA32 0x01 /* IA32 (x86) */ 1699 #define SMB_PROCINFO_T_AMD64 0x02 /* X64 (x86-64, Intel64, AMD64, EMT64) */ 1700 #define SMB_PROCINFO_T_IA 0x03 /* Intel Itanium architecture */ 1701 #define SMB_PROCINFO_T_AARCH32 0x04 /* 32-bit ARM (aarch32) */ 1702 #define SMB_PROCINFO_T_AARCH64 0x05 /* 64-bit ARM (aarch64) */ 1703 #define SMB_PROCINFO_T_RV32 0x06 /* 32-bit RISC-V (RV32) */ 1704 #define SMB_PROCINFO_T_RV64 0x07 /* 64-bit RISC-V (RV64) */ 1705 #define SMB_PROCINFO_T_RV128 0x08 /* 128-bit RISC-V (RV128) */ 1706 /* END CSTYLED */ 1707 1708 typedef struct smbios_processor_info_riscv { 1709 uint8_t smbpirv_hartid[16]; /* HART ID */ 1710 uint8_t smbpirv_vendid[16]; /* Vendor ID */ 1711 uint8_t smbpirv_archid[16]; /* Architecture ID */ 1712 uint8_t smbpirv_machid[16]; /* Machine ID */ 1713 uint8_t smbpirv_metdi[16]; /* Machine exception delegation */ 1714 uint8_t smbpirv_mitdi[16]; /* Machine interrupt delegation */ 1715 uint64_t smbpirv_isa; /* Supported ISA */ 1716 uint32_t smbpirv_privlvl; /* Privilege Level */ 1717 uint8_t smbpirv_boothart; /* Indicates if boot processor */ 1718 uint8_t smbpirv_xlen; /* Default register width */ 1719 uint8_t smbpirv_mxlen; /* Machine register width */ 1720 uint8_t smbpirv_sxlen; /* Supervisor register width */ 1721 uint8_t smbpirv_uxlen; /* User register width */ 1722 } smbios_processor_info_riscv_t; 1723 1724 /* 1725 * RISC-V Supported Privilege Levels 1726 */ 1727 #define SMB_RV_PRIV_M (1 << 0) /* Machine Mode */ 1728 #define SMB_RV_PRIV_S (1 << 2) /* Supervisor Mode */ 1729 #define SMB_RV_PRIV_U (1 << 3) /* User Mode */ 1730 #define SMB_RV_PRIV_DBG (1 << 7) /* Debug Mode */ 1731 1732 /* 1733 * Values used to define the various XLEN Values. 1734 */ 1735 #define SMB_RV_WIDTH_UNSUP 0x00 /* Unsupported */ 1736 #define SMB_RV_WIDTH_32B 0x01 /* 32-bit */ 1737 #define SMB_RV_WIDTH_64B 0x02 /* 64-bit */ 1738 #define SMB_RV_WIDTH_128B 0x03 /* 128-bit */ 1739 1740 /* 1741 * RISC-V ISA extensions 1742 */ 1743 /* BEGIN CSTYLED */ 1744 #define SMB_RV_ISA_A (1 << 0) /* Atomic */ 1745 #define SMB_RV_ISA_B (1 << 1) /* Reserved */ 1746 #define SMB_RV_ISA_C (1 << 2) /* Compressed */ 1747 #define SMB_RV_ISA_D (1 << 3) /* Double-precision floating-point */ 1748 #define SMB_RV_ISA_E (1 << 4) /* RV32E base */ 1749 #define SMB_RV_ISA_F (1 << 5) /* Single-precision floating-point */ 1750 #define SMB_RV_ISA_G (1 << 6) /* Additional standard extensions present */ 1751 #define SMB_RV_ISA_H (1 << 7) /* Hypervisor */ 1752 #define SMB_RV_ISA_I (1 << 8) /* Integer base ISA */ 1753 #define SMB_RV_ISA_J (1 << 9) /* Reserved */ 1754 #define SMB_RV_ISA_K (1 << 10) /* Reserved */ 1755 #define SMB_RV_ISA_L (1 << 11) /* Reserved */ 1756 #define SMB_RV_ISA_M (1 << 12) /* Integer Multiply/Divide */ 1757 #define SMB_RV_ISA_N (1 << 13) /* User-level interrupts */ 1758 #define SMB_RV_ISA_O (1 << 14) /* Reserved */ 1759 #define SMB_RV_ISA_P (1 << 15) /* Reserved */ 1760 #define SMB_RV_ISA_Q (1 << 16) /* Quad-precision floating-poit */ 1761 #define SMB_RV_ISA_R (1 << 17) /* Reserved */ 1762 #define SMB_RV_ISA_S (1 << 18) /* Supervisor mode */ 1763 #define SMB_RV_ISA_T (1 << 19) /* Reserved */ 1764 #define SMB_RV_ISA_U (1 << 20) /* User mode */ 1765 #define SMB_RV_ISA_V (1 << 21) /* Reserved */ 1766 #define SMB_RV_ISA_W (1 << 22) /* Reserved */ 1767 #define SMB_RV_ISA_X (1 << 23) /* Non-standard extensions */ 1768 #define SMB_RV_ISA_Y (1 << 24) /* Reserved */ 1769 #define SMB_RV_ISA_Z (1 << 25) /* Reserved */ 1770 /* END CSTYLED */ 1771 1772 /* 1773 * SMBIOS OEM-specific (Type 132) Processor Extended Information. 1774 */ 1775 typedef struct smbios_processor_ext { 1776 uint16_t smbpe_processor; /* extending processor handle */ 1777 uint8_t smbpe_fru; /* FRU indicaor */ 1778 uint8_t smbpe_n; /* number of APIC IDs */ 1779 uint16_t *smbpe_apicid; /* strand Inital APIC IDs */ 1780 } smbios_processor_ext_t; 1781 1782 /* 1783 * SMBIOS OEM-specific (Type 136) Port Extended Information. 1784 */ 1785 typedef struct smbios_port_ext { 1786 uint16_t smbporte_chassis; /* chassis handle */ 1787 uint16_t smbporte_port; /* port connector handle */ 1788 uint8_t smbporte_dtype; /* device type */ 1789 uint16_t smbporte_devhdl; /* device handle */ 1790 uint8_t smbporte_phy; /* PHY number */ 1791 } smbios_port_ext_t; 1792 1793 /* 1794 * SMBIOS OEM-specific (Type 138) PCI-Express RC/RP Information. 1795 */ 1796 typedef struct smbios_pciexrc { 1797 uint16_t smbpcie_bb; /* base board handle */ 1798 uint16_t smbpcie_bdf; /* Bus/Dev/Funct (PCI) */ 1799 } smbios_pciexrc_t; 1800 1801 /* 1802 * SMBIOS OEM-specific (Type 144) Memory Array Extended Information. 1803 */ 1804 typedef struct smbios_memarray_ext { 1805 uint16_t smbmae_ma; /* memory array handle */ 1806 uint16_t smbmae_comp; /* component parent handle */ 1807 uint16_t smbmae_bdf; /* Bus/Dev/Funct (PCI) */ 1808 } smbios_memarray_ext_t; 1809 1810 /* 1811 * SMBIOS OEM-specific (Type 145) Memory Device Extended Information. 1812 */ 1813 typedef struct smbios_memdevice_ext { 1814 uint16_t smbmdeve_md; /* memory device handle */ 1815 uint8_t smbmdeve_drch; /* DRAM channel */ 1816 uint8_t smbmdeve_ncs; /* number of chip selects */ 1817 uint8_t *smbmdeve_cs; /* array of chip select numbers */ 1818 } smbios_memdevice_ext_t; 1819 1820 /* 1821 * SMBIOS Interfaces. An SMBIOS image can be opened by either providing a file 1822 * pathname, device pathname, file descriptor, or raw memory buffer. Once an 1823 * image is opened the functions below can be used to iterate over the various 1824 * structures and convert the underlying data representation into the simpler 1825 * data structures described earlier in this header file. The SMB_VERSION 1826 * constant specified when opening an image indicates the version of the ABI 1827 * the caller expects and the DMTF SMBIOS version the client can understand. 1828 * The library will then map older or newer data structures to that as needed. 1829 */ 1830 1831 #define SMB_VERSION_23 0x0203 /* SMBIOS encoding for DMTF spec 2.3 */ 1832 #define SMB_VERSION_24 0x0204 /* SMBIOS encoding for DMTF spec 2.4 */ 1833 #define SMB_VERSION_25 0x0205 /* SMBIOS encoding for DMTF spec 2.5 */ 1834 #define SMB_VERSION_26 0x0206 /* SMBIOS encoding for DMTF spec 2.6 */ 1835 #define SMB_VERSION_27 0x0207 /* SMBIOS encoding for DMTF spec 2.7 */ 1836 #define SMB_VERSION_28 0x0208 /* SMBIOS encoding for DMTF spec 2.8 */ 1837 #define SMB_VERSION_30 0x0300 /* SMBIOS encoding for DMTF spec 3.0 */ 1838 #define SMB_VERSION_31 0x0301 /* SMBIOS encoding for DMTF spec 3.1 */ 1839 #define SMB_VERSION_32 0x0302 /* SMBIOS encoding for DMTF spec 3.2 */ 1840 #define SMB_VERSION_33 0x0303 /* SMBIOS encoding for DMTF spec 3.3 */ 1841 #define SMB_VERSION SMB_VERSION_33 /* SMBIOS latest version definitions */ 1842 1843 #define SMB_O_NOCKSUM 0x1 /* do not verify header checksums */ 1844 #define SMB_O_NOVERS 0x2 /* do not verify header versions */ 1845 #define SMB_O_ZIDS 0x4 /* strip out identification numbers */ 1846 #define SMB_O_MASK 0x7 /* mask of valid smbios_*open flags */ 1847 1848 #define SMB_ID_NOTSUP 0xFFFE /* structure is not supported by BIOS */ 1849 #define SMB_ID_NONE 0xFFFF /* structure is a null reference */ 1850 1851 #define SMB_ERR (-1) /* id_t value indicating error */ 1852 1853 typedef struct smbios_hdl smbios_hdl_t; 1854 1855 typedef struct smbios_struct { 1856 id_t smbstr_id; /* structure ID handle */ 1857 uint_t smbstr_type; /* structure type */ 1858 const void *smbstr_data; /* structure data */ 1859 size_t smbstr_size; /* structure size */ 1860 } smbios_struct_t; 1861 1862 typedef int smbios_struct_f(smbios_hdl_t *, 1863 const smbios_struct_t *, void *); 1864 1865 extern smbios_hdl_t *smbios_open(const char *, int, int, int *); 1866 extern smbios_hdl_t *smbios_fdopen(int, int, int, int *); 1867 extern smbios_hdl_t *smbios_bufopen(const smbios_entry_t *, 1868 const void *, size_t, int, int, int *); 1869 1870 extern const void *smbios_buf(smbios_hdl_t *); 1871 extern size_t smbios_buflen(smbios_hdl_t *); 1872 1873 extern void smbios_checksum(smbios_hdl_t *, smbios_entry_t *); 1874 extern int smbios_write(smbios_hdl_t *, int); 1875 extern void smbios_close(smbios_hdl_t *); 1876 1877 extern boolean_t smbios_truncated(smbios_hdl_t *); 1878 extern int smbios_errno(smbios_hdl_t *); 1879 extern const char *smbios_errmsg(int); 1880 1881 extern int smbios_lookup_id(smbios_hdl_t *, id_t, smbios_struct_t *); 1882 extern int smbios_lookup_type(smbios_hdl_t *, uint_t, smbios_struct_t *); 1883 extern int smbios_iter(smbios_hdl_t *, smbios_struct_f *, void *); 1884 1885 extern smbios_entry_point_t smbios_info_smbios(smbios_hdl_t *, 1886 smbios_entry_t *); 1887 extern void smbios_info_smbios_version(smbios_hdl_t *, smbios_version_t *); 1888 extern int smbios_info_common(smbios_hdl_t *, id_t, smbios_info_t *); 1889 extern int smbios_info_contains(smbios_hdl_t *, id_t, uint_t, id_t *); 1890 extern id_t smbios_info_bios(smbios_hdl_t *, smbios_bios_t *); 1891 extern id_t smbios_info_system(smbios_hdl_t *, smbios_system_t *); 1892 extern int smbios_info_bboard(smbios_hdl_t *, id_t, smbios_bboard_t *); 1893 extern int smbios_info_chassis(smbios_hdl_t *, id_t, smbios_chassis_t *); 1894 extern int smbios_info_processor(smbios_hdl_t *, id_t, smbios_processor_t *); 1895 extern int smbios_info_extprocessor(smbios_hdl_t *, id_t, 1896 smbios_processor_ext_t *); 1897 extern int smbios_info_cache(smbios_hdl_t *, id_t, smbios_cache_t *); 1898 extern int smbios_info_pointdev(smbios_hdl_t *, id_t, smbios_pointdev_t *); 1899 extern int smbios_info_battery(smbios_hdl_t *, id_t, smbios_battery_t *); 1900 extern int smbios_info_port(smbios_hdl_t *, id_t, smbios_port_t *); 1901 extern int smbios_info_extport(smbios_hdl_t *, id_t, smbios_port_ext_t *); 1902 extern int smbios_info_slot(smbios_hdl_t *, id_t, smbios_slot_t *); 1903 extern int smbios_info_slot_peers(smbios_hdl_t *, id_t, uint_t *, 1904 smbios_slot_peer_t **); 1905 extern void smbios_info_slot_peers_free(smbios_hdl_t *, uint_t, 1906 smbios_slot_peer_t *); 1907 extern int smbios_info_obdevs(smbios_hdl_t *, id_t, int, smbios_obdev_t *); 1908 extern int smbios_info_obdevs_ext(smbios_hdl_t *, id_t, smbios_obdev_ext_t *); 1909 extern int smbios_info_strtab(smbios_hdl_t *, id_t, int, const char *[]); 1910 extern id_t smbios_info_lang(smbios_hdl_t *, smbios_lang_t *); 1911 extern id_t smbios_info_eventlog(smbios_hdl_t *, smbios_evlog_t *); 1912 extern int smbios_info_memarray(smbios_hdl_t *, id_t, smbios_memarray_t *); 1913 extern int smbios_info_extmemarray(smbios_hdl_t *, id_t, 1914 smbios_memarray_ext_t *); 1915 extern int smbios_info_memarrmap(smbios_hdl_t *, id_t, smbios_memarrmap_t *); 1916 extern int smbios_info_memdevice(smbios_hdl_t *, id_t, smbios_memdevice_t *); 1917 extern int smbios_info_extmemdevice(smbios_hdl_t *, id_t, 1918 smbios_memdevice_ext_t *); 1919 extern int smbios_info_memdevmap(smbios_hdl_t *, id_t, smbios_memdevmap_t *); 1920 extern id_t smbios_info_hwsec(smbios_hdl_t *, smbios_hwsec_t *); 1921 extern int smbios_info_vprobe(smbios_hdl_t *, id_t, smbios_vprobe_t *); 1922 extern int smbios_info_cooldev(smbios_hdl_t *, id_t, smbios_cooldev_t *); 1923 extern int smbios_info_tprobe(smbios_hdl_t *, id_t, smbios_tprobe_t *); 1924 extern int smbios_info_iprobe(smbios_hdl_t *, id_t, smbios_iprobe_t *); 1925 extern id_t smbios_info_boot(smbios_hdl_t *, smbios_boot_t *); 1926 extern id_t smbios_info_ipmi(smbios_hdl_t *, smbios_ipmi_t *); 1927 extern int smbios_info_powersup(smbios_hdl_t *, id_t, smbios_powersup_t *); 1928 extern int smbios_info_pciexrc(smbios_hdl_t *, id_t, smbios_pciexrc_t *); 1929 extern int smbios_info_processor_info(smbios_hdl_t *, id_t, 1930 smbios_processor_info_t *); 1931 extern int smbios_info_processor_riscv(smbios_hdl_t *, id_t, 1932 smbios_processor_info_riscv_t *); 1933 1934 1935 extern const char *smbios_psn(smbios_hdl_t *); 1936 extern const char *smbios_csn(smbios_hdl_t *); 1937 1938 #ifndef _KERNEL 1939 /* 1940 * The smbios_*_desc() and smbios_*_name() interfaces can be used for utilities 1941 * such as smbios(1M) that wish to decode SMBIOS fields for humans. The _desc 1942 * functions return the comment string next to the #defines listed above, and 1943 * the _name functions return the appropriate #define identifier itself. 1944 */ 1945 extern const char *smbios_battery_chem_desc(uint_t); 1946 1947 extern const char *smbios_bboard_flag_desc(uint_t); 1948 extern const char *smbios_bboard_flag_name(uint_t); 1949 extern const char *smbios_bboard_type_desc(uint_t); 1950 1951 extern const char *smbios_bios_flag_desc(uint64_t); 1952 extern const char *smbios_bios_flag_name(uint64_t); 1953 1954 extern const char *smbios_bios_xb1_desc(uint_t); 1955 extern const char *smbios_bios_xb1_name(uint_t); 1956 extern const char *smbios_bios_xb2_desc(uint_t); 1957 extern const char *smbios_bios_xb2_name(uint_t); 1958 1959 extern const char *smbios_boot_desc(uint_t); 1960 1961 extern const char *smbios_cache_assoc_desc(uint_t); 1962 extern const char *smbios_cache_ctype_desc(uint_t); 1963 extern const char *smbios_cache_ctype_name(uint_t); 1964 extern const char *smbios_cache_ecc_desc(uint_t); 1965 extern const char *smbios_cache_flag_desc(uint_t); 1966 extern const char *smbios_cache_flag_name(uint_t); 1967 extern const char *smbios_cache_loc_desc(uint_t); 1968 extern const char *smbios_cache_logical_desc(uint_t); 1969 extern const char *smbios_cache_mode_desc(uint_t); 1970 1971 extern const char *smbios_chassis_state_desc(uint_t); 1972 extern const char *smbios_chassis_type_desc(uint_t); 1973 1974 extern const char *smbios_evlog_flag_desc(uint_t); 1975 extern const char *smbios_evlog_flag_name(uint_t); 1976 extern const char *smbios_evlog_format_desc(uint_t); 1977 extern const char *smbios_evlog_method_desc(uint_t); 1978 1979 extern const char *smbios_vprobe_loc_desc(uint_t); 1980 extern const char *smbios_vprobe_status_desc(uint_t); 1981 1982 extern const char *smbios_cooldev_status_desc(uint_t); 1983 extern const char *smbios_cooldev_type_desc(uint_t); 1984 1985 extern const char *smbios_tprobe_loc_desc(uint_t); 1986 extern const char *smbios_tprobe_status_desc(uint_t); 1987 1988 extern const char *smbios_iprobe_loc_desc(uint_t); 1989 extern const char *smbios_iprobe_status_desc(uint_t); 1990 1991 extern const char *smbios_ipmi_flag_name(uint_t); 1992 extern const char *smbios_ipmi_flag_desc(uint_t); 1993 extern const char *smbios_ipmi_type_desc(uint_t); 1994 1995 extern const char *smbios_powersup_flag_name(uint_t); 1996 extern const char *smbios_powersup_flag_desc(uint_t); 1997 extern const char *smbios_powersup_input_desc(uint_t); 1998 extern const char *smbios_powersup_status_desc(uint_t); 1999 extern const char *smbios_powersup_type_desc(uint_t); 2000 2001 extern const char *smbios_hwsec_desc(uint_t); 2002 2003 extern const char *smbios_memarray_loc_desc(uint_t); 2004 extern const char *smbios_memarray_use_desc(uint_t); 2005 extern const char *smbios_memarray_ecc_desc(uint_t); 2006 2007 extern const char *smbios_memdevice_form_desc(uint_t); 2008 extern const char *smbios_memdevice_type_desc(uint_t); 2009 extern const char *smbios_memdevice_flag_name(uint_t); 2010 extern const char *smbios_memdevice_flag_desc(uint_t); 2011 extern const char *smbios_memdevice_rank_desc(uint_t); 2012 extern const char *smbios_memdevice_memtech_desc(uint_t); 2013 extern const char *smbios_memdevice_op_capab_name(uint_t); 2014 extern const char *smbios_memdevice_op_capab_desc(uint_t); 2015 2016 extern const char *smbios_onboard_type_desc(uint_t); 2017 2018 extern const char *smbios_pointdev_iface_desc(uint_t); 2019 extern const char *smbios_pointdev_type_desc(uint_t); 2020 2021 extern const char *smbios_port_conn_desc(uint_t); 2022 extern const char *smbios_port_type_desc(uint_t); 2023 2024 extern const char *smbios_processor_family_desc(uint_t); 2025 extern const char *smbios_processor_status_desc(uint_t); 2026 extern const char *smbios_processor_type_desc(uint_t); 2027 extern const char *smbios_processor_upgrade_desc(uint_t); 2028 extern const char *smbios_processor_core_flag_name(uint_t); 2029 extern const char *smbios_processor_core_flag_desc(uint_t); 2030 2031 extern const char *smbios_processor_info_type_desc(uint_t); 2032 extern const char *smbios_riscv_isa_desc(uint64_t); 2033 extern const char *smbios_riscv_isa_name(uint64_t); 2034 extern const char *smbios_riscv_priv_desc(uint_t); 2035 extern const char *smbios_riscv_priv_name(uint_t); 2036 extern const char *smbios_riscv_width_desc(uint_t); 2037 2038 extern const char *smbios_slot_type_desc(uint_t); 2039 extern const char *smbios_slot_width_desc(uint_t); 2040 extern const char *smbios_slot_usage_desc(uint_t); 2041 extern const char *smbios_slot_length_desc(uint_t); 2042 extern const char *smbios_slot_ch1_desc(uint_t); 2043 extern const char *smbios_slot_ch1_name(uint_t); 2044 extern const char *smbios_slot_ch2_desc(uint_t); 2045 extern const char *smbios_slot_ch2_name(uint_t); 2046 2047 extern const char *smbios_type_desc(uint_t); 2048 extern const char *smbios_type_name(uint_t); 2049 2050 extern const char *smbios_system_wakeup_desc(uint_t); 2051 #endif /* !_KERNEL */ 2052 2053 #ifdef _KERNEL 2054 /* 2055 * For SMBIOS clients within the kernel itself, ksmbios is used to refer to 2056 * the kernel's current snapshot of the SMBIOS, if one exists, and the 2057 * ksmbios_flags tunable is the set of flags for use with smbios_open(). 2058 */ 2059 extern smbios_hdl_t *ksmbios; 2060 extern int ksmbios_flags; 2061 #endif /* _KERNEL */ 2062 2063 #ifdef __cplusplus 2064 } 2065 #endif 2066 2067 #endif /* _SYS_SMBIOS_H */ 2068