From patchwork Fri Mar 12 11:30:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1451940 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dxkp23Z53z9sW4 for ; Fri, 12 Mar 2021 22:57:30 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lKfzq-0001fw-Qu; Fri, 12 Mar 2021 11:30:22 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lKfzn-0001fb-Qh for fwts-devel@lists.ubuntu.com; Fri, 12 Mar 2021 11:30:19 +0000 Received: from [175.182.112.232] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lKfzn-00079b-0L for fwts-devel@lists.ubuntu.com; Fri, 12 Mar 2021 11:30:19 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/2] uefi: remove the var_ prefix Date: Fri, 12 Mar 2021 19:30:14 +0800 Message-Id: <20210312113015.51182-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" RuntimeServicesSupported is no longer from UEFI global variable. No function changed. Signed-off-by: Ivan Hu Acked-by: Alex Hung --- src/lib/include/fwts_uefi.h | 3 +-- src/lib/src/fwts_uefi.c | 6 ++--- src/uefi/uefirtmisc/uefirtmisc.c | 10 ++++----- src/uefi/uefirttime/uefirttime.c | 28 ++++++++++++------------ src/uefi/uefirtvariable/uefirtvariable.c | 28 ++++++++++++------------ 5 files changed, 37 insertions(+), 38 deletions(-) diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h index 527254cf..8d7a711b 100644 --- a/src/lib/include/fwts_uefi.h +++ b/src/lib/include/fwts_uefi.h @@ -682,8 +682,7 @@ char *fwts_uefi_attribute_info(uint32_t attr); bool fwts_uefi_efivars_iface_exist(void); -void fwts_uefi_rt_support_status_get(int fd, bool *have_rtsupported, uint32_t *var_rtsupported); - +void fwts_uefi_rt_support_status_get(int fd, bool *have_rtsupported, uint32_t *rtservicessupported); PRAGMA_POP #endif diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c index f7edadcb..138f1164 100644 --- a/src/lib/src/fwts_uefi.c +++ b/src/lib/src/fwts_uefi.c @@ -550,14 +550,14 @@ bool fwts_uefi_efivars_iface_exist(void) * this bitmask can be read via an IOCTL call. Before Linux 5.11 the value * cannot be determined. */ -void fwts_uefi_rt_support_status_get(int fd, bool *have_rtsupported, uint32_t *var_rtsupported) +void fwts_uefi_rt_support_status_get(int fd, bool *have_rtsupported, uint32_t *rtservicessupported) { long ioret; - ioret = ioctl(fd, EFI_RUNTIME_GET_SUPPORTED_MASK, var_rtsupported); + ioret = ioctl(fd, EFI_RUNTIME_GET_SUPPORTED_MASK, rtservicessupported); if (ioret == -1) { *have_rtsupported = false; - *var_rtsupported = EFI_RT_SUPPORTED_ALL; + *rtservicessupported = EFI_RT_SUPPORTED_ALL; } else { *have_rtsupported = true; } diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c index f23562e1..835cec34 100644 --- a/src/uefi/uefirtmisc/uefirtmisc.c +++ b/src/uefi/uefirtmisc/uefirtmisc.c @@ -248,13 +248,13 @@ static int uefirtmisc_test4(fwts_framework *fw) long ioret; uint64_t status; bool have_rtsupported; - uint32_t var_runtimeservicessupported; + uint32_t runtimeservicessupported; struct efi_getnexthighmonotoniccount getnexthighmonotoniccount; uint32_t highcount; fwts_uefi_rt_support_status_get(fd, &have_rtsupported, - &var_runtimeservicessupported); + &runtimeservicessupported); if (!have_rtsupported) { fwts_skipped(fw, "Cannot get the RuntimeServicesSupported " "mask from the kernel. This IOCTL was " @@ -268,7 +268,7 @@ static int uefirtmisc_test4(fwts_framework *fw) ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTHIGHMONOTONICCOUNT, &getnexthighmonotoniccount); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextHighMonotonicCount", "Get the GetNextHighMonotonicCount runtime " @@ -284,7 +284,7 @@ static int uefirtmisc_test4(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) { fwts_passed(fw, "UEFI GetNextHighMonotonicCount runtime " "service supported status test passed."); } else { @@ -300,7 +300,7 @@ static int uefirtmisc_test4(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) { fwts_passed(fw, "UEFI GetNextHighMonotonicCount runtime " "service supported status test passed."); } else { diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c index c6107d61..72667e35 100644 --- a/src/uefi/uefirttime/uefirttime.c +++ b/src/uefi/uefirttime/uefirttime.c @@ -1143,7 +1143,7 @@ static int uefirttime_test38(fwts_framework *fw) { long ioret; bool have_rtsupported; - uint32_t var_runtimeservicessupported; + uint32_t runtimeservicessupported; struct efi_settime settime; uint64_t status = ~0ULL; @@ -1156,7 +1156,7 @@ static int uefirttime_test38(fwts_framework *fw) EFI_TIME_CAPABILITIES efi_time_cap; fwts_uefi_rt_support_status_get(fd, &have_rtsupported, - &var_runtimeservicessupported); + &runtimeservicessupported); if (!have_rtsupported) { fwts_skipped(fw, "Cannot get the RuntimeServicesSupported " @@ -1171,7 +1171,7 @@ static int uefirttime_test38(fwts_framework *fw) ioret = ioctl(fd, EFI_RUNTIME_GET_TIME, &gettime); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME) { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime", "Get the GetTime runtime service supported " "via RuntimeServicesSupported mask. " @@ -1185,7 +1185,7 @@ static int uefirttime_test38(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME) { fwts_passed(fw, "UEFI GetTime runtime service " "supported status test passed."); } else { @@ -1200,7 +1200,7 @@ static int uefirttime_test38(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME) { fwts_passed(fw, "UEFI GetTime runtime service " "supported status test passed."); } else { @@ -1218,7 +1218,7 @@ static int uefirttime_test38(fwts_framework *fw) ioret = ioctl(fd, EFI_RUNTIME_SET_TIME, &settime); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME) { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime", "Get the SetTime runtime service supported " "via RuntimeServicesSupported mask. " @@ -1232,7 +1232,7 @@ static int uefirttime_test38(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME) { fwts_passed(fw, "UEFI SetTime runtime service " "supported status test passed."); } else { @@ -1247,7 +1247,7 @@ static int uefirttime_test38(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME) { fwts_passed(fw, "UEFI SetTime runtime service " "supported status test passed."); } else { @@ -1266,7 +1266,7 @@ static int uefirttime_test38(fwts_framework *fw) ioret = ioctl(fd, EFI_RUNTIME_SET_WAKETIME, &setwakeuptime); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime", "Get the SetWakeupTime runtime service supported " "via RuntimeServicesSupported mask. " @@ -1281,7 +1281,7 @@ static int uefirttime_test38(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) { fwts_passed(fw, "UEFI SetWakeupTime runtime service " "supported status test passed."); } else { @@ -1296,7 +1296,7 @@ static int uefirttime_test38(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) { fwts_passed(fw, "UEFI SetWakeupTime runtime service " "supported status test passed."); } else { @@ -1315,7 +1315,7 @@ static int uefirttime_test38(fwts_framework *fw) ioret = ioctl(fd, EFI_RUNTIME_GET_WAKETIME, &getwakeuptime); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", "Get the GetWakeupTime runtime service supported " "via RuntimeServicesSupported mask. " @@ -1329,7 +1329,7 @@ static int uefirttime_test38(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) { fwts_passed(fw, "UEFI GetWakeupTime runtime service " "supported status test passed."); } else { @@ -1344,7 +1344,7 @@ static int uefirttime_test38(fwts_framework *fw) fwts_skipped(fw, "Unknow error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) { fwts_passed(fw, "UEFI GetWakeupTime runtime service " "supported status test passed."); } else { diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c index eb6cce90..f39c7b2a 100644 --- a/src/uefi/uefirtvariable/uefirtvariable.c +++ b/src/uefi/uefirtvariable/uefirtvariable.c @@ -2021,7 +2021,7 @@ static int uefirtvariable_test9(fwts_framework *fw) long ioret; bool have_rtsupported; - uint32_t var_runtimeservicessupported; + uint32_t runtimeservicessupported; struct efi_getvariable getvariable; struct efi_setvariable setvariable; @@ -2042,7 +2042,7 @@ static int uefirtvariable_test9(fwts_framework *fw) uint32_t attr; fwts_uefi_rt_support_status_get(fd, &have_rtsupported, - &var_runtimeservicessupported); + &runtimeservicessupported); if (!have_rtsupported) { fwts_skipped(fw, "Cannot get the RuntimeServicesSupported " @@ -2061,7 +2061,7 @@ static int uefirtvariable_test9(fwts_framework *fw) ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE) { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetVariable", "Get the Setvariable runtime service supported " "via RuntimeServicesSupported mask. " @@ -2075,7 +2075,7 @@ static int uefirtvariable_test9(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE) { fwts_passed(fw, "UEFI SetVariable runtime service " "supported status test passed."); } else { @@ -2090,7 +2090,7 @@ static int uefirtvariable_test9(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE) { fwts_passed(fw, "UEFI SetVariable runtime service " "supported status test passed."); } else { @@ -2111,7 +2111,7 @@ static int uefirtvariable_test9(fwts_framework *fw) ioret = ioctl(fd, EFI_RUNTIME_GET_VARIABLE, &getvariable); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE) { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetVariable", "Get the GetVariable runtime service supported " "via RuntimeServicesSupported mask. " @@ -2125,7 +2125,7 @@ static int uefirtvariable_test9(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE) { fwts_passed(fw, "UEFI GetVariable runtime service " "supported status test passed."); } else { @@ -2140,7 +2140,7 @@ static int uefirtvariable_test9(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE) { fwts_passed(fw, "UEFI GetVariable runtime service " "supported status test passed."); } else { @@ -2171,7 +2171,7 @@ static int uefirtvariable_test9(fwts_framework *fw) ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTVARIABLENAME, &getnextvariablename); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextVarName", "Get the GetNextVarName runtime service supported " "via RuntimeServicesSupported mask. " @@ -2185,7 +2185,7 @@ static int uefirtvariable_test9(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) { fwts_passed(fw, "UEFI GetNextVarName runtime service " "supported status test passed."); } else { @@ -2200,7 +2200,7 @@ static int uefirtvariable_test9(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) { fwts_passed(fw, "UEFI GetNextVarName runtime service " "supported status test passed."); } else { @@ -2221,7 +2221,7 @@ static int uefirtvariable_test9(fwts_framework *fw) ioret = ioctl(fd, EFI_RUNTIME_QUERY_VARIABLEINFO, &queryvariableinfo); if (ioret == -1) { if (status == EFI_UNSUPPORTED) { - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeQueryVarInfo", "Get the QueryVarInfo runtime service supported " "via RuntimeServicesSupported mask. " @@ -2235,7 +2235,7 @@ static int uefirtvariable_test9(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) { fwts_passed(fw, "UEFI QueryVarInfo runtime service " "supported status test passed."); } else { @@ -2250,7 +2250,7 @@ static int uefirtvariable_test9(fwts_framework *fw) fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; } - if (var_runtimeservicessupported & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) { + if (runtimeservicessupported & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) { fwts_passed(fw, "UEFI QueryVarInfo runtime service " "supported status test passed."); } else {