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