-/**\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
# 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
#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
\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