From patchwork Mon Apr 14 20:55:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 339075 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49301140093 for ; Tue, 15 Apr 2014 07:31:15 +1000 (EST) Received: from localhost ([::1]:45635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZnz4-0000RC-Ji for incoming@patchwork.ozlabs.org; Mon, 14 Apr 2014 17:00:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZnud-0008J8-Et for qemu-devel@nongnu.org; Mon, 14 Apr 2014 16:55:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WZnuX-0003ur-8L for qemu-devel@nongnu.org; Mon, 14 Apr 2014 16:55:31 -0400 Received: from mail-qa0-x22f.google.com ([2607:f8b0:400d:c00::22f]:60955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZnuW-0003uX-UU for qemu-devel@nongnu.org; Mon, 14 Apr 2014 16:55:25 -0400 Received: by mail-qa0-f47.google.com with SMTP id m5so6415949qaj.6 for ; Mon, 14 Apr 2014 13:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=U5tbZl/rFK9lmVGsh79PRglU30XQJGB2dsM8g4nBRrA=; b=Hj6Ecgh+6WPbANMIvLqZ3pcHND+Uzd8NowlLz+S7QsPbBAp9HsWynDcWR9t09sDBX4 i9KfgzLUm5Caw81lRbBfAwYNijtvWcnLMtV4dBMxnjpsftjnOphtplSOzuonmxCB+dP9 2uwoR5JtiKOmfX/bIf6JJJNM7Uf3JiIqUEwfx5jp9ycxch2sMIqOXfnvVT1wnNbqvgHV bJYdixyBRyiGzW4N8Vyf0qKfu8Odc2gRkulL1FmjojEAEF3iAmm+haMRpHid/3zUc5r7 D+tsBISJqoAiH8tNO/2lFOfUZMWYWFWF4hdOpcANkNJJkSDowezG1vmZFB82wxFwyibh AqrA== X-Received: by 10.140.94.227 with SMTP id g90mr51139787qge.58.1397508924453; Mon, 14 Apr 2014 13:55:24 -0700 (PDT) Received: from ERROL.ini.cmu.edu (ERROL.INI.CMU.EDU. [128.2.16.43]) by mx.google.com with ESMTPSA id 21sm21884140qgh.23.2014.04.14.13.55.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Apr 2014 13:55:23 -0700 (PDT) From: "Gabriel L. Somlo" To: qemu-devel@nongnu.org Date: Mon, 14 Apr 2014 16:55:04 -0400 Message-Id: <1397508911-18691-11-git-send-email-somlo@cmu.edu> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1397508911-18691-1-git-send-email-somlo@cmu.edu> References: <1397508911-18691-1-git-send-email-somlo@cmu.edu> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c00::22f Cc: seabios@seabios.org, agraf@suse.de, armbru@redhat.com, kevin@koconnor.net, kraxel@redhat.com, lersek@redhat.com Subject: [Qemu-devel] [QEMU v6 PATCH 10/17] SMBIOS: Build full tables for type 32 and 127 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; }