From patchwork Thu Dec 12 20:37:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 300751 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 2C8872C00A3 for ; Fri, 13 Dec 2013 07:37:22 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VrD0b-0001xQ-JJ; Thu, 12 Dec 2013 20:37:21 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VrD0W-0001xF-4S for fwts-devel@lists.ubuntu.com; Thu, 12 Dec 2013 20:37:16 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginm.net ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1VrD0W-0005Ch-1i for fwts-devel@lists.ubuntu.com; Thu, 12 Dec 2013 20:37:16 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] Dump ACPI table addresses with correct address length (LP: #1260482) Date: Thu, 12 Dec 2013 20:37:15 +0000 Message-Id: <1386880635-15917-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.8.5.1 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King When fwts was first written it was dealing with traditional BIOS where ACPI tables were always in the lower 32 bits of memory. This is wrong for 64 bit systems. So fix the address dumping of the tables in acpidump and the ACPI table --dump option. Signed-off-by: Colin Ian King Acked-by: Ivan Hu Acked-by: Keng-Yu Lin --- src/acpi/acpidump/acpidump.c | 5 +++-- src/lib/src/fwts_dump.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c index c89690d..6a491f2 100644 --- a/src/acpi/acpidump/acpidump.c +++ b/src/acpi/acpidump/acpidump.c @@ -1936,8 +1936,9 @@ static int acpidump_test1(fwts_framework *fw) fwts_infoonly(fw); for (i = 0; (fwts_acpi_get_table(fw, i, &table) == FWTS_OK) && (table !=NULL); i++) { - fwts_log_info_verbatum(fw, "%s @ %4.4" PRIx32 " (%zd bytes)", table->name, (uint32_t)table->addr, table->length); - fwts_log_info_verbatum(fw, "---------------"); + fwts_log_info_verbatum(fw, "%s @ %lx (%zd bytes)", + table->name, (unsigned long)table->addr, table->length); + fwts_log_info_verbatum(fw, "----"); acpidump_table(fw, table); fwts_log_nl(fw); } diff --git a/src/lib/src/fwts_dump.c b/src/lib/src/fwts_dump.c index 9cbe936..c92f98c 100644 --- a/src/lib/src/fwts_dump.c +++ b/src/lib/src/fwts_dump.c @@ -143,7 +143,7 @@ static int dump_acpi_table(fwts_acpi_table_info *table, FILE *fp) char buffer[128]; size_t n; - fprintf(fp, "%s @ 0x%x\n", table->name, (uint32_t)table->addr); + fprintf(fp, "%s @ 0x%lx\n", table->name, (unsigned long)table->addr); for (n = 0; n < table->length; n+=16) { int left = table->length - n;