/** @file\r
EFI PEI Core PPI services\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
will be fixup for PpiData and PpiDescriptor.\r
@param Fixup The address difference between\r
the new Hob list and old Hob list.\r
+ @param FixupPositive TRUE if new Hob list is above the old Hob list. \r
+ Otherwise FALSE.\r
\r
**/\r
VOID\r
IN PEI_CORE_INSTANCE *PrivateData,\r
IN UINTN OldCheckingBottom,\r
IN UINTN OldCheckingTop,\r
- IN INTN Fixup\r
+ IN UINTN Fixup,\r
+ IN BOOLEAN FixupPositive\r
)\r
{\r
UINT8 Index;\r
// Convert the pointer to the PEIM descriptor from the old HOB heap\r
// to the relocated HOB heap.\r
//\r
- PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw + Fixup);\r
+ if (FixupPositive) {\r
+ PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw + Fixup);\r
+ } else {\r
+ PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw - Fixup);\r
+ }\r
\r
//\r
// Only when the PEIM descriptor is in the old HOB should it be necessary\r
// Convert the pointer to the GUID in the PPI or NOTIFY descriptor\r
// from the old HOB heap to the relocated HOB heap.\r
//\r
- PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid + Fixup);\r
+ if (FixupPositive) {\r
+ PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid + Fixup);\r
+ } else {\r
+ PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid - Fixup);\r
+ }\r
}\r
\r
//\r
// Convert the pointer to the PPI interface structure in the PPI descriptor\r
// from the old HOB heap to the relocated HOB heap.\r
//\r
- PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi+ Fixup);\r
+ if (FixupPositive) {\r
+ PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi + Fixup);\r
+ } else {\r
+ PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi - Fixup);\r
+ }\r
}\r
}\r
}\r