Received: from eggs.gnu.org ([2001:4830:134:3::10]:51988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYe3w-0000uV-Ep for qemu-devel@nongnu.org; Fri, 11 Apr 2014 12:12:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYe3p-0006IF-1K for qemu-devel@nongnu.org; Fri, 11 Apr 2014 12:12:20 -0400 Received: from mail-qc0-x232.google.com ([2607:f8b0:400d:c01::232]:53533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYe3o-0006I6-So for qemu-devel@nongnu.org; Fri, 11 Apr 2014 12:12:12 -0400 Received: by mail-qc0-f178.google.com with SMTP id i8so6115086qcq.37 for ; Fri, 11 Apr 2014 09:12:12 -0700 (PDT) From: "Gabriel L. Somlo" Date: Fri, 11 Apr 2014 12:11:50 -0400 Message-Id: <1397232718-15282-11-git-send-email-somlo@cmu.edu> In-Reply-To: <1397232718-15282-1-git-send-email-somlo@cmu.edu> References: <1397232718-15282-1-git-send-email-somlo@cmu.edu> Subject: [Qemu-devel] [QEMU v5 PATCH 10/18] SMBIOS: Build full tables for type 32 and 127 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kevin@koconnor.net, seabios@seabios.org, lersek@redhat.com, kraxel@redhat.com, agraf@suse.de Build full smbios type 32 (system boot info) and 127 (end-of-table) tables, and make them available via fw_cfg. Signed-off-by: Gabriel Somlo --- hw/i386/smbios.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c index 6510ff3..b1f1d46 100644 --- a/hw/i386/smbios.c +++ b/hw/i386/smbios.c @@ -615,6 +615,22 @@ static void smbios_build_type_20_table(unsigned instance, SMBIOS_BUILD_TABLE_POST; } +static void smbios_build_type_32_table(void) +{ + SMBIOS_BUILD_TABLE_PRE(32, 0x2000, true); /* required */ + + memset(t->reserved, 0, 6); + t->boot_status = 0; /* No errors detected */ + + SMBIOS_BUILD_TABLE_POST; +} + +static void smbios_build_type_127_table(void) +{ + SMBIOS_BUILD_TABLE_PRE(127, 0x7F00, true); /* required */ + SMBIOS_BUILD_TABLE_POST; +} + #define SMBIOS_SET_DEFAULT(field, value) \ if (!field) { \ field = value; \ @@ -754,6 +770,9 @@ uint8_t *smbios_get_table(size_t *length) } } + smbios_build_type_32_table(); + smbios_build_type_127_table(); + smbios_validate_table(); smbios_immutable = true; } -- 1.9.0