[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [QEMU v6 PATCH 06/17] SMBIOS: Remove unused code for passin
From: |
Gabriel L. Somlo |
Subject: |
[Qemu-devel] [QEMU v6 PATCH 06/17] SMBIOS: Remove unused code for passing individual fields to bios |
Date: |
Mon, 14 Apr 2014 16:55:00 -0400 |
This patch removes smbios_add_field() and the old code to insert
individual fields for types 0 and 1 into fw_cfg.
Signed-off-by: Gabriel Somlo <address@hidden>
---
hw/i386/smbios.c | 80 --------------------------------------------------------
1 file changed, 80 deletions(-)
diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
index b00a367..4584774 100644
--- a/hw/i386/smbios.c
+++ b/hw/i386/smbios.c
@@ -29,13 +29,6 @@ struct smbios_header {
uint8_t type;
} QEMU_PACKED;
-struct smbios_field {
- struct smbios_header header;
- uint8_t type;
- uint16_t offset;
- uint8_t data[];
-} QEMU_PACKED;
-
struct smbios_table {
struct smbios_header header;
uint8_t data[];
@@ -283,75 +276,6 @@ static bool smbios_skip_table(uint8_t type, bool
required_table)
*(uint16_t *)smbios_entries += 1; \
} while (0)
-static void smbios_add_field(int type, int offset, const void *data, size_t
len)
-{
- struct smbios_field *field;
-
- if (!smbios_entries) {
- smbios_entries_len = sizeof(uint16_t);
- smbios_entries = g_malloc0(smbios_entries_len);
- }
- smbios_entries = g_realloc(smbios_entries, smbios_entries_len +
- sizeof(*field) + len);
- field = (struct smbios_field *)(smbios_entries + smbios_entries_len);
- field->header.type = SMBIOS_FIELD_ENTRY;
- field->header.length = cpu_to_le16(sizeof(*field) + len);
-
- field->type = type;
- field->offset = cpu_to_le16(offset);
- memcpy(field->data, data, len);
-
- smbios_entries_len += sizeof(*field) + len;
- (*(uint16_t *)smbios_entries) =
- cpu_to_le16(le16_to_cpu(*(uint16_t *)smbios_entries) + 1);
-}
-
-static void smbios_maybe_add_str(int type, int offset, const char *data)
-{
- if (data) {
- smbios_add_field(type, offset, data, strlen(data) + 1);
- }
-}
-
-static void smbios_build_type_0_fields(void)
-{
- smbios_maybe_add_str(0, offsetof(struct smbios_type_0, vendor_str),
- type0.vendor);
- smbios_maybe_add_str(0, offsetof(struct smbios_type_0, bios_version_str),
- type0.version);
- smbios_maybe_add_str(0, offsetof(struct smbios_type_0,
- bios_release_date_str),
- type0.date);
- if (type0.have_major_minor) {
- smbios_add_field(0, offsetof(struct smbios_type_0,
- system_bios_major_release),
- &type0.major, 1);
- smbios_add_field(0, offsetof(struct smbios_type_0,
- system_bios_minor_release),
- &type0.minor, 1);
- }
-}
-
-static void smbios_build_type_1_fields(void)
-{
- smbios_maybe_add_str(1, offsetof(struct smbios_type_1, manufacturer_str),
- type1.manufacturer);
- smbios_maybe_add_str(1, offsetof(struct smbios_type_1, product_name_str),
- type1.product);
- smbios_maybe_add_str(1, offsetof(struct smbios_type_1, version_str),
- type1.version);
- smbios_maybe_add_str(1, offsetof(struct smbios_type_1, serial_number_str),
- type1.serial);
- smbios_maybe_add_str(1, offsetof(struct smbios_type_1, sku_number_str),
- type1.sku);
- smbios_maybe_add_str(1, offsetof(struct smbios_type_1, family_str),
- type1.family);
- if (qemu_uuid_set) {
- smbios_add_field(1, offsetof(struct smbios_type_1, uuid),
- qemu_uuid, 16);
- }
-}
-
static void smbios_build_type_0_table(void)
{
SMBIOS_BUILD_TABLE_PRE(0, 0x000, false); /* optional, leave up to BIOS */
@@ -452,10 +376,6 @@ uint8_t *smbios_get_table(size_t *length)
smbios_build_type_0_table();
smbios_build_type_1_table();
smbios_build_type_2_table();
-if (false) { /* shut up gcc until we remove deprecated code */
- smbios_build_type_0_fields();
- smbios_build_type_1_fields();
-}
smbios_validate_table();
smbios_immutable = true;
}
--
1.9.0
- [Qemu-devel] [QEMU v6 PATCH 00/17] SMBIOS: build full tables in QEMU, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 01/17] SMBIOS: Rename smbios_set_type1_defaults() for more general use, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 02/17] SMBIOS: Use macro to set smbios defaults, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 04/17] SMBIOS: Add code to build full smbios tables; build type 2 table, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 03/17] SMBIOS: Use bitmaps to check for smbios table collisions, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 05/17] SMBIOS: Build full tables for types 0 and 1, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 06/17] SMBIOS: Remove unused code for passing individual fields to bios,
Gabriel L. Somlo <=
- [Qemu-devel] [QEMU v6 PATCH 07/17] SMBIOS: Build full type 3 table, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 09/17] SMBIOS: Build full smbios memory tables (type 16, 17, 19, and 20), Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 10/17] SMBIOS: Build full tables for type 32 and 127, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 08/17] SMBIOS: Build full type 4 tables, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 11/17] SMBIOS: Generate aggregate smbios tables, including entry point, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 12/17] SMBIOS: Remove SeaBIOS compatibility quirks, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 13/17] SMBIOS: Stop including type 20 tables, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 14/17] SMBIOS: Use e820 memory map to generate type 19 tables, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 15/17] SMBIOS: Update type 3 definition to smbios spec v2.7, Gabriel L. Somlo, 2014/04/14
- [Qemu-devel] [QEMU v6 PATCH 16/17] SMBIOS: Update type 4 definition to smbios spec v2.6, Gabriel L. Somlo, 2014/04/14