Added .gitignore
[comos.git] / include / smbios.h
blob9e1d4415d9f9ff8e79e9979c731683c6188b80cb
1 #ifndef SMBIOS_H
2 #define SMBIOS_H
4 #include "stdlib.h"
6 struct sm_memdev_s
8 uint16_t memory_handle;
9 uint16_t error_handle;
10 uint16_t total_width;
11 uint16_t data_width;
12 uint16_t size;
13 uint8_t form_factor;
14 uint8_t device_set;
15 uint8_t device_locator;
16 uint8_t bank_locator;
17 uint8_t type;
18 uint16_t type_detail;
19 uint16_t speed;
20 uint8_t manufacturer;
21 uint8_t serial;
22 uint8_t asset;
23 uint8_t part;
24 uint8_t attributes;
26 char * device_locator_s;
27 char * bank_locator_s;
28 char * manufacturer_s;
29 char * serial_s;
30 char * asset_s;
31 char * part_s;
32 } sm_memdev[64];
34 struct sm_cpu_s
36 uint8_t socket;
37 uint8_t type;
38 uint8_t family;
39 uint8_t manufacturer;
40 uint32_t id;
41 uint8_t version;
42 uint8_t voltage;
43 uint16_t external_clock;
44 uint16_t max_speed;
45 uint16_t current_speed;
46 uint8_t status;
47 uint8_t upgrade;
48 uint16_t L1_cache_handle;
49 uint16_t L2_cache_handle;
50 uint16_t L3_cache_handle;
51 uint8_t serial;
52 uint8_t asset;
53 uint8_t part;
54 uint8_t core_count;
55 uint8_t core_enabled;
56 uint8_t thread_count;
57 uint16_t characteristics;
58 uint16_t ext_family;
60 char * socket_s;
61 char * manufacturer_s;
62 char * version_s;
63 char * serial_s;
64 char * asset_s;
65 char * part_s;
66 } sm_cpu[64]; /* yeah, that's right... 64 CPU's baby!!! */
69 struct sm_chas_s
71 uint8_t manufacturer;
72 uint8_t type;
73 uint8_t version;
74 uint8_t serial;
75 uint8_t asset;
76 uint8_t boot_state;
77 uint8_t power_state;
78 uint8_t thermal_state;
79 uint8_t security_state;
80 uint32_t oem_defined;
81 uint8_t height;
82 uint8_t power_cord_count;
83 uint8_t contained_element_count;
84 uint8_t contained_record_length;
85 uint8_t contained_elements[256][256]; /* count * length */
87 char * manufacturer_s;
88 char * version_s;
89 char * serial_s;
90 char * asset_s;
91 } sm_chas[4];
93 struct sm_mod_s
95 uint8_t manufacturer;
96 uint8_t product;
97 uint8_t version;
98 uint8_t serial;
99 uint8_t asset;
100 uint8_t family;
101 uint8_t feature_flags;
102 uint8_t location;
103 uint16_t chassis_handle;
104 uint8_t board_type;
105 uint8_t num_contained_objects;
106 uint16_t contained_objects[256]; /* max */
108 char * manufacturer_s;
109 char * product_s;
110 char * version_s;
111 char * serial_s;
112 char * asset_s;
113 char * location_s;
114 } sm_mod[8];
116 struct sm_sys_s
118 uint8_t manufacturer;
119 uint8_t product;
120 uint8_t version;
121 uint8_t serial;
122 uint8_t uuid[16];
123 uint8_t wakeup_type;
124 uint8_t sku;
125 uint8_t family;
127 char * manufacturer_s;
128 char * product_s;
129 char * version_s;
130 char * serial_s;
131 char * sku_s;
132 char * family_s;
133 } sm_sys[4];
135 struct sm_bios_s
137 uint8_t vendor;
138 uint8_t version;
139 uint16_t starting_address_segment;
140 uint8_t release_date;
141 uint8_t rom_size;
142 uint8_t characteristics[8];
143 uint8_t extension[2];
144 uint8_t major_release;
145 uint8_t minor_release;
146 uint8_t firmware_major_release;
147 uint8_t firmware_minor_release;
149 char * vendor_s;
150 char * version_s;
151 char * release_date_s;
152 } sm_bios;
154 struct sm_hdr_s
156 uint8_t type;
157 uint8_t length;
158 uint16_t handle;
159 } sm_hdr;
161 struct sm_entry_s
163 uint8_t anchor_string[4];
164 uint8_t checksum;
165 uint8_t length;
166 uint8_t major_version;
167 uint8_t minor_version;
168 uint16_t max_struct_size;
169 uint8_t revision;
170 uint8_t formatted_area[5];
171 uint8_t interm_anchor_string[5];
172 uint8_t interm_checksum;
173 uint16_t struct_table_length;
174 uint32_t struct_table_address;
175 uint16_t num_smbios_structures;
176 uint8_t bcd_revision;
177 } sm_eps;
179 uint8_t sm_bios_count,
180 sm_sys_count,
181 sm_mod_count,
182 sm_chas_count,
183 sm_cpu_count,
184 sm_memdev_count;
186 void parse_smbios(void);
188 #endif