ACK: [PATCH 2/3][RESEND 2] uefi: uefidump: Add support for OsIndicationsSupported
Colin Ian King
colin.king at canonical.com
Mon Sep 9 07:34:05 UTC 2013
On 09/09/13 03:31, Ivan Hu wrote:
> From: IvanHu <ivan.hu at canonical.com>
>
> The OsIndicationsSupported variable indicates which of the OS indication features and actions that the firmware supports.
>
> Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
> ---
> src/lib/include/fwts_uefi.h | 6 ++++++
> src/uefi/uefidump/uefidump.c | 44 ++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 50 insertions(+)
>
> diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
> index c0a6ce5..ecac84d 100644
> --- a/src/lib/include/fwts_uefi.h
> +++ b/src/lib/include/fwts_uefi.h
> @@ -88,6 +88,12 @@ enum {
>
> #define FWTS_UEFI_UNSPECIFIED_TIMEZONE 0x07FF
>
> +#define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001
> +#define EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION 0x0000000000000002
> +#define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004
> +#define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED 0x0000000000000008
> +#define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED 0x0000000000000010
> +
> #if 0
> typedef struct {
> char *description;
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index dc576c7..3cc99a7 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -680,6 +680,49 @@ static void uefidump_info_hwerrrec_support(fwts_framework *fw, fwts_uefi_var *va
> }
> }
>
> +static void uefidump_info_osindications_supported(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;
> + char str[300];
> +
> + memcpy(&value, var->data, sizeof(uint64_t));
> + *str = 0;
> +
> + if (value & EFI_OS_INDICATIONS_BOOT_TO_FW_UI)
> + strcat(str, "EFI_OS_INDICATIONS_BOOT_TO_FW_UI");
> +
> + if (value & EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION) {
> + if (*str)
> + strcat(str, ",");
> + strcat(str, "EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION");
> + }
> +
> + if (value & EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED) {
> + if (*str)
> + strcat(str, ",");
> + strcat(str, "EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED");
> + }
> +
> + if (value & EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED) {
> + if (*str)
> + strcat(str, ",");
> + strcat(str, "EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED");
> + }
> +
> + if (value & EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED) {
> + if (*str)
> + strcat(str, ",");
> + strcat(str, "EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED");
> + }
> +
> + fwts_log_info_verbatum(fw, " Value: 0x%16.16" PRIx64 " (%s).", value, str);
> + }
> +}
> +
> static uefidump_info uefidump_info_table[] = {
> { "PlatformLangCodes", uefidump_info_platform_langcodes },
> { "PlatformLang", uefidump_info_platform_lang },
> @@ -705,6 +748,7 @@ static uefidump_info uefidump_info_table[] = {
> { "AcpiGlobalVariable", uefidump_info_acpi_global_variable },
> { "SignatureSupport", uefidump_info_signature_support },
> { "HwErrRecSupport", uefidump_info_hwerrrec_support },
> + { "OsIndicationsSupported", uefidump_info_osindications_supported },
> { NULL, NULL }
> };
>
>
Acked-by: Colin Ian King <colin.king at canonical.com>
More information about the fwts-devel
mailing list