aboutsummaryrefslogtreecommitdiffstats
path: root/src/fw/smbios.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-04-07 15:48:12 -0400
committerKevin O'Connor <kevin@koconnor.net>2014-04-07 15:48:12 -0400
commitd18c9f04e2725513a314446d4ddc18e10e19cdbe (patch)
treec4c0693865cda8ca068e4f755953817708b98f6e /src/fw/smbios.c
parent836b4d8a3888307f8b5d6b02044bafcb29c245ed (diff)
downloadseabios-d18c9f04e2725513a314446d4ddc18e10e19cdbe.tar.gz
smbios: Move smbios parsing logic from smbios.c to biostables.c.
After this change, src/fw/smbios.c only contains the legacy code for generating SMBIOS tables. This change only contains code movement - no logic is changed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/fw/smbios.c')
-rw-r--r--src/fw/smbios.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/src/fw/smbios.c b/src/fw/smbios.c
index 0c6a5b2a..902e8abe 100644
--- a/src/fw/smbios.c
+++ b/src/fw/smbios.c
@@ -15,8 +15,6 @@
#include "util.h" // MaxCountCPUs
#include "x86.h" // cpuid
-struct smbios_entry_point *SMBiosAddr;
-
static void
smbios_entry_point_setup(u16 max_structure_size,
u16 structure_table_length,
@@ -589,71 +587,3 @@ smbios_setup(void)
smbios_entry_point_setup(max_struct_size, p - start, start, nr_structs);
free(start);
}
-
-void
-display_uuid(void)
-{
- u32 addr, end;
- u8 *uuid;
- u8 empty_uuid[16] = { 0 };
-
- if (SMBiosAddr == NULL)
- return;
-
- addr = SMBiosAddr->structure_table_address;
- end = addr + SMBiosAddr->structure_table_length;
-
- /* the following takes care of any initial wraparound too */
- while (addr < end) {
- const struct smbios_structure_header *hdr;
-
- /* partial structure header */
- if (end - addr < sizeof(struct smbios_structure_header))
- return;
-
- hdr = (struct smbios_structure_header *)addr;
-
- /* partial structure */
- if (end - addr < hdr->length)
- return;
-
- /* any Type 1 structure version will do that has the UUID */
- if (hdr->type == 1 &&
- hdr->length >= offsetof(struct smbios_type_1, uuid) + 16)
- break;
-
- /* done with formatted area, skip string-set */
- addr += hdr->length;
-
- while (end - addr >= 2 &&
- (*(u8 *)addr != '\0' ||
- *(u8 *)(addr+1) != '\0'))
- ++addr;
-
- /* structure terminator not found */
- if (end - addr < 2)
- return;
-
- addr += 2;
- }
-
- /* parsing finished or skipped entirely, UUID not found */
- if (addr >= end)
- return;
-
- uuid = (u8 *)(addr + offsetof(struct smbios_type_1, uuid));
- if (memcmp(uuid, empty_uuid, sizeof empty_uuid) == 0)
- return;
-
- printf("Machine UUID"
- " %02x%02x%02x%02x"
- "-%02x%02x"
- "-%02x%02x"
- "-%02x%02x"
- "-%02x%02x%02x%02x%02x%02x\n"
- , uuid[ 0], uuid[ 1], uuid[ 2], uuid[ 3]
- , uuid[ 4], uuid[ 5]
- , uuid[ 6], uuid[ 7]
- , uuid[ 8], uuid[ 9]
- , uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]);
-}