6 * Copyright (C) 2009 Hewlett-Packard Development Company, L.P.
9 * Alex Williamson <alex.williamson@hp.com>
11 * This work is licensed under the terms of the GNU GPL, version 2. See
12 * the COPYING file in the top-level directory.
16 #include "qemu/option.h"
18 #define SMBIOS_MAX_TYPE 127
20 void smbios_entry_add(QemuOpts *opts);
21 void smbios_set_cpuid(uint32_t version, uint32_t features);
22 void smbios_set_defaults(const char *manufacturer, const char *product,
23 const char *version, bool legacy_mode,
25 uint8_t *smbios_get_table_legacy(size_t *length);
26 void smbios_get_tables(uint8_t **tables, size_t *tables_len,
27 uint8_t **anchor, size_t *anchor_len);
30 * SMBIOS spec defined tables
33 /* SMBIOS entry point (anchor).
34 * BIOS must place this at a 16-bit-aligned address between 0xf0000 and 0xfffff.
36 struct smbios_entry_point {
37 uint8_t anchor_string[4];
40 uint8_t smbios_major_version;
41 uint8_t smbios_minor_version;
42 uint16_t max_structure_size;
43 uint8_t entry_point_revision;
44 uint8_t formatted_area[5];
45 uint8_t intermediate_anchor_string[5];
46 uint8_t intermediate_checksum;
47 uint16_t structure_table_length;
48 uint32_t structure_table_address;
49 uint16_t number_of_structures;
50 uint8_t smbios_bcd_revision;
53 /* This goes at the beginning of every SMBIOS structure. */
54 struct smbios_structure_header {
60 /* SMBIOS type 0 - BIOS Information */
61 struct smbios_type_0 {
62 struct smbios_structure_header header;
64 uint8_t bios_version_str;
65 uint16_t bios_starting_address_segment;
66 uint8_t bios_release_date_str;
67 uint8_t bios_rom_size;
68 uint64_t bios_characteristics;
69 uint8_t bios_characteristics_extension_bytes[2];
70 uint8_t system_bios_major_release;
71 uint8_t system_bios_minor_release;
72 uint8_t embedded_controller_major_release;
73 uint8_t embedded_controller_minor_release;
76 /* UUID encoding. The time_* fields are little-endian, as specified by SMBIOS
82 uint16_t time_hi_and_version;
83 uint8_t clock_seq_hi_and_reserved;
84 uint8_t clock_seq_low;
88 /* SMBIOS type 1 - System Information */
89 struct smbios_type_1 {
90 struct smbios_structure_header header;
91 uint8_t manufacturer_str;
92 uint8_t product_name_str;
94 uint8_t serial_number_str;
95 struct smbios_uuid uuid;
97 uint8_t sku_number_str;
101 /* SMBIOS type 2 - Base Board */
102 struct smbios_type_2 {
103 struct smbios_structure_header header;
104 uint8_t manufacturer_str;
107 uint8_t serial_number_str;
108 uint8_t asset_tag_number_str;
109 uint8_t feature_flags;
110 uint8_t location_str;
111 uint16_t chassis_handle;
113 uint8_t contained_element_count;
114 /* contained elements follow */
117 /* SMBIOS type 3 - System Enclosure (v2.7) */
118 struct smbios_type_3 {
119 struct smbios_structure_header header;
120 uint8_t manufacturer_str;
123 uint8_t serial_number_str;
124 uint8_t asset_tag_number_str;
125 uint8_t boot_up_state;
126 uint8_t power_supply_state;
127 uint8_t thermal_state;
128 uint8_t security_status;
129 uint32_t oem_defined;
131 uint8_t number_of_power_cords;
132 uint8_t contained_element_count;
133 uint8_t sku_number_str;
134 /* contained elements follow */
137 /* SMBIOS type 4 - Processor Information (v2.6) */
138 struct smbios_type_4 {
139 struct smbios_structure_header header;
140 uint8_t socket_designation_str;
141 uint8_t processor_type;
142 uint8_t processor_family;
143 uint8_t processor_manufacturer_str;
144 uint32_t processor_id[2];
145 uint8_t processor_version_str;
147 uint16_t external_clock;
149 uint16_t current_speed;
151 uint8_t processor_upgrade;
152 uint16_t l1_cache_handle;
153 uint16_t l2_cache_handle;
154 uint16_t l3_cache_handle;
155 uint8_t serial_number_str;
156 uint8_t asset_tag_number_str;
157 uint8_t part_number_str;
159 uint8_t core_enabled;
160 uint8_t thread_count;
161 uint16_t processor_characteristics;
162 uint16_t processor_family2;
165 /* SMBIOS type 16 - Physical Memory Array (v2.7) */
166 struct smbios_type_16 {
167 struct smbios_structure_header header;
170 uint8_t error_correction;
171 uint32_t maximum_capacity;
172 uint16_t memory_error_information_handle;
173 uint16_t number_of_memory_devices;
174 uint64_t extended_maximum_capacity;
177 /* SMBIOS type 17 - Memory Device (v2.8) */
178 struct smbios_type_17 {
179 struct smbios_structure_header header;
180 uint16_t physical_memory_array_handle;
181 uint16_t memory_error_information_handle;
182 uint16_t total_width;
187 uint8_t device_locator_str;
188 uint8_t bank_locator_str;
190 uint16_t type_detail;
192 uint8_t manufacturer_str;
193 uint8_t serial_number_str;
194 uint8_t asset_tag_number_str;
195 uint8_t part_number_str;
197 uint32_t extended_size;
198 uint16_t configured_clock_speed;
199 uint16_t minimum_voltage;
200 uint16_t maximum_voltage;
201 uint16_t configured_voltage;
204 /* SMBIOS type 19 - Memory Array Mapped Address (v2.7) */
205 struct smbios_type_19 {
206 struct smbios_structure_header header;
207 uint32_t starting_address;
208 uint32_t ending_address;
209 uint16_t memory_array_handle;
210 uint8_t partition_width;
211 uint64_t extended_starting_address;
212 uint64_t extended_ending_address;
215 /* SMBIOS type 32 - System Boot Information */
216 struct smbios_type_32 {
217 struct smbios_structure_header header;
222 /* SMBIOS type 127 -- End-of-table */
223 struct smbios_type_127 {
224 struct smbios_structure_header header;
227 #endif /*QEMU_SMBIOS_H */