Dump ACPI table addresses with correct address length (LP: #1260482)

Submitted by Colin King on Dec. 12, 2013, 8:37 p.m.

Details

Message ID 1386880635-15917-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin King Dec. 12, 2013, 8:37 p.m.
From: Colin Ian King <colin.king@canonical.com>

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 <colin.king@canonical.com>
---
 src/acpi/acpidump/acpidump.c | 5 +++--
 src/lib/src/fwts_dump.c      | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Ivan Hu Dec. 16, 2013, 3:34 a.m.
On 12/13/2013 04:37 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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 <colin.king@canonical.com>
> ---
>   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;
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Keng-Yu Lin Dec. 20, 2013, 9:16 a.m.
On Mon, Dec 16, 2013 at 11:34 AM, IvanHu <ivan.hu@canonical.com> wrote:
> On 12/13/2013 04:37 AM, Colin King wrote:
>>
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> 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 <colin.king@canonical.com>
>> ---
>>   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;
>>
>
> Acked-by: Ivan Hu <ivan.hu@canonical.com>
>

Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch hide | download patch | download mbox

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;