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