#include <stdio.h>
#include <string.h>
#include "hd.h"
#include "hd_int.h"
#include "smbios.h"
Data Structures | |
struct | sm_num2str_t |
struct | sm_str_map_t |
Defines | |
#define | SMBIOS_PRINT_ID(a, b) smbios_id_print(f, &sm->a, b) |
#define | SMBIOS_PRINT_STR(a, b) smbios_str_print(f, sm->a, b) |
#define | SMBIOS_PRINT_BITMAP_SHORT(a, b) smbios_bitmap_print(f, &sm->a, b, 0) |
#define | SMBIOS_PRINT_BITMAP_LONG(a, b) smbios_bitmap_print(f, &sm->a, b, 1) |
#define | SMBIOS_DEF_MAP(a) |
#define | READ_MEM16(ptr) ((ptr)[0] + ((ptr)[1] << 8)) |
#define | READ_MEM32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) |
#define | READ_MEM64(ptr) (READ_MEM32(ptr) + ((uint64_t) READ_MEM32(ptr + 4) << 32)) |
#define | smbios_memarray_ecc smbios_cache_ecc |
Enumerations | |
enum | sm_map_type { sm_map_str, sm_map_num2str } |
Functions | |
static char * | get_string (str_list_t *sl, int index) |
static void | smbios_bitmap_print (FILE *f, hd_bitmap_t *hbm, char *label, int style) |
static void | smbios_id_print (FILE *f, hd_id_t *hid, char *label) |
static void | smbios_str_print (FILE *f, char *str, char *label) |
static void | smbios_id2str (hd_id_t *hid, sm_str_map_t *map, unsigned def) |
static void | smbios_bitmap2str (hd_bitmap_t *hbm, sm_str_map_t *map) |
SMBIOS_DEF_MAP (smbios_bios_feature) | |
SMBIOS_DEF_MAP (smbios_system_wakeups) | |
SMBIOS_DEF_MAP (smbios_board_feature) | |
SMBIOS_DEF_MAP (smbios_board_types) | |
SMBIOS_DEF_MAP (smbios_chassis_types) | |
SMBIOS_DEF_MAP (smbios_chassis_states) | |
SMBIOS_DEF_MAP (smbios_chassis_sec_states) | |
SMBIOS_DEF_MAP (smbios_proc_upgrades) | |
SMBIOS_DEF_MAP (smbios_proc_cpu_status) | |
SMBIOS_DEF_MAP (smbios_proc_types) | |
SMBIOS_DEF_MAP (smbios_proc_families) | |
SMBIOS_DEF_MAP (smbios_cache_mode) | |
SMBIOS_DEF_MAP (smbios_cache_location) | |
SMBIOS_DEF_MAP (smbios_cache_ecc) | |
SMBIOS_DEF_MAP (smbios_cache_type) | |
SMBIOS_DEF_MAP (smbios_cache_assoc) | |
SMBIOS_DEF_MAP (smbios_cache_sram) | |
SMBIOS_DEF_MAP (smbios_connect_conn_type) | |
SMBIOS_DEF_MAP (smbios_connect_port_type) | |
SMBIOS_DEF_MAP (smbios_slot_type) | |
SMBIOS_DEF_MAP (smbios_slot_bus_width) | |
SMBIOS_DEF_MAP (smbios_slot_usage) | |
SMBIOS_DEF_MAP (smbios_slot_length) | |
SMBIOS_DEF_MAP (smbios_slot_feature) | |
SMBIOS_DEF_MAP (smbios_onboard_type) | |
SMBIOS_DEF_MAP (smbios_memarray_location) | |
SMBIOS_DEF_MAP (smbios_memarray_use) | |
SMBIOS_DEF_MAP (smbios_mouse_type) | |
SMBIOS_DEF_MAP (smbios_mouse_interface) | |
SMBIOS_DEF_MAP (smbios_memdevice_form) | |
SMBIOS_DEF_MAP (smbios_memdevice_type) | |
SMBIOS_DEF_MAP (smbios_memdevice_detail) | |
SMBIOS_DEF_MAP (smbios_memerror_type) | |
SMBIOS_DEF_MAP (smbios_memerror_granularity) | |
SMBIOS_DEF_MAP (smbios_memerror_operation) | |
SMBIOS_DEF_MAP (smbios_secure_state) | |
void | smbios_parse (hd_data_t *hd_data) |
hd_smbios_t * | smbios_add_entry (hd_smbios_t **sm, hd_smbios_t *new_sm) |
hd_smbios_t * | smbios_free (hd_smbios_t *sm) |
void | smbios_dump (hd_data_t *hd_data, FILE *f) |
Variables | |
static sm_num2str_t | smbios_bios_feature_ [] |
static char * | smbios_system_wakeups_ [] |
static char * | smbios_board_feature_ [] |
static char * | smbios_board_types_ [] |
static char * | smbios_chassis_types_ [] |
static char * | smbios_chassis_states_ [] |
static char * | smbios_chassis_sec_states_ [] |
static char * | smbios_proc_upgrades_ [] |
static char * | smbios_proc_cpu_status_ [8] |
static char * | smbios_proc_types_ [] |
static sm_num2str_t | smbios_proc_families_ [] |
static char * | smbios_cache_mode_ [] |
static char * | smbios_cache_location_ [] |
static char * | smbios_cache_ecc_ [] |
static char * | smbios_cache_type_ [] |
static char * | smbios_cache_assoc_ [] |
static char * | smbios_cache_sram_ [] |
static sm_num2str_t | smbios_connect_conn_type_ [] |
static sm_num2str_t | smbios_connect_port_type_ [] |
static sm_num2str_t | smbios_slot_type_ [] |
static char * | smbios_slot_bus_width_ [] |
static char * | smbios_slot_usage_ [] |
static char * | smbios_slot_length_ [] |
static char * | smbios_slot_feature_ [] |
static char * | smbios_onboard_type_ [] |
static sm_num2str_t | smbios_memarray_location_ [] |
static char * | smbios_memarray_use_ [] |
static char * | smbios_mouse_type_ [] |
static sm_num2str_t | smbios_mouse_interface_ [] |
static char * | smbios_memdevice_form_ [] |
static char * | smbios_memdevice_type_ [] |
static char * | smbios_memdevice_detail_ [] |
static char * | smbios_memerror_type_ [] |
static char * | smbios_memerror_granularity_ [] |
static char * | smbios_memerror_operation_ [] |
static char * | smbios_secure_state_ [] |
|
|
|
|
|
|
|
Value: static sm_str_map_t a = { \ sizeof *a ## _ == sizeof (sm_num2str_t) ? sm_map_num2str : sm_map_str, \ sizeof a ## _ / sizeof *a ## _, \ { (void *) a ## _ } \ }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial value: { "Hosting Board", "Needs One Daughter Board", "Removable", "Replaceable", "Hot Swappable" } |
|
Initial value: { NULL, "Other", "Unknown", "Server Blade", "Connectivity Switch", "System Management Module", "Processor Module", "I/O Module", "Memory Module", "Daughter Board", "Motherboard", "Processor/Memory Module", "Processor/IO Module", "Interconnect Board" } |
|
Initial value: { NULL, "Other", "Unknown", "Direct Mapped", "2-way Set-Associative", "4-way Set-Associative", "Fully Associative", "8-way Set-Associative", "16-way Set-Associative" } |
|
Initial value: { NULL, "Other", "Unknown", "None", "Parity", "Single-bit", "Multi-bit", "CRC" } |
|
Initial value: { "Internal", "External", "Reserved", "Unknown" } |
|
Initial value: { "Write Through", "Write Back", "Varies with Memory Address", "Unknown" } |
|
Initial value: { "Other", "Unknown", "Non-Burst", "Burst", "Pipeline Burst", "Synchronous", "Asynchronous" } |
|
Initial value: { NULL, "Other", "Unknown", "Instruction", "Data", "Unified" } |
|
Initial value: { NULL, "Other", "Unknown", "None", "External interface locked out", "External interface enabled" } |
|
Initial value: { NULL, "Other", "Unknown", "Safe", "Warning", "Critical", "Non-recoverable" } |
|
Initial value: { NULL, "Other", "Unknown", "Desktop", "Low Profile Desktop", "Pizza Box", "Mini Tower", "Tower", "Portable", "LapTop", "Notebook", "Hand Held", "Docking Station", "All in One", "Sub Notebook", "Space Saving", "Lunch Box", "Main Server Chassis", "Expansion Chassis", "SubChassis", "Bus Expansion Chassis", "Peripheral Chassis", "RAID Chassis", "Rack Mount Chassis", "Sealed-case PC", "Multi-System Chassis" } |
|
|
|
|
|
Initial value: { { 0x00, NULL }, { 0x01, "Other" }, { 0x02, "Unknown" }, { 0x03, "Motherboard" }, { 0x04, "ISA add-on card" }, { 0x05, "EISA add-on card" }, { 0x06, "PCI add-on card" }, { 0x07, "MCA add-on card" }, { 0x08, "PCMCIA add-on card" }, { 0x09, "Proprietary add-on card" }, { 0x0a, "NuBus" }, { 0xa0, "PC-98/C20 add-on card" }, { 0xa1, "PC-98/C24 add-on card" }, { 0xa2, "PC-98/E add-on card" }, { 0xa3, "PC-98/Local bus add-on card" } } |
|
Initial value: { NULL, "Other", "Unknown", "System memory", "Video memory", "Flash memory", "Non-volatile RAM", "Cache memory" } |
|
Initial value: { NULL, "Other", "Unknown", "Fast-paged", "Static column", "Pseudo-static", "RAMBUS", "Synchronous", "CMOS", "EDO", "Window DRAM", "Cache DRAM", "Non-volatile" } |
|
Initial value: { NULL, "Other", "Unknown", "SIMM", "SIP", "Chip", "DIP", "ZIP", "Proprietary Card", "DIMM", "TSOP", "Row of Chips", "RIMM", "SODIMM", "SRIMM" } |
|
Initial value: { NULL, "Other", "Unknown", "DRAM", "EDRAM", "VRAM", "SRAM", "RAM", "ROM", "FLASH", "EEPROM", "FEPROM", "EPROM", "CDRAM", "3DRAM", "SDRAM", "SGRAM", "RDRAM", "DDR" } |
|
Initial value: { NULL, "Other", "Unknown", "Device level", "Memory partition level" } |
|
Initial value: { NULL, "Other", "Unknown", "Read", "Write", "Partial write" } |
|
Initial value: { NULL, "Other", "Unknown", "OK", "Bad read", "Parity error", "Single-bit error", "Double-bit error", "Multi-bit error", "Nibble error", "Checksum error", "CRC error", "Corrected single-bit error", "Corrected error", "Uncorrectable error" } |
|
Initial value: { { 0x00, NULL }, { 0x01, "Other" }, { 0x02, "Unknown" }, { 0x03, "Serial" }, { 0x04, "PS/2" }, { 0x05, "Infrared" }, { 0x06, "HP-HIL" }, { 0x07, "Bus Mouse" }, { 0x08, "ADB" }, { 0xa0, "Bus mouse DB-9" }, { 0xa1, "Bus mouse micro-DIN" }, { 0xa2, "USB" } } |
|
Initial value: { NULL, "Other", "Unknown", "Mouse", "Track Ball", "Track Point", "Glide Point", "Touch Pad", "Touch Screen", "Optical Sensor" } |
|
Initial value: { "Other", "Other", "Unknown", "Video", "SCSI Controller", "Ethernet", "Token Ring", "Sound" } |
|
Initial value: { "Unknown", "Enabled", "Disabled by User", "Disabled by BIOS", "Idle", "Reserved", "Reserved", "Other" } |
|
|
|
Initial value: { NULL, "Other", "Unknown", "CPU", "Math", "DSP", "Video" } |
|
Initial value: { NULL, "Other", "Unknown", "Daughter Board", "ZIF Socket", "Replaceable Piggy Back", "None", "LIF Socket", "Slot 1", "Slot 2", "370-Pin Socket", "Slot A", "Slot M", "Socket 423", "Socket A (Socket 462)", "Socket 478", "Socket 754", "Socket 940" } |
|
Initial value: { "Disabled", "Enabled", "Not Implemented", "Unknown" } |
|
Initial value: { NULL, "Other", "Unknown", "8 bit", "16 bit", "32 bit", "64 bit", "128 bit" } |
|
Initial value: { "Unknown", "5.0 V", "3.3 V", "Shared", "PC Card-16", "CardBus", "Zoom Video", "Modem Ring Resume", "PME#", "Hot-Plug" } |
|
Initial value: { NULL, "Other", "Unknown", "Short", "Long" } |
|
Initial value: { { 0x00, NULL }, { 0x01, "Other" }, { 0x02, "Unknown" }, { 0x03, "ISA" }, { 0x04, "MCA" }, { 0x05, "EISA" }, { 0x06, "PCI" }, { 0x07, "PC Card [PCMCIA]" }, { 0x08, "VL-VESA" }, { 0x09, "Proprietary" }, { 0x0a, "Processor Card" }, { 0x0b, "Proprietary Memory Card" }, { 0x0c, "I/O Riser Card" }, { 0x0d, "NuBus" }, { 0x0e, "PCI - 66MHz Capable" }, { 0x0f, "AGP" }, { 0x10, "AGP 2X" }, { 0x11, "AGP 4X" }, { 0x12, "PCI-X" }, { 0x13, "AGP 8X" }, { 0xa0, "PC-98/C20" }, { 0xa1, "PC-98/C24" }, { 0xa2, "PC-98/E" }, { 0xa3, "PC-98/Local Bus" }, { 0xa4, "PC-98/Card" } } |
|
Initial value: { NULL, "Other", "Unknown", "Available", "In Use" } |
|
Initial value: { "Reserved", "Other", "Unknown", "APM Timer", "Modem Ring", "LAN Remote", "Power Switch", "PCI PME#", "AC Power Restored" } |