From patchwork Thu May 31 13:12:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 162154 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id BC3D6B6FA4 for ; Thu, 31 May 2012 23:12:58 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sa5BQ-0002wY-Te for incoming@patchwork.ozlabs.org; Thu, 31 May 2012 13:12:56 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sa5BP-0002wS-GO for fwts-devel@lists.ubuntu.com; Thu, 31 May 2012 13:12:55 +0000 Received: from cpc19-craw6-2-0-cust5.croy.cable.virginmedia.com ([77.102.228.6] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Sa5BP-0001Xy-Dz for fwts-devel@lists.ubuntu.com; Thu, 31 May 2012 13:12:55 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] lib: fwts_acpi_tables: fake table start address when loading from file. Date: Thu, 31 May 2012 14:12:54 +0100 Message-Id: <1338469974-5644-2-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1338469974-5644-1-git-send-email-colin.king@canonical.com> References: <1338469974-5644-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Loading dumped ACPI tables from file is problematic because we have no idea of their original physical location. The current situation is that we fake their address to physical location zero, which means the table lookup against the RSDT or XSDT produced random first come first dumped hash table lookups since all the tables were at a fake address zero. The way around this is simple, it has already been solved for loading in tables from a raw ACPI dump file with null addresses - we just create ascending fake addresses using fwts_fake_physical_addr() for each table being loaded. Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Alex Hung Acked-by: Ivan Hu --- src/lib/src/fwts_acpi_tables.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index f09e94c..eabc2ea 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -469,7 +469,8 @@ static int fwts_acpi_load_tables_from_file(fwts_framework *fw) strcpy(name, direntry->d_name); name[strlen(name)-4] = '\0'; if ((table = fwts_acpi_load_table_from_file(fd, &length)) != NULL) - fwts_acpi_add_table(name, table, (uint64_t)0, length); + fwts_acpi_add_table(name, table, + (uint64_t)fwts_fake_physical_addr(length), length); close(fd); } else fwts_log_error(fw, "Cannot load ACPI table from file '%s'\n", path);