summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Compatibility
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-05-19 02:42:39 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-05-19 02:42:39 +0000
commit6c45955b0457f47958b4766c2678627956090b91 (patch)
tree59dc9808e280725c4f5b8db8525b3a491482c09d /EdkCompatibilityPkg/Compatibility
parentc8eb679ca9e93e8c26889ec1dbc9bda624282ff5 (diff)
downloadedk2-platforms-6c45955b0457f47958b4766c2678627956090b91.tar.xz
Update the file header comments.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5220 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility')
-rw-r--r--EdkCompatibilityPkg/Compatibility/ReadOnlyVariable2ToReadOnlyVariableThunk/ReadOnlyVariable2ToReadOnlyVariableThunk.c40
-rw-r--r--EdkCompatibilityPkg/Compatibility/ReadOnlyVariable2ToReadOnlyVariableThunk/ReadOnlyVariable2ToReadOnlyVariableThunk.inf15
2 files changed, 46 insertions, 9 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/ReadOnlyVariable2ToReadOnlyVariableThunk/ReadOnlyVariable2ToReadOnlyVariableThunk.c b/EdkCompatibilityPkg/Compatibility/ReadOnlyVariable2ToReadOnlyVariableThunk/ReadOnlyVariable2ToReadOnlyVariableThunk.c
index 832dc520e5..ee8156573c 100644
--- a/EdkCompatibilityPkg/Compatibility/ReadOnlyVariable2ToReadOnlyVariableThunk/ReadOnlyVariable2ToReadOnlyVariableThunk.c
+++ b/EdkCompatibilityPkg/Compatibility/ReadOnlyVariable2ToReadOnlyVariableThunk/ReadOnlyVariable2ToReadOnlyVariableThunk.c
@@ -1,4 +1,15 @@
-/*++
+/** @file
+Module produce EFI_PEI_READ_ONLY_VARIABLE2_PPI on top of EFI_PEI_READ_ONLY_VARIABLE_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
+in MdePkg.
+This module produces EFI_PEI_READ_ONLY_VARIABLE2_PPI on top of EFI_PEI_READ_ONLY_VARIABLE_PPI.
+This module is used on platform when both of these two conditions are true:
+1) Framework module produces EFI_PEI_READ_ONLY_VARIABLE_PPI is present.
+2) The platform has PI modules that only consumes EFI_PEI_READ_ONLY_VARIABLE2_PPI.
+
+This module can't be used together with ReadOnlyVariableToReadOnlyVariable2Thunk module.
+
Copyright (c) 2006 - 2008 Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -10,17 +21,12 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
- Variable.c
-
-Abstract:
-
- PEIM to provide the Variable functionality
-
---*/
+**/
#include <PiPei.h>
#include <Ppi/ReadOnlyVariable2.h>
#include <Ppi/ReadOnlyVariable.h>
+#include <Ppi/ReadOnlyVariableThunkPresent.h>
#include <Library/DebugLib.h>
#include <Library/PeiServicesTablePointerLib.h>
#include <Library/PeiServicesLib.h>
@@ -62,6 +68,13 @@ EFI_PEI_PPI_DESCRIPTOR mPpiListVariable = {
&mVariablePpi
};
+
+EFI_PEI_PPI_DESCRIPTOR mReadOnlyVariableThunkPresent = {
+ (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+ &gPeiReadonlyVariableThunkPresentPpiGuid,
+ NULL
+ };
+
EFI_STATUS
EFIAPI
PeimInitializeReadOnlyVariable2 (
@@ -86,6 +99,17 @@ Returns:
--*/
{
+ VOID *Interface;
+ EFI_STATUS Status;
+
+ //
+ // Make sure ReadOnlyVariable2ToReadOnlyVariable module is not present. If so, the call chain will form a
+ // infinite loop: ReadOnlyVariable2 -> ReadOnlyVariable -> ReadOnlyVariable2 -> ....
+ //
+ Status = PeiServicesLocatePpi (&gPeiReadonlyVariableThunkPresentPpiGuid, 0, NULL, &Interface);
+ ASSERT (Status == EFI_NOT_FOUND);
+
+ PeiServicesInstallPpi (&mReadOnlyVariableThunkPresent);
//
// Publish the variable capability to other modules
//
diff --git a/EdkCompatibilityPkg/Compatibility/ReadOnlyVariable2ToReadOnlyVariableThunk/ReadOnlyVariable2ToReadOnlyVariableThunk.inf b/EdkCompatibilityPkg/Compatibility/ReadOnlyVariable2ToReadOnlyVariableThunk/ReadOnlyVariable2ToReadOnlyVariableThunk.inf
index c9b08f1f56..27b4d86fd9 100644
--- a/EdkCompatibilityPkg/Compatibility/ReadOnlyVariable2ToReadOnlyVariableThunk/ReadOnlyVariable2ToReadOnlyVariableThunk.inf
+++ b/EdkCompatibilityPkg/Compatibility/ReadOnlyVariable2ToReadOnlyVariableThunk/ReadOnlyVariable2ToReadOnlyVariableThunk.inf
@@ -1,5 +1,16 @@
#/** @file
-# Component description file for PeiVariable module.
+# Module produce EFI_PEI_READ_ONLY_VARIABLE_PPI 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
+# in MdePkg.
+# This module produces EFI_PEI_READ_ONLY_VARIABLE2_PPI on top of EFI_PEI_READ_ONLY_VARIABLE_PPI .
+# This module is used on platform when both of these two conditions are true:
+# 1) Framework module produces EFI_PEI_READ_ONLY_VARIABLE_PPI is present.
+# 2) The platform has PI modules that consumes EFI_PEI_READ_ONLY_VARIABLE2_PPI.
+#
+# This module can't be used together with ReadOnlyVariableToReadOnlyVariable2Thunk module.
+#
#
# PEIM to provide the Variable functionality.
# Copyright (c) 2006 - 2007, Intel Corporation
@@ -36,6 +47,7 @@
[Packages]
MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec
[LibraryClasses]
@@ -47,6 +59,7 @@
[Ppis]
gEfiPeiReadOnlyVariablePpiGuid # PPI ALWAYS_CONSUMED
gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_PRODUCED
+ gPeiReadonlyVariableThunkPresentPpiGuid
[Depex]
gEfiPeiReadOnlyVariablePpiGuid