From nobody Sun Feb 8 22:07:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+48240+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48240+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1569635254; cv=none; d=zoho.com; s=zohoarc; b=Sr/9xVqSa3ZehCv49LmnuzhaqXAV6aacgImjWJzMk0TIzJrTFbvia1gKrcajzZfIAaPG/qv7Da8SwnXX8/jwJdGXzjOQzqMcj3CY/kMrtmdpCy8Mjzde43OgjY6csL/Yg2TgAPWHSRwTAV4pUkxb5NWWvXTaPGVtAy05Gc85lF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569635254; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=UrFDLYiRNbm9SWbUyIK8MGeERfMbDesyMyQc8V2/juA=; b=iU1dP6cYJU4MsKmSSqJ9Lz402HNprSn+0IwOkM1ZvcJDVpTsQ9oxKm/ZICF2nMSJ669aF+v3HW2inhAjURSuUAfrY7qNyhAVxuk1BLOGBn32HVJoyrt8gjHUM1sb52PjpUV2r1i15kIvPJbj/WVYPwmr43dyx+NtfbsMxm8pCSY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+48240+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1569635254117860.2069333170009; Fri, 27 Sep 2019 18:47:34 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 00bKYY1788612x1nRogBz3w6; Fri, 27 Sep 2019 18:47:33 -0700 X-Received: from mga01.intel.com (mga01.intel.com []) by groups.io with SMTP; Fri, 27 Sep 2019 18:47:33 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2019 18:47:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,557,1559545200"; d="scan'208";a="274005095" X-Received: from makuback-desk1.amr.corp.intel.com ([10.7.159.162]) by orsmga001.jf.intel.com with ESMTP; 27 Sep 2019 18:47:33 -0700 From: "Kubacki, Michael A" To: devel@edk2.groups.io Cc: Dandan Bi , Ard Biesheuvel , Eric Dong , Laszlo Ersek , Liming Gao , Michael D Kinney , Ray Ni , Jian J Wang , Hao A Wu , Jiewen Yao Subject: [edk2-devel] [PATCH V2 5/9] MdeModulePkg/Variable: Add a file for NV variable functions Date: Fri, 27 Sep 2019 18:47:13 -0700 Message-Id: <20190928014717.31372-6-michael.a.kubacki@intel.com> In-Reply-To: <20190928014717.31372-1-michael.a.kubacki@intel.com> References: <20190928014717.31372-1-michael.a.kubacki@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.a.kubacki@intel.com X-Gm-Message-State: OIQe7btqmb7WlOrZQoiSvmXRx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1569635253; bh=cYoOvxuNNtGhn84AviO9lYfcZiNXyIsBYXgGiI/dslo=; h=Cc:Date:From:Reply-To:Subject:To; b=qU2zh0YSi7hHFla0tmTYpLzb3np12e3PGv+MVj3rj8rU3VzjHMzKeMM9UnGQ8i7Kko7 jOLxKGHoW0Iwwe2V+wZUlHh3uCOUn6Tzz8Ai+fQLf3abGfGBWIOa7pcdgf2P8yvjEILxv mEctDE6Z8lpmDc+AL7OAOV4qIbHpEOUNz5I= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This change adds a dedicated file for variable operations specific to non-volatile variables. This decreases the overall length of the relatively large Variable.c file. Cc: Dandan Bi Cc: Ard Biesheuvel Cc: Eric Dong Cc: Laszlo Ersek Cc: Liming Gao Cc: Michael D Kinney Cc: Ray Ni Cc: Jian J Wang Cc: Hao A Wu Cc: Jiewen Yao Signed-off-by: Michael Kubacki --- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf | 2 ++ MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf | 2 ++ MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf | 2 ++ MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.h | 25 += ++++++++++++++++ MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 20 += ------------- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c | 28 += +++++++++++++++++++ 6 files changed, 60 insertions(+), 19 deletions(-) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.= inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf index c35e5fe787..08a5490787 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf @@ -36,6 +36,8 @@ Variable.c VariableDxe.c Variable.h + VariableNonVolatile.c + VariableNonVolatile.h VariableParsing.c VariableParsing.h PrivilegePolymorphic.h diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf b/M= deModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf index 626738b9c7..6dc2721b81 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf @@ -45,6 +45,8 @@ Variable.c VariableTraditionalMm.c VariableSmm.c + VariableNonVolatile.c + VariableNonVolatile.h VariableParsing.c VariableParsing.h VarCheck.c diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneM= m.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf index 1ba8f9ebfb..ca9d23ce9f 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf @@ -45,6 +45,8 @@ Variable.c VariableSmm.c VariableStandaloneMm.c + VariableNonVolatile.c + VariableNonVolatile.h VariableParsing.c VariableParsing.h VarCheck.c diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile= .h b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.h new file mode 100644 index 0000000000..82572262ef --- /dev/null +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.h @@ -0,0 +1,25 @@ +/** @file + Common variable non-volatile store routines. + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _VARIABLE_NON_VOLATILE_H_ +#define _VARIABLE_NON_VOLATILE_H_ + +#include "Variable.h" + +/** + Get non-volatile maximum variable size. + + @return Non-volatile maximum variable size. + +**/ +UINTN +GetNonVolatileMaxVariableSize ( + VOID + ); + +#endif diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeMod= ulePkg/Universal/Variable/RuntimeDxe/Variable.c index 53d797152c..5da2354aa5 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -23,6 +23,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include "Variable.h" +#include "VariableNonVolatile.h" #include "VariableParsing.h" =20 VARIABLE_MODULE_GLOBAL *mVariableModuleGlobal; @@ -3006,25 +3007,6 @@ ReclaimForOS( } } =20 -/** - Get non-volatile maximum variable size. - - @return Non-volatile maximum variable size. - -**/ -UINTN -GetNonVolatileMaxVariableSize ( - VOID - ) -{ - if (PcdGet32 (PcdHwErrStorageSize) !=3D 0) { - return MAX (MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32 (PcdMaxAuthVa= riableSize)), - PcdGet32 (PcdMaxHardwareErrorVariableSize)); - } else { - return MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32 (PcdMaxAuthVariabl= eSize)); - } -} - /** Get maximum variable size, covering both non-volatile and volatile varia= bles. =20 diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile= .c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c new file mode 100644 index 0000000000..b1b6d8282f --- /dev/null +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c @@ -0,0 +1,28 @@ +/** @file + Common variable non-volatile store routines. + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "VariableNonVolatile.h" + +/** + Get non-volatile maximum variable size. + + @return Non-volatile maximum variable size. + +**/ +UINTN +GetNonVolatileMaxVariableSize ( + VOID + ) +{ + if (PcdGet32 (PcdHwErrStorageSize) !=3D 0) { + return MAX (MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32 (PcdMaxAuthVa= riableSize)), + PcdGet32 (PcdMaxHardwareErrorVariableSize)); + } else { + return MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32 (PcdMaxAuthVariabl= eSize)); + } +} --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48240): https://edk2.groups.io/g/devel/message/48240 Mute This Topic: https://groups.io/mt/34318589/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-