Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / seabios / src / std / smbios.h
1 #ifndef __SMBIOS_H
2 #define __SMBIOS_H
3
4 #include "types.h" // u32
5
6 /* SMBIOS entry point -- must be written to a 16-bit aligned address
7    between 0xf0000 and 0xfffff.
8  */
9 struct smbios_entry_point {
10     char anchor_string[4];
11     u8 checksum;
12     u8 length;
13     u8 smbios_major_version;
14     u8 smbios_minor_version;
15     u16 max_structure_size;
16     u8 entry_point_revision;
17     u8 formatted_area[5];
18     char intermediate_anchor_string[5];
19     u8 intermediate_checksum;
20     u16 structure_table_length;
21     u32 structure_table_address;
22     u16 number_of_structures;
23     u8 smbios_bcd_revision;
24 } PACKED;
25
26 /* This goes at the beginning of every SMBIOS structure. */
27 struct smbios_structure_header {
28     u8 type;
29     u8 length;
30     u16 handle;
31 } PACKED;
32
33 /* SMBIOS type 0 - BIOS Information */
34 struct smbios_type_0 {
35     struct smbios_structure_header header;
36     u8 vendor_str;
37     u8 bios_version_str;
38     u16 bios_starting_address_segment;
39     u8 bios_release_date_str;
40     u8 bios_rom_size;
41     u8 bios_characteristics[8];
42     u8 bios_characteristics_extension_bytes[2];
43     u8 system_bios_major_release;
44     u8 system_bios_minor_release;
45     u8 embedded_controller_major_release;
46     u8 embedded_controller_minor_release;
47 } PACKED;
48
49 /* SMBIOS type 1 - System Information */
50 struct smbios_type_1 {
51     struct smbios_structure_header header;
52     u8 manufacturer_str;
53     u8 product_name_str;
54     u8 version_str;
55     u8 serial_number_str;
56     u8 uuid[16];
57     u8 wake_up_type;
58     u8 sku_number_str;
59     u8 family_str;
60 } PACKED;
61
62 /* SMBIOS type 3 - System Enclosure (v2.3) */
63 struct smbios_type_3 {
64     struct smbios_structure_header header;
65     u8 manufacturer_str;
66     u8 type;
67     u8 version_str;
68     u8 serial_number_str;
69     u8 asset_tag_number_str;
70     u8 boot_up_state;
71     u8 power_supply_state;
72     u8 thermal_state;
73     u8 security_status;
74     u32 oem_defined;
75     u8 height;
76     u8 number_of_power_cords;
77     u8 contained_element_count;
78     // contained elements follow
79 } PACKED;
80
81 /* SMBIOS type 4 - Processor Information (v2.0) */
82 struct smbios_type_4 {
83     struct smbios_structure_header header;
84     u8 socket_designation_str;
85     u8 processor_type;
86     u8 processor_family;
87     u8 processor_manufacturer_str;
88     u32 processor_id[2];
89     u8 processor_version_str;
90     u8 voltage;
91     u16 external_clock;
92     u16 max_speed;
93     u16 current_speed;
94     u8 status;
95     u8 processor_upgrade;
96     u16 l1_cache_handle;
97     u16 l2_cache_handle;
98     u16 l3_cache_handle;
99 } PACKED;
100
101 /* SMBIOS type 16 - Physical Memory Array
102  *   Associated with one type 17 (Memory Device).
103  */
104 struct smbios_type_16 {
105     struct smbios_structure_header header;
106     u8 location;
107     u8 use;
108     u8 error_correction;
109     u32 maximum_capacity;
110     u16 memory_error_information_handle;
111     u16 number_of_memory_devices;
112 } PACKED;
113
114 /* SMBIOS type 17 - Memory Device
115  *   Associated with one type 19
116  */
117 struct smbios_type_17 {
118     struct smbios_structure_header header;
119     u16 physical_memory_array_handle;
120     u16 memory_error_information_handle;
121     u16 total_width;
122     u16 data_width;
123     u16 size;
124     u8 form_factor;
125     u8 device_set;
126     u8 device_locator_str;
127     u8 bank_locator_str;
128     u8 memory_type;
129     u16 type_detail;
130 } PACKED;
131
132 /* SMBIOS type 19 - Memory Array Mapped Address */
133 struct smbios_type_19 {
134     struct smbios_structure_header header;
135     u32 starting_address;
136     u32 ending_address;
137     u16 memory_array_handle;
138     u8 partition_width;
139 } PACKED;
140
141 /* SMBIOS type 20 - Memory Device Mapped Address */
142 struct smbios_type_20 {
143     struct smbios_structure_header header;
144     u32 starting_address;
145     u32 ending_address;
146     u16 memory_device_handle;
147     u16 memory_array_mapped_address_handle;
148     u8 partition_row_position;
149     u8 interleave_position;
150     u8 interleaved_data_depth;
151 } PACKED;
152
153 /* SMBIOS type 32 - System Boot Information */
154 struct smbios_type_32 {
155     struct smbios_structure_header header;
156     u8 reserved[6];
157     u8 boot_status;
158 } PACKED;
159
160 /* SMBIOS type 127 -- End-of-table */
161 struct smbios_type_127 {
162     struct smbios_structure_header header;
163 } PACKED;
164
165 #endif // smbios.h