smbios_impl.h revision 84ab085a13f931bc78e7415e7ce921dbaa14fcb3
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * CDDL HEADER START
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * The contents of this file are subject to the terms of the
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * Common Development and Distribution License, Version 1.0 only
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * (the "License"). You may not use this file except in compliance
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * with the License.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * See the License for the specific language governing permissions
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * and limitations under the License.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * When distributing Covered Code, include this CDDL HEADER in each
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * If applicable, add the following below this CDDL HEADER, with the
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * fields enclosed by brackets "[]" replaced with your own identifying
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * information: Portions Copyright [yyyy] [name of copyright owner]
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * CDDL HEADER END
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * Use is subject to license terms.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * This header file defines the implementation structures for the SMBIOS access
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * library, libsmbios, and an equivalent kernel module. Clients should use
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * the <smbios.h> or <sys/smbios.h> header files to access DMTF SMBIOS
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * information, NOT these underlying implementation structures from the spec.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * In short, do not user this header file or these routines for any purpose.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#pragma ident "%Z%%M% %I% %E% SMI"
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern "C" {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_header {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbh_type; /* structure type (SMB_TYPE_* value) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbh_len; /* length in bytes of formatted area */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_bios {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbbi_segment; /* segment location of bios address */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbi_romsize; /* bios rom size (64k * (n + 1)) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbi_xcflags[1]; /* bios characteristics extensions */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_system {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_bboard {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_chassis {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_CHT_LOCK 0x80 /* lock bit within smbch_type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_processor {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_type; /* processor type (see <smbios.h>) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbpr_family; /* processor family (see <smbios.h>) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbpr_clkspeed; /* external clock speed in MHz */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_cache {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_port {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_slot {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_obdev {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_OBT_ENABLED 0x80 /* enable bit within smbob_type */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_strtab {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_lang {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smblang_num; /* number of installed languages */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_sel {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsel_typesz; /* size of each type descriptor */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbsel_typev[1]; /* array of type descriptors */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_memarray {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbmarr_ecc; /* error detect/correct mechanism */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbmarr_ndevs; /* number of slots or sockets */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_memarrmap {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbamap_start; /* starting address in kilobytes */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbamap_array; /* physical memory array handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_memdevice {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_MDS_KBYTES 0x8000 /* size in specified in kilobytes */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_memdevmap {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint32_t smbdmap_start; /* starting address in kilobytes */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t smbdmap_array; /* memory array mapped address handle */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_battery {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_hwsec {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_boot {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbbo_status[1]; /* variable-length status buffer */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_ipmi {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint8_t smbipm_info; /* base address modifier/intr info */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_powersup {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwstypedef struct smb_struct {
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws const smb_header_t *smbst_hdr; /* address of raw structure data */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws const uchar_t *smbst_str; /* address of string data (if any) */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws const uchar_t *smbst_end; /* address of 0x0000 ending tag */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws struct smb_struct *smbst_next; /* next structure in hash chain */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws uint16_t *smbst_strtab; /* string index -> offset table */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smbios_entry_t sh_ent; /* structure table entry point */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_struct_t *sh_structs; /* array of structure descriptors */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws smb_struct_t **sh_hash; /* hash bucket array for descriptors */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_FL_DEBUG 0x1 /* print debug messages for this hdl */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_FL_BUFALLOC 0x2 /* sh_buf was allocated by library */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_BIOS_DEVICE "/dev/xsvc" /* device w/ BIOS physmem */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_SMBIOS_DEVICE "/dev/smbios" /* device w/ SMBIOS image */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_RANGE_START 0xF0000 /* start of physical address range */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_RANGE_LIMIT 0xFFFFF /* limit of physical address range */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define SMB_MAJMIN(M, m) ((((M) & 0xFF) << 16) | ((m) & 0xFF))
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define ESMB_BASE 1000 /* base value for libsmbios errnos */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws ESMB_NOTFOUND = ESMB_BASE, /* SMBIOS table not found on system */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern const smb_struct_t *smb_lookup_type(smbios_hdl_t *, uint_t);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern const smb_struct_t *smb_lookup_id(smbios_hdl_t *, uint_t);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern const char *smb_strptr(const smb_struct_t *, uint_t);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern smbios_hdl_t *smb_open_error(smbios_hdl_t *, int *, int);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern const char *smb_strerror(int);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern void smb_dprintf(smbios_hdl_t *, const char *, ...);
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#endif /* _SYS_SMBIOS_IMPL_H */