]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1) Update the file headers
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 May 2008 02:40:45 +0000 (02:40 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 May 2008 02:40:45 +0000 (02:40 +0000)
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

EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c
EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.inf

index 2d3752d3e795611066a201e5c4d58f2d5f09eb9a..48103490ae963c777404314ad7d0b2e78522f033 100644 (file)
@@ -1,4 +1,4 @@
-/**\r
+/** @file\r
 Module produce EFI_PEI_READ_ONLY_VARIABLE_PPI on top of EFI_PEI_READ_ONLY_VARIABLE2_PPI.\r
 UEFI PI Spec supersedes Intel's Framework Specs. \r
 # EFI_PEI_READ_ONLY_VARIABLE_PPI defined in Intel Framework Pkg is replaced by EFI_PEI_READ_ONLY_VARIABLE2_PPI\r
@@ -8,6 +8,8 @@ UEFI PI Spec supersedes Intel's Framework Specs.
 # 1) Framework module consumes EFI_PEI_READ_ONLY_VARIABLE_PPI is present.\r
 # 2) The platform has a PI module that only produces EFI_PEI_READ_ONLY_VARIABLE2_PPI.\r
 \r
+This module can't be used together with ReadOnlyVariable2ToReadOnlyVariableThunk module.\r
+\r
 Copyright (c) 2006 - 2008 Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -23,7 +25,9 @@ Module Name:
 #include <PiPei.h>\r
 #include <Ppi/ReadOnlyVariable.h>\r
 #include <Ppi/ReadOnlyVariable2.h>\r
+#include <Ppi/ReadOnlyVariableThunkPresent.h>\r
 #include <Library/DebugLib.h>\r
+#include <Library/PeiServicesLib.h>\r
 \r
 //\r
 // Function Prototypes\r
@@ -86,6 +90,16 @@ Returns:
 \r
 --*/\r
 {\r
+  VOID        *Interface;\r
+  EFI_STATUS  Status;\r
+\r
+  //\r
+  // Make sure ReadOnlyVariableToReadOnlyVariable2 module is not present. If so, the call chain will form a\r
+  // infinite loop: ReadOnlyVariable -> ReadOnlyVariable2 -> ReadOnlyVariable -> ....\r
+  //\r
+  Status = PeiServicesLocatePpi (&gPeiReadonlyVariableThunkPresentPpiGuid, 0, NULL, &Interface);\r
+  ASSERT (Status == EFI_NOT_FOUND);\r
+\r
   //\r
   // Publish the variable capability to other modules\r
   //\r
index d8f3f735c33409ff9f62003212056c5101896e22..6a891e49a0c8684fcdc7b761d3ad923799e1e01b 100644 (file)
@@ -8,6 +8,8 @@
 # This module is used on platform when both of these two conditions are true:\r
 # 1) Framework module consumes EFI_PEI_READ_ONLY_VARIABLE_PPI is present.\r
 # 2) The platform has a PI module that only produces EFI_PEI_READ_ONLY_VARIABLE2_PPI.\r
+# This module can't be used together with ReadOnlyVariable2ToReadOnlyVariableThunk module.\r
+\r
 #\r
 # Copyright (c) 2006 - 2007, Intel Corporation\r
 #\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
   IntelFrameworkPkg/IntelFrameworkPkg.dec\r
 \r
 [LibraryClasses]\r
   PeimEntryPoint\r
   DebugLib\r
+  PeiServicesLib\r
 \r
 [Ppis]\r
   gEfiPeiReadOnlyVariable2PpiGuid               # PPI ALWAYS_CONSUMED\r
   gEfiPeiReadOnlyVariablePpiGuid                # PPI ALWAYS_PRODUCED\r
+  gPeiReadonlyVariableThunkPresentPpiGuid\r
 \r
 [Depex]\r
   gEfiPeiReadOnlyVariable2PpiGuid\r