]> xenbits.xensource.com Git - seabios.git/commitdiff
Move fw/smbios.h to std/smbios.h.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 15 Sep 2013 02:45:05 +0000 (22:45 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 19 Sep 2013 00:48:34 +0000 (20:48 -0400)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/bootsplash.c
src/fw/biostables.c
src/fw/coreboot.c
src/fw/csm.c
src/fw/paravirt.c
src/fw/smbios.c
src/fw/smbios.h [deleted file]
src/std/smbios.h [new file with mode: 0644]
src/util.h

index 3c08f5d6d3d500c62df8eddb814e71d3417a5ef4..aac7ebe4701bcc4881638ca3f2556b8825f075cf 100644 (file)
@@ -9,7 +9,6 @@
 #include "bregs.h" // struct bregs
 #include "config.h" // CONFIG_*
 #include "farptr.h" // FLATPTR_TO_SEG
-#include "fw/smbios.h" // display_uuid
 #include "jpeg.h" // jpeg_alloc
 #include "malloc.h" // free
 #include "output.h" // dprintf
index a51e8eeb9206775ce8c4c7f0c4ed012c9f378402..5200e65fe2e8de503d7cfb5e40c88fda491d0890 100644 (file)
@@ -9,8 +9,8 @@
 #include "malloc.h" // malloc_fseg
 #include "mptable.h" // MPTABLE_SIGNATURE
 #include "output.h" // dprintf
-#include "smbios.h" // struct smbios_entry_point
 #include "std/pirtable.h" // struct pir_header
+#include "std/smbios.h" // struct smbios_entry_point
 #include "string.h" // memcpy
 #include "util.h" // copy_table
 
index c82dd4e8b83ba487374b68bf87bded51cd888c0e..5daed866f981c0740b09b76f2b36285c55fa9360 100644 (file)
@@ -16,7 +16,6 @@
 #include "output.h" // dprintf
 #include "paravirt.h" // PlatformRunningOn
 #include "romfile.h" // romfile_findprefix
-#include "smbios.h" // smbios_init
 #include "stacks.h" // yield
 #include "string.h" // memset
 #include "util.h" // coreboot_preinit
index 7829c1ef5f1e2277265599e982222a9d25a60e33..eca97a7780d0a605c7e8d9aceeab5b28a13c17d4 100644 (file)
@@ -15,7 +15,6 @@
 #include "memmap.h"
 #include "output.h" // dprintf
 #include "post.h"
-#include "smbios.h"
 #include "stacks.h" // wait_threads
 #include "std/optionrom.h" // struct rom_header
 #include "util.h" // copy_smbios
index b76c1dbf36b21b661236cea867f223442bf5433e..a49c80a730a6093470a34aafc5e239e5f07a27a1 100644 (file)
@@ -20,7 +20,6 @@
 #include "output.h" // dprintf
 #include "paravirt.h" // qemu_cfg_preinit
 #include "romfile.h" // romfile_loadint
-#include "smbios.h" // smbios_setup
 #include "string.h" // memset
 #include "util.h" // pci_setup
 #include "x86.h" // cpuid
index a8969daea29676ad2fa176418c0a3a25ad07ba13..affb9be440c78cda3eb3a70889c7a23354c0a843 100644 (file)
@@ -10,7 +10,7 @@
 #include "output.h" // dprintf
 #include "paravirt.h" // RamSize
 #include "romfile.h" // romfile_findprefix
-#include "smbios.h" // struct smbios_entry_point
+#include "std/smbios.h" // struct smbios_entry_point
 #include "string.h" // memset
 #include "util.h" // MaxCountCPUs
 #include "x86.h" // cpuid
diff --git a/src/fw/smbios.h b/src/fw/smbios.h
deleted file mode 100644 (file)
index a4c1444..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-#ifndef __SMBIOS_H
-#define __SMBIOS_H
-
-// smbios.c
-void smbios_setup(void);
-
-/* SMBIOS entry point -- must be written to a 16-bit aligned address
-   between 0xf0000 and 0xfffff.
- */
-struct smbios_entry_point {
-    char anchor_string[4];
-    u8 checksum;
-    u8 length;
-    u8 smbios_major_version;
-    u8 smbios_minor_version;
-    u16 max_structure_size;
-    u8 entry_point_revision;
-    u8 formatted_area[5];
-    char intermediate_anchor_string[5];
-    u8 intermediate_checksum;
-    u16 structure_table_length;
-    u32 structure_table_address;
-    u16 number_of_structures;
-    u8 smbios_bcd_revision;
-} PACKED;
-
-extern struct smbios_entry_point *SMBiosAddr;
-
-/* This goes at the beginning of every SMBIOS structure. */
-struct smbios_structure_header {
-    u8 type;
-    u8 length;
-    u16 handle;
-} PACKED;
-
-/* SMBIOS type 0 - BIOS Information */
-struct smbios_type_0 {
-    struct smbios_structure_header header;
-    u8 vendor_str;
-    u8 bios_version_str;
-    u16 bios_starting_address_segment;
-    u8 bios_release_date_str;
-    u8 bios_rom_size;
-    u8 bios_characteristics[8];
-    u8 bios_characteristics_extension_bytes[2];
-    u8 system_bios_major_release;
-    u8 system_bios_minor_release;
-    u8 embedded_controller_major_release;
-    u8 embedded_controller_minor_release;
-} PACKED;
-
-/* SMBIOS type 1 - System Information */
-struct smbios_type_1 {
-    struct smbios_structure_header header;
-    u8 manufacturer_str;
-    u8 product_name_str;
-    u8 version_str;
-    u8 serial_number_str;
-    u8 uuid[16];
-    u8 wake_up_type;
-    u8 sku_number_str;
-    u8 family_str;
-} PACKED;
-
-/* SMBIOS type 3 - System Enclosure (v2.3) */
-struct smbios_type_3 {
-    struct smbios_structure_header header;
-    u8 manufacturer_str;
-    u8 type;
-    u8 version_str;
-    u8 serial_number_str;
-    u8 asset_tag_number_str;
-    u8 boot_up_state;
-    u8 power_supply_state;
-    u8 thermal_state;
-    u8 security_status;
-    u32 oem_defined;
-    u8 height;
-    u8 number_of_power_cords;
-    u8 contained_element_count;
-    // contained elements follow
-} PACKED;
-
-/* SMBIOS type 4 - Processor Information (v2.0) */
-struct smbios_type_4 {
-    struct smbios_structure_header header;
-    u8 socket_designation_str;
-    u8 processor_type;
-    u8 processor_family;
-    u8 processor_manufacturer_str;
-    u32 processor_id[2];
-    u8 processor_version_str;
-    u8 voltage;
-    u16 external_clock;
-    u16 max_speed;
-    u16 current_speed;
-    u8 status;
-    u8 processor_upgrade;
-    u16 l1_cache_handle;
-    u16 l2_cache_handle;
-    u16 l3_cache_handle;
-} PACKED;
-
-/* SMBIOS type 16 - Physical Memory Array
- *   Associated with one type 17 (Memory Device).
- */
-struct smbios_type_16 {
-    struct smbios_structure_header header;
-    u8 location;
-    u8 use;
-    u8 error_correction;
-    u32 maximum_capacity;
-    u16 memory_error_information_handle;
-    u16 number_of_memory_devices;
-} PACKED;
-
-/* SMBIOS type 17 - Memory Device
- *   Associated with one type 19
- */
-struct smbios_type_17 {
-    struct smbios_structure_header header;
-    u16 physical_memory_array_handle;
-    u16 memory_error_information_handle;
-    u16 total_width;
-    u16 data_width;
-    u16 size;
-    u8 form_factor;
-    u8 device_set;
-    u8 device_locator_str;
-    u8 bank_locator_str;
-    u8 memory_type;
-    u16 type_detail;
-} PACKED;
-
-/* SMBIOS type 19 - Memory Array Mapped Address */
-struct smbios_type_19 {
-    struct smbios_structure_header header;
-    u32 starting_address;
-    u32 ending_address;
-    u16 memory_array_handle;
-    u8 partition_width;
-} PACKED;
-
-/* SMBIOS type 20 - Memory Device Mapped Address */
-struct smbios_type_20 {
-    struct smbios_structure_header header;
-    u32 starting_address;
-    u32 ending_address;
-    u16 memory_device_handle;
-    u16 memory_array_mapped_address_handle;
-    u8 partition_row_position;
-    u8 interleave_position;
-    u8 interleaved_data_depth;
-} PACKED;
-
-/* SMBIOS type 32 - System Boot Information */
-struct smbios_type_32 {
-    struct smbios_structure_header header;
-    u8 reserved[6];
-    u8 boot_status;
-} PACKED;
-
-/* SMBIOS type 127 -- End-of-table */
-struct smbios_type_127 {
-    struct smbios_structure_header header;
-} PACKED;
-
-void display_uuid(void);
-#endif // smbios.h
diff --git a/src/std/smbios.h b/src/std/smbios.h
new file mode 100644 (file)
index 0000000..0513716
--- /dev/null
@@ -0,0 +1,165 @@
+#ifndef __SMBIOS_H
+#define __SMBIOS_H
+
+#include "types.h" // u32
+
+/* SMBIOS entry point -- must be written to a 16-bit aligned address
+   between 0xf0000 and 0xfffff.
+ */
+struct smbios_entry_point {
+    char anchor_string[4];
+    u8 checksum;
+    u8 length;
+    u8 smbios_major_version;
+    u8 smbios_minor_version;
+    u16 max_structure_size;
+    u8 entry_point_revision;
+    u8 formatted_area[5];
+    char intermediate_anchor_string[5];
+    u8 intermediate_checksum;
+    u16 structure_table_length;
+    u32 structure_table_address;
+    u16 number_of_structures;
+    u8 smbios_bcd_revision;
+} PACKED;
+
+/* This goes at the beginning of every SMBIOS structure. */
+struct smbios_structure_header {
+    u8 type;
+    u8 length;
+    u16 handle;
+} PACKED;
+
+/* SMBIOS type 0 - BIOS Information */
+struct smbios_type_0 {
+    struct smbios_structure_header header;
+    u8 vendor_str;
+    u8 bios_version_str;
+    u16 bios_starting_address_segment;
+    u8 bios_release_date_str;
+    u8 bios_rom_size;
+    u8 bios_characteristics[8];
+    u8 bios_characteristics_extension_bytes[2];
+    u8 system_bios_major_release;
+    u8 system_bios_minor_release;
+    u8 embedded_controller_major_release;
+    u8 embedded_controller_minor_release;
+} PACKED;
+
+/* SMBIOS type 1 - System Information */
+struct smbios_type_1 {
+    struct smbios_structure_header header;
+    u8 manufacturer_str;
+    u8 product_name_str;
+    u8 version_str;
+    u8 serial_number_str;
+    u8 uuid[16];
+    u8 wake_up_type;
+    u8 sku_number_str;
+    u8 family_str;
+} PACKED;
+
+/* SMBIOS type 3 - System Enclosure (v2.3) */
+struct smbios_type_3 {
+    struct smbios_structure_header header;
+    u8 manufacturer_str;
+    u8 type;
+    u8 version_str;
+    u8 serial_number_str;
+    u8 asset_tag_number_str;
+    u8 boot_up_state;
+    u8 power_supply_state;
+    u8 thermal_state;
+    u8 security_status;
+    u32 oem_defined;
+    u8 height;
+    u8 number_of_power_cords;
+    u8 contained_element_count;
+    // contained elements follow
+} PACKED;
+
+/* SMBIOS type 4 - Processor Information (v2.0) */
+struct smbios_type_4 {
+    struct smbios_structure_header header;
+    u8 socket_designation_str;
+    u8 processor_type;
+    u8 processor_family;
+    u8 processor_manufacturer_str;
+    u32 processor_id[2];
+    u8 processor_version_str;
+    u8 voltage;
+    u16 external_clock;
+    u16 max_speed;
+    u16 current_speed;
+    u8 status;
+    u8 processor_upgrade;
+    u16 l1_cache_handle;
+    u16 l2_cache_handle;
+    u16 l3_cache_handle;
+} PACKED;
+
+/* SMBIOS type 16 - Physical Memory Array
+ *   Associated with one type 17 (Memory Device).
+ */
+struct smbios_type_16 {
+    struct smbios_structure_header header;
+    u8 location;
+    u8 use;
+    u8 error_correction;
+    u32 maximum_capacity;
+    u16 memory_error_information_handle;
+    u16 number_of_memory_devices;
+} PACKED;
+
+/* SMBIOS type 17 - Memory Device
+ *   Associated with one type 19
+ */
+struct smbios_type_17 {
+    struct smbios_structure_header header;
+    u16 physical_memory_array_handle;
+    u16 memory_error_information_handle;
+    u16 total_width;
+    u16 data_width;
+    u16 size;
+    u8 form_factor;
+    u8 device_set;
+    u8 device_locator_str;
+    u8 bank_locator_str;
+    u8 memory_type;
+    u16 type_detail;
+} PACKED;
+
+/* SMBIOS type 19 - Memory Array Mapped Address */
+struct smbios_type_19 {
+    struct smbios_structure_header header;
+    u32 starting_address;
+    u32 ending_address;
+    u16 memory_array_handle;
+    u8 partition_width;
+} PACKED;
+
+/* SMBIOS type 20 - Memory Device Mapped Address */
+struct smbios_type_20 {
+    struct smbios_structure_header header;
+    u32 starting_address;
+    u32 ending_address;
+    u16 memory_device_handle;
+    u16 memory_array_mapped_address_handle;
+    u8 partition_row_position;
+    u8 interleave_position;
+    u8 interleaved_data_depth;
+} PACKED;
+
+/* SMBIOS type 32 - System Boot Information */
+struct smbios_type_32 {
+    struct smbios_structure_header header;
+    u8 reserved[6];
+    u8 boot_status;
+} PACKED;
+
+/* SMBIOS type 127 -- End-of-table */
+struct smbios_type_127 {
+    struct smbios_structure_header header;
+} PACKED;
+
+#endif // smbios.h
index dfd6faf7cdfd5639bfe68bee7ea9262bde340ad6..0b3a8e7e15671fff0bd14ef065b80611222ba5bb 100644 (file)
@@ -66,6 +66,11 @@ void make_bios_writable(void);
 void make_bios_readonly(void);
 void qemu_prep_reset(void);
 
+// fw/smbios.c
+extern struct smbios_entry_point *SMBiosAddr;
+void smbios_setup(void);
+void display_uuid(void);
+
 // fw/pciinit.c
 extern const u8 pci_irqs[4];
 void pci_setup(void);