qemu/include/hw/i386/smbios.h
<<
>>
Prefs
   1#ifndef QEMU_SMBIOS_H
   2#define QEMU_SMBIOS_H
   3/*
   4 * SMBIOS Support
   5 *
   6 * Copyright (C) 2009 Hewlett-Packard Development Company, L.P.
   7 *
   8 * Authors:
   9 *  Alex Williamson <alex.williamson@hp.com>
  10 *
  11 * This work is licensed under the terms of the GNU GPL, version 2.  See
  12 * the COPYING file in the top-level directory.
  13 *
  14 */
  15
  16#include "qemu/option.h"
  17
  18void smbios_entry_add(QemuOpts *opts);
  19uint8_t *smbios_get_table(size_t *length);
  20
  21/*
  22 * SMBIOS spec defined tables
  23 */
  24
  25/* This goes at the beginning of every SMBIOS structure. */
  26struct smbios_structure_header {
  27    uint8_t type;
  28    uint8_t length;
  29    uint16_t handle;
  30} QEMU_PACKED;
  31
  32/* SMBIOS type 0 - BIOS Information */
  33struct smbios_type_0 {
  34    struct smbios_structure_header header;
  35    uint8_t vendor_str;
  36    uint8_t bios_version_str;
  37    uint16_t bios_starting_address_segment;
  38    uint8_t bios_release_date_str;
  39    uint8_t bios_rom_size;
  40    uint8_t bios_characteristics[8];
  41    uint8_t bios_characteristics_extension_bytes[2];
  42    uint8_t system_bios_major_release;
  43    uint8_t system_bios_minor_release;
  44    uint8_t embedded_controller_major_release;
  45    uint8_t embedded_controller_minor_release;
  46} QEMU_PACKED;
  47
  48/* SMBIOS type 1 - System Information */
  49struct smbios_type_1 {
  50    struct smbios_structure_header header;
  51    uint8_t manufacturer_str;
  52    uint8_t product_name_str;
  53    uint8_t version_str;
  54    uint8_t serial_number_str;
  55    uint8_t uuid[16];
  56    uint8_t wake_up_type;
  57    uint8_t sku_number_str;
  58    uint8_t family_str;
  59} QEMU_PACKED;
  60
  61/* SMBIOS type 3 - System Enclosure (v2.3) */
  62struct smbios_type_3 {
  63    struct smbios_structure_header header;
  64    uint8_t manufacturer_str;
  65    uint8_t type;
  66    uint8_t version_str;
  67    uint8_t serial_number_str;
  68    uint8_t asset_tag_number_str;
  69    uint8_t boot_up_state;
  70    uint8_t power_supply_state;
  71    uint8_t thermal_state;
  72    uint8_t security_status;
  73    uint32_t oem_defined;
  74    uint8_t height;
  75    uint8_t number_of_power_cords;
  76    uint8_t contained_element_count;
  77    // contained elements follow
  78} QEMU_PACKED;
  79
  80/* SMBIOS type 4 - Processor Information (v2.0) */
  81struct smbios_type_4 {
  82    struct smbios_structure_header header;
  83    uint8_t socket_designation_str;
  84    uint8_t processor_type;
  85    uint8_t processor_family;
  86    uint8_t processor_manufacturer_str;
  87    uint32_t processor_id[2];
  88    uint8_t processor_version_str;
  89    uint8_t voltage;
  90    uint16_t external_clock;
  91    uint16_t max_speed;
  92    uint16_t current_speed;
  93    uint8_t status;
  94    uint8_t processor_upgrade;
  95    uint16_t l1_cache_handle;
  96    uint16_t l2_cache_handle;
  97    uint16_t l3_cache_handle;
  98} QEMU_PACKED;
  99
 100/* SMBIOS type 16 - Physical Memory Array
 101 *   Associated with one type 17 (Memory Device).
 102 */
 103struct smbios_type_16 {
 104    struct smbios_structure_header header;
 105    uint8_t location;
 106    uint8_t use;
 107    uint8_t error_correction;
 108    uint32_t maximum_capacity;
 109    uint16_t memory_error_information_handle;
 110    uint16_t number_of_memory_devices;
 111} QEMU_PACKED;
 112/* SMBIOS type 17 - Memory Device
 113 *   Associated with one type 19
 114 */
 115struct smbios_type_17 {
 116    struct smbios_structure_header header;
 117    uint16_t physical_memory_array_handle;
 118    uint16_t memory_error_information_handle;
 119    uint16_t total_width;
 120    uint16_t data_width;
 121    uint16_t size;
 122    uint8_t form_factor;
 123    uint8_t device_set;
 124    uint8_t device_locator_str;
 125    uint8_t bank_locator_str;
 126    uint8_t memory_type;
 127    uint16_t type_detail;
 128} QEMU_PACKED;
 129
 130/* SMBIOS type 19 - Memory Array Mapped Address */
 131struct smbios_type_19 {
 132    struct smbios_structure_header header;
 133    uint32_t starting_address;
 134    uint32_t ending_address;
 135    uint16_t memory_array_handle;
 136    uint8_t partition_width;
 137} QEMU_PACKED;
 138
 139/* SMBIOS type 20 - Memory Device Mapped Address */
 140struct smbios_type_20 {
 141    struct smbios_structure_header header;
 142    uint32_t starting_address;
 143    uint32_t ending_address;
 144    uint16_t memory_device_handle;
 145    uint16_t memory_array_mapped_address_handle;
 146    uint8_t partition_row_position;
 147    uint8_t interleave_position;
 148    uint8_t interleaved_data_depth;
 149} QEMU_PACKED;
 150
 151/* SMBIOS type 32 - System Boot Information */
 152struct smbios_type_32 {
 153    struct smbios_structure_header header;
 154    uint8_t reserved[6];
 155    uint8_t boot_status;
 156} QEMU_PACKED;
 157
 158/* SMBIOS type 127 -- End-of-table */
 159struct smbios_type_127 {
 160    struct smbios_structure_header header;
 161} QEMU_PACKED;
 162
 163#endif /*QEMU_SMBIOS_H */
 164