summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Compatibility
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-05-19 02:40:45 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-05-19 02:40:45 +0000
commitc8eb679ca9e93e8c26889ec1dbc9bda624282ff5 (patch)
tree0b00e7b4137765aceb3f13c36a0239f8f28b0d79 /EdkCompatibilityPkg/Compatibility
parentec3d17dcef6fb23c5603816fbb227c0729953cbd (diff)
downloadedk2-platforms-c8eb679ca9e93e8c26889ec1dbc9bda624282ff5.tar.xz
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
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility')
-rw-r--r--EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c16
-rw-r--r--EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.inf5
2 files changed, 20 insertions, 1 deletions
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. <BR>
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 <PiPei.h>
#include <Ppi/ReadOnlyVariable.h>
#include <Ppi/ReadOnlyVariable2.h>
+#include <Ppi/ReadOnlyVariableThunkPresent.h>
#include <Library/DebugLib.h>
+#include <Library/PeiServicesLib.h>
//
// 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