diff mbox

[5/6] uefi: uefidump: Add support for AcpiGlobalVariable

Message ID 1346687565-32320-6-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King Sept. 3, 2012, 3:52 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

AcpiGlobalVariable contains the 64 bit address of the ACPI global
variable memory region, so dump this out too.
---
 src/uefi/uefidump/uefidump.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Ivan Hu Sept. 5, 2012, 7:23 a.m. UTC | #1
On 09/03/2012 11:52 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> AcpiGlobalVariable contains the 64 bit address of the ACPI global
> variable memory region, so dump this out too.
> ---
>   src/uefi/uefidump/uefidump.c |   17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
>
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index 8f4c788..d7f4dd6 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -601,6 +601,22 @@ static void uefidump_info_morc(fwts_framework *fw, fwts_uefi_var *var)
>   	}
>   }
>
> +/*
> + *  Dump ACPI global variable address
> + */
> +static void uefidump_info_acpi_global_variable(fwts_framework *fw, fwts_uefi_var *var)
> +{
> +	if (var->datalen != 8) {
> +		/* Should be 8 bytes, of not, dump it out as a hex dump */
> +		uefidump_var_hexdump(fw, var);
> +	} else {
> +		uint64_t value;
> +
> +		memcpy(&value, var->data, sizeof(uint64_t));
> +		fwts_log_info_verbatum(fw, "  ACPI Global Variable Address: 0x%16.16llx.", (unsigned long long)value);
> +	}
> +}
> +
>   static uefidump_info uefidump_info_table[] = {
>   	{ "PlatformLangCodes",	uefidump_info_platform_langcodes },
>   	{ "PlatformLang",	uefidump_info_platform_lang },
> @@ -623,6 +639,7 @@ static uefidump_info uefidump_info_table[] = {
>   	{ "SecureBoot",		uefidump_info_secure_boot },
>   	{ "SetupMode",		uefidump_info_setup_mode },
>   	{ "MemoryOverwriteRequestControl",	uefidump_info_morc },
> +	{ "AcpiGlobalVariable",	uefidump_info_acpi_global_variable },
>   	{ NULL, NULL }
>   };
>
>


Acked-by: Ivan Hu <ivan.hu@canonical.com>
Keng-Yu Lin Sept. 11, 2012, 5:55 a.m. UTC | #2
On Mon, Sep 3, 2012 at 11:52 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> AcpiGlobalVariable contains the 64 bit address of the ACPI global
> variable memory region, so dump this out too.
> ---
>  src/uefi/uefidump/uefidump.c |   17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index 8f4c788..d7f4dd6 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -601,6 +601,22 @@ static void uefidump_info_morc(fwts_framework *fw, fwts_uefi_var *var)
>         }
>  }
>
> +/*
> + *  Dump ACPI global variable address
> + */
> +static void uefidump_info_acpi_global_variable(fwts_framework *fw, fwts_uefi_var *var)
> +{
> +       if (var->datalen != 8) {
> +               /* Should be 8 bytes, of not, dump it out as a hex dump */
> +               uefidump_var_hexdump(fw, var);
> +       } else {
> +               uint64_t value;
> +
> +               memcpy(&value, var->data, sizeof(uint64_t));
> +               fwts_log_info_verbatum(fw, "  ACPI Global Variable Address: 0x%16.16llx.", (unsigned long long)value);
> +       }
> +}
> +
>  static uefidump_info uefidump_info_table[] = {
>         { "PlatformLangCodes",  uefidump_info_platform_langcodes },
>         { "PlatformLang",       uefidump_info_platform_lang },
> @@ -623,6 +639,7 @@ static uefidump_info uefidump_info_table[] = {
>         { "SecureBoot",         uefidump_info_secure_boot },
>         { "SetupMode",          uefidump_info_setup_mode },
>         { "MemoryOverwriteRequestControl",      uefidump_info_morc },
> +       { "AcpiGlobalVariable", uefidump_info_acpi_global_variable },
>         { NULL, NULL }
>  };
>
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
diff mbox

Patch

diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
index 8f4c788..d7f4dd6 100644
--- a/src/uefi/uefidump/uefidump.c
+++ b/src/uefi/uefidump/uefidump.c
@@ -601,6 +601,22 @@  static void uefidump_info_morc(fwts_framework *fw, fwts_uefi_var *var)
 	}
 }
 
+/*
+ *  Dump ACPI global variable address
+ */
+static void uefidump_info_acpi_global_variable(fwts_framework *fw, fwts_uefi_var *var)
+{
+	if (var->datalen != 8) {
+		/* Should be 8 bytes, of not, dump it out as a hex dump */
+		uefidump_var_hexdump(fw, var);
+	} else {
+		uint64_t value;
+
+		memcpy(&value, var->data, sizeof(uint64_t));
+		fwts_log_info_verbatum(fw, "  ACPI Global Variable Address: 0x%16.16llx.", (unsigned long long)value);
+	}
+}
+
 static uefidump_info uefidump_info_table[] = {
 	{ "PlatformLangCodes",	uefidump_info_platform_langcodes },
 	{ "PlatformLang",	uefidump_info_platform_lang },
@@ -623,6 +639,7 @@  static uefidump_info uefidump_info_table[] = {
 	{ "SecureBoot",		uefidump_info_secure_boot },
 	{ "SetupMode",		uefidump_info_setup_mode },
 	{ "MemoryOverwriteRequestControl",	uefidump_info_morc },
+	{ "AcpiGlobalVariable",	uefidump_info_acpi_global_variable },
 	{ NULL, NULL }
 };