From c8eb679ca9e93e8c26889ec1dbc9bda624282ff5 Mon Sep 17 00:00:00 2001 From: qwang12 Date: Mon, 19 May 2008 02:40:45 +0000 Subject: [PATCH] 1) Update the file headers 2) Make sure ReadOnlyVariableToReadOnlyVariable2Thunk and ReadOnlyVariable2ToReadOnlyVariableThunk are not included in the platform at the same time. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5219 6f19259b-4bc3-4df7-8a09-765794883524 --- .../ReadOnlyVariableToReadOnlyVariable2Thunk.c | 16 +++++++++++++++- .../ReadOnlyVariableToReadOnlyVariable2Thunk.inf | 5 +++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c b/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c index 2d3752d3e7..48103490ae 100644 --- a/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c +++ b/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c @@ -1,4 +1,4 @@ -/** +/** @file Module produce EFI_PEI_READ_ONLY_VARIABLE_PPI on top of EFI_PEI_READ_ONLY_VARIABLE2_PPI. UEFI PI Spec supersedes Intel's Framework Specs. # EFI_PEI_READ_ONLY_VARIABLE_PPI defined in Intel Framework Pkg is replaced by EFI_PEI_READ_ONLY_VARIABLE2_PPI @@ -8,6 +8,8 @@ UEFI PI Spec supersedes Intel's Framework Specs. # 1) Framework module consumes EFI_PEI_READ_ONLY_VARIABLE_PPI is present. # 2) The platform has a PI module that only produces EFI_PEI_READ_ONLY_VARIABLE2_PPI. +This module can't be used together with ReadOnlyVariable2ToReadOnlyVariableThunk module. + Copyright (c) 2006 - 2008 Intel Corporation.
All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -23,7 +25,9 @@ Module Name: #include #include #include +#include #include +#include // // Function Prototypes @@ -86,6 +90,16 @@ Returns: --*/ { + VOID *Interface; + EFI_STATUS Status; + + // + // Make sure ReadOnlyVariableToReadOnlyVariable2 module is not present. If so, the call chain will form a + // infinite loop: ReadOnlyVariable -> ReadOnlyVariable2 -> ReadOnlyVariable -> .... + // + Status = PeiServicesLocatePpi (&gPeiReadonlyVariableThunkPresentPpiGuid, 0, NULL, &Interface); + ASSERT (Status == EFI_NOT_FOUND); + // // Publish the variable capability to other modules // diff --git a/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.inf b/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.inf index d8f3f735c3..6a891e49a0 100644 --- a/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.inf +++ b/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.inf @@ -8,6 +8,8 @@ # This module is used on platform when both of these two conditions are true: # 1) Framework module consumes EFI_PEI_READ_ONLY_VARIABLE_PPI is present. # 2) The platform has a PI module that only produces EFI_PEI_READ_ONLY_VARIABLE2_PPI. +# This module can't be used together with ReadOnlyVariable2ToReadOnlyVariableThunk module. + # # Copyright (c) 2006 - 2007, Intel Corporation # @@ -43,15 +45,18 @@ [Packages] MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec [LibraryClasses] PeimEntryPoint DebugLib + PeiServicesLib [Ppis] gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_CONSUMED gEfiPeiReadOnlyVariablePpiGuid # PPI ALWAYS_PRODUCED + gPeiReadonlyVariableThunkPresentPpiGuid [Depex] gEfiPeiReadOnlyVariable2PpiGuid -- 2.39.2