From patchwork Fri Sep 6 06:59:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 273094 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 A2F9E2C00F2 for ; Fri, 6 Sep 2013 16:59:48 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VHq1B-00027H-E9; Fri, 06 Sep 2013 06:59:45 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1VHq15-00026u-Sw for fwts-devel@lists.ubuntu.com; Fri, 06 Sep 2013 06:59:39 +0000 Received: from [175.41.48.77] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1VHq14-0004ni-WB; Fri, 06 Sep 2013 06:59:39 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/3] [RESEND] uefi: uefidump: Add support for OsIndicationsSupported Date: Fri, 6 Sep 2013 14:59:33 +0800 Message-Id: <1378450773-20612-1-git-send-email-ivan.hu@canonical.com> X-Mailer: git-send-email 1.7.9.5 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: IvanHu The OsIndicationsSupported variable indicates which of the OS indication features and actions that the firmware supports. Signed-off-by: Ivan Hu --- 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..2a34d8e 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 } };