]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Ppi/Ppi.c
MdeModulePkg/IntelFrameworkModulePkg: Update PeiCore, SmbiosDxe and IsaSerialDxe...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Ppi / Ppi.c
index feae0fbb9fb47cc46cc48dffe2fcaca1fc313ee5..706e835a70916810d2926423cf626a8450dda5af 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
-\r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+  EFI PEI Core PPI services\r
+  \r
+Copyright (c) 2006 - 2014, 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
@@ -9,156 +10,180 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-Module Name:\r
+**/\r
 \r
-  Ppi.c\r
+#include "PeiMain.h"\r
 \r
-Abstract:\r
+/**\r
 \r
-  EFI PEI Core PPI services\r
+  Initialize PPI services.\r
 \r
-Revision History\r
+  @param PrivateData     Pointer to the PEI Core data.\r
+  @param OldCoreData     Pointer to old PEI Core data. \r
+                         NULL if being run in non-permament memory mode.\r
 \r
 **/\r
-\r
-#include <PeiMain.h>\r
-\r
 VOID\r
 InitializePpiServices (\r
   IN PEI_CORE_INSTANCE *PrivateData,\r
   IN PEI_CORE_INSTANCE *OldCoreData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize PPI services.\r
-\r
-Arguments:\r
-\r
-  PeiServices - The PEI core services table.\r
-  OldCoreData - Pointer to the PEI Core data.\r
-                NULL if being run in non-permament memory mode.\r
-\r
-Returns:\r
-  Nothing\r
-\r
---*/\r
 {\r
   if (OldCoreData == NULL) {\r
-    PrivateData->PpiData.NotifyListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
-    PrivateData->PpiData.DispatchListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
-    PrivateData->PpiData.LastDispatchedNotify = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
+    PrivateData->PpiData.NotifyListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
+    PrivateData->PpiData.DispatchListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
+    PrivateData->PpiData.LastDispatchedNotify = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;\r
   }\r
-\r
-  return;\r
 }\r
 \r
+/**\r
+\r
+  Migrate Single PPI Pointer from the temporary memory to PEI installed memory.\r
+\r
+  @param PpiPointer      Pointer to Ppi\r
+  @param TempBottom      Base of old temporary memory\r
+  @param TempTop         Top of old temporary memory\r
+  @param Offset          Offset of new memory to old temporary memory.\r
+  @param OffsetPositive  Positive flag of Offset value. \r
+\r
+**/\r
 VOID\r
-ConvertPpiPointers (\r
-  IN CONST EFI_PEI_SERVICES                     **PeiServices,\r
-  IN UINTN                         OldCheckingBottom,\r
-  IN UINTN                         OldCheckingTop,\r
-  IN EFI_HOB_HANDOFF_INFO_TABLE    *NewHandOffHob\r
+ConverSinglePpiPointer (\r
+  IN PEI_PPI_LIST_POINTERS *PpiPointer,\r
+  IN UINTN                 TempBottom,\r
+  IN UINTN                 TempTop,\r
+  IN UINTN                 Offset,\r
+  IN BOOLEAN               OffsetPositive\r
   )\r
-/*++\r
+{\r
+  if (((UINTN)PpiPointer->Raw < TempTop) &&\r
+      ((UINTN)PpiPointer->Raw >= TempBottom)) {\r
+    //\r
+    // Convert the pointer to the PPI descriptor from the old TempRam\r
+    // to the relocated physical memory.\r
+    //\r
+    if (OffsetPositive) {\r
+      PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw + Offset);\r
+    } else {\r
+      PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw - Offset);\r
+    }\r
 \r
-Routine Description:\r
+    //\r
+    // Only when the PEIM descriptor is in the old TempRam should it be necessary\r
+    // to try to convert the pointers in the PEIM descriptor\r
+    //\r
 \r
-  Migrate the Hob list from the CAR stack to PEI installed memory.\r
+    if (((UINTN)PpiPointer->Ppi->Guid < TempTop) &&\r
+        ((UINTN)PpiPointer->Ppi->Guid >= TempBottom)) {\r
+      //\r
+      // Convert the pointer to the GUID in the PPI or NOTIFY descriptor\r
+      // from the old TempRam to the relocated physical memory.\r
+      //\r
+      if (OffsetPositive) {\r
+        PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid + Offset);\r
+      } else {\r
+        PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid - Offset);\r
+      }\r
+    }\r
 \r
-Arguments:\r
+    //\r
+    // Convert the pointer to the PPI interface structure in the PPI descriptor\r
+    // from the old TempRam to the relocated physical memory.\r
+    //\r
+    if ((UINTN)PpiPointer->Ppi->Ppi < TempTop &&\r
+        (UINTN)PpiPointer->Ppi->Ppi >= TempBottom) {\r
+      if (OffsetPositive) {\r
+        PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi + Offset);\r
+      } else {\r
+        PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi - Offset);\r
+      }\r
+    }\r
+  }\r
+}\r
 \r
-  PeiServices       - The PEI core services table.\r
-  OldCheckingBottom - The old checking bottom.\r
-  OldCheckingTop    - The old checking top.\r
-  NewHandOffHob     - The new handoff HOB list.\r
+/**\r
 \r
-Returns:\r
+  Migrate PPI Pointers from the temporary memory stack to PEI installed memory.\r
 \r
---*/\r
+  @param SecCoreData     Points to a data structure containing SEC to PEI handoff data, such as the size \r
+                         and location of temporary RAM, the stack location and the BFV location.\r
+  @param PrivateData     Pointer to PeiCore's private data structure.\r
+\r
+**/\r
+VOID\r
+ConvertPpiPointers (\r
+  IN CONST EFI_SEC_PEI_HAND_OFF  *SecCoreData,\r
+  IN PEI_CORE_INSTANCE           *PrivateData\r
+  )\r
 {\r
-  PEI_CORE_INSTANCE     *PrivateData;\r
   UINT8                 Index;\r
-  PEI_PPI_LIST_POINTERS *PpiPointer;\r
-  UINTN                 Fixup;\r
-\r
-  PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);\r
-\r
-  Fixup = (UINTN)NewHandOffHob - OldCheckingBottom;\r
-\r
-  for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {\r
-    if (Index < PrivateData->PpiData.PpiListEnd ||\r
-        Index > PrivateData->PpiData.NotifyListEnd) {\r
-      PpiPointer = &PrivateData->PpiData.PpiListPtrs[Index];\r
-\r
-      if (((UINTN)PpiPointer->Raw < OldCheckingTop) &&\r
-          ((UINTN)PpiPointer->Raw >= OldCheckingBottom)) {\r
-        //\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
-\r
-        //\r
-        // Only when the PEIM descriptor is in the old HOB should it be necessary\r
-        // to try to convert the pointers in the PEIM descriptor\r
-        //\r
-\r
-        if (((UINTN)PpiPointer->Ppi->Guid < OldCheckingTop) &&\r
-            ((UINTN)PpiPointer->Ppi->Guid >= OldCheckingBottom)) {\r
-          //\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
-        }\r
+  UINT8                 IndexHole;\r
 \r
-        //\r
-        // Assume that no code is located in the temporary memory, so the pointer to\r
-        // the notification function in the NOTIFY descriptor needs not be converted.\r
-        //\r
-        if (Index < PrivateData->PpiData.PpiListEnd &&\r
-            (UINTN)PpiPointer->Ppi->Ppi < OldCheckingTop &&\r
-            (UINTN)PpiPointer->Ppi->Ppi >= OldCheckingBottom) {\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
+  for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {\r
+    if (Index < PrivateData->PpiData.PpiListEnd || Index > PrivateData->PpiData.NotifyListEnd) {\r
+      //\r
+      // Convert PPI pointer in old Heap\r
+      //\r
+      ConverSinglePpiPointer (\r
+        &PrivateData->PpiData.PpiListPtrs[Index],\r
+        (UINTN)SecCoreData->PeiTemporaryRamBase,\r
+        (UINTN)SecCoreData->PeiTemporaryRamBase + SecCoreData->PeiTemporaryRamSize,\r
+        PrivateData->HeapOffset,\r
+        PrivateData->HeapOffsetPositive\r
+        );\r
+        \r
+      //\r
+      // Convert PPI pointer in old Stack\r
+      //\r
+      ConverSinglePpiPointer (\r
+        &PrivateData->PpiData.PpiListPtrs[Index],\r
+        (UINTN)SecCoreData->StackBase,\r
+        (UINTN)SecCoreData->StackBase + SecCoreData->StackSize,\r
+        PrivateData->StackOffset,\r
+        PrivateData->StackOffsetPositive\r
+        );\r
+        \r
+      //\r
+      // Convert PPI pointer in old TempRam Hole\r
+      //\r
+      for (IndexHole = 0; IndexHole < HOLE_MAX_NUMBER; IndexHole ++) {\r
+        if (PrivateData->HoleData[IndexHole].Size == 0) {\r
+          continue;\r
         }\r
+        \r
+        ConverSinglePpiPointer (\r
+          &PrivateData->PpiData.PpiListPtrs[Index],\r
+          (UINTN)PrivateData->HoleData[IndexHole].Base,\r
+          (UINTN)PrivateData->HoleData[IndexHole].Base + PrivateData->HoleData[IndexHole].Size,\r
+          PrivateData->HoleData[IndexHole].Offset,\r
+          PrivateData->HoleData[IndexHole].OffsetPositive\r
+          );\r
       }\r
     }\r
   }\r
 }\r
 \r
+/**\r
+\r
+  This function installs an interface in the PEI PPI database by GUID. \r
+  The purpose of the service is to publish an interface that other parties\r
+  can use to call additional PEIMs.\r
 \r
+  @param PeiServices                An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param PpiList                    Pointer to a list of PEI PPI Descriptors.\r
 \r
+  @retval EFI_SUCCESS              if all PPIs in PpiList are successfully installed.\r
+  @retval EFI_INVALID_PARAMETER    if PpiList is NULL pointer\r
+                                   if any PPI in PpiList is not valid\r
+  @retval EFI_OUT_OF_RESOURCES     if there is no more memory resource to install PPI\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiInstallPpi (\r
   IN CONST EFI_PEI_SERVICES        **PeiServices,\r
   IN CONST EFI_PEI_PPI_DESCRIPTOR  *PpiList\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Install PPI services.\r
-\r
-Arguments:\r
-\r
-  PeiServices - Pointer to the PEI Service Table\r
-  PpiList     - Pointer to a list of PEI PPI Descriptors.\r
-\r
-Returns:\r
-\r
-    EFI_SUCCESS             - if all PPIs in PpiList are successfully installed.\r
-    EFI_INVALID_PARAMETER   - if PpiList is NULL pointer\r
-    EFI_INVALID_PARAMETER   - if any PPI in PpiList is not valid\r
-    EFI_OUT_OF_RESOURCES    - if there is no more memory resource to install PPI\r
-\r
---*/\r
 {\r
   PEI_CORE_INSTANCE *PrivateData;\r
   INTN              Index;\r
@@ -182,8 +207,9 @@ Returns:
 \r
   for (;;) {\r
     //\r
-    // Since PpiData is used for NotifyList and InstallList, max resource\r
+    // Since PpiData is used for NotifyList and PpiList, max resource\r
     // is reached if the Install reaches the NotifyList\r
+    // PcdPeiCoreMaxPpiSupported can be set to a larger value in DSC to satisfy more PPI requirement.\r
     //\r
     if (Index == PrivateData->PpiData.NotifyListEnd + 1) {\r
       return  EFI_OUT_OF_RESOURCES;\r
@@ -195,7 +221,7 @@ Returns:
     //\r
     if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_PPI) == 0) {\r
       PrivateData->PpiData.PpiListEnd = LastCallbackInstall;\r
-      DEBUG((EFI_D_ERROR, "ERROR -> InstallPpi: %g %x\n", PpiList->Guid, PpiList->Ppi));\r
+      DEBUG((EFI_D_ERROR, "ERROR -> InstallPpi: %g %p\n", PpiList->Guid, PpiList->Ppi));\r
       return  EFI_INVALID_PARAMETER;\r
     }\r
 \r
@@ -230,7 +256,23 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
 \r
+  This function reinstalls an interface in the PEI PPI database by GUID. \r
+  The purpose of the service is to publish an interface that other parties can \r
+  use to replace an interface of the same name in the protocol database with a \r
+  different interface.\r
+\r
+  @param PeiServices            An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param OldPpi                 Pointer to the old PEI PPI Descriptors.\r
+  @param NewPpi                 Pointer to the new PEI PPI Descriptors.\r
+\r
+  @retval EFI_SUCCESS           if the operation was successful\r
+  @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL\r
+  @retval EFI_INVALID_PARAMETER if NewPpi is not valid\r
+  @retval EFI_NOT_FOUND         if the PPI was not in the database\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiReInstallPpi (\r
@@ -238,26 +280,6 @@ PeiReInstallPpi (
   IN CONST EFI_PEI_PPI_DESCRIPTOR  *OldPpi,\r
   IN CONST EFI_PEI_PPI_DESCRIPTOR  *NewPpi\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Re-Install PPI services.\r
-\r
-Arguments:\r
-\r
-  PeiServices - Pointer to the PEI Service Table\r
-  OldPpi      - Pointer to the old PEI PPI Descriptors.\r
-  NewPpi      - Pointer to the new PEI PPI Descriptors.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - if the operation was successful\r
-  EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL\r
-  EFI_INVALID_PARAMETER - if NewPpi is not valid\r
-  EFI_NOT_FOUND         - if the PPI was not in the database\r
-\r
---*/\r
 {\r
   PEI_CORE_INSTANCE   *PrivateData;\r
   INTN                Index;\r
@@ -290,6 +312,7 @@ Returns:
   // Remove the old PPI from the database, add the new one.\r
   //\r
   DEBUG((EFI_D_INFO, "Reinstall PPI: %g\n", NewPpi->Guid));\r
+  ASSERT (Index < (INTN)(PcdGet32 (PcdPeiCoreMaxPpiSupported)));\r
   PrivateData->PpiData.PpiListPtrs[Index].Ppi = (EFI_PEI_PPI_DESCRIPTOR *) NewPpi;\r
 \r
   //\r
@@ -308,36 +331,31 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+\r
+  Locate a given named PPI.\r
+\r
+\r
+  @param PeiServices        An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param Guid               Pointer to GUID of the PPI.\r
+  @param Instance           Instance Number to discover.\r
+  @param PpiDescriptor      Pointer to reference the found descriptor. If not NULL,\r
+                            returns a pointer to the descriptor (includes flags, etc)\r
+  @param Ppi                Pointer to reference the found PPI\r
+\r
+  @retval EFI_SUCCESS   if the PPI is in the database\r
+  @retval EFI_NOT_FOUND if the PPI is not in the database\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiLocatePpi (\r
   IN CONST EFI_PEI_SERVICES        **PeiServices,\r
   IN CONST EFI_GUID                *Guid,\r
-  IN UINTN                   Instance,\r
-  IN OUT EFI_PEI_PPI_DESCRIPTOR  **PpiDescriptor,\r
-  IN OUT VOID                **Ppi\r
+  IN UINTN                         Instance,\r
+  IN OUT EFI_PEI_PPI_DESCRIPTOR    **PpiDescriptor,\r
+  IN OUT VOID                      **Ppi\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Locate a given named PPI.\r
-\r
-Arguments:\r
-\r
-  PeiServices   - Pointer to the PEI Service Table\r
-  Guid          - Pointer to GUID of the PPI.\r
-  Instance      - Instance Number to discover.\r
-  PpiDescriptor - Pointer to reference the found descriptor. If not NULL,\r
-                returns a pointer to the descriptor (includes flags, etc)\r
-  Ppi           - Pointer to reference the found PPI\r
-\r
-Returns:\r
-\r
-  Status -  EFI_SUCCESS   if the PPI is in the database\r
-            EFI_NOT_FOUND if the PPI is not in the database\r
---*/\r
 {\r
   PEI_CORE_INSTANCE   *PrivateData;\r
   INTN                Index;\r
@@ -383,31 +401,26 @@ Returns:
   return EFI_NOT_FOUND;\r
 }\r
 \r
+/**\r
 \r
+  This function installs a notification service to be called back when a given \r
+  interface is installed or reinstalled. The purpose of the service is to publish \r
+  an interface that other parties can use to call additional PPIs that may materialize later.\r
+\r
+  @param PeiServices        An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
+  @param NotifyList         Pointer to list of Descriptors to notify upon.\r
+\r
+  @retval EFI_SUCCESS           if successful\r
+  @retval EFI_OUT_OF_RESOURCES  if no space in the database\r
+  @retval EFI_INVALID_PARAMETER if not a good decriptor\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiNotifyPpi (\r
   IN CONST EFI_PEI_SERVICES           **PeiServices,\r
   IN CONST EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyList\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Install a notification for a given PPI.\r
-\r
-Arguments:\r
-\r
-  PeiServices - Pointer to the PEI Service Table\r
-  NotifyList  - Pointer to list of Descriptors to notify upon.\r
-\r
-Returns:\r
-\r
-  Status - EFI_SUCCESS           if successful\r
-           EFI_OUT_OF_RESOURCES  if no space in the database\r
-           EFI_INVALID_PARAMETER if not a good decriptor\r
-\r
---*/\r
 {\r
   PEI_CORE_INSTANCE                *PrivateData;\r
   INTN                             Index;\r
@@ -438,6 +451,7 @@ Returns:
     //\r
     // Since PpiData is used for NotifyList and InstallList, max resource\r
     // is reached if the Install reaches the PpiList\r
+    // PcdPeiCoreMaxPpiSupported can be set to a larger value in DSC to satisfy more Notify PPIs requirement.\r
     //\r
     if (Index == PrivateData->PpiData.PpiListEnd - 1) {\r
       return  EFI_OUT_OF_RESOURCES;\r
@@ -448,7 +462,7 @@ Returns:
     //\r
     if ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES) == 0) {\r
         PrivateData->PpiData.NotifyListEnd = LastCallbackNotify;\r
-        DEBUG((EFI_D_ERROR, "ERROR -> InstallNotify: %g %x\n", NotifyList->Guid, NotifyList->Notify));\r
+        DEBUG((EFI_D_ERROR, "ERROR -> InstallNotify: %g %p\n", NotifyList->Guid, NotifyList->Notify));\r
       return  EFI_INVALID_PARAMETER;\r
     }\r
 \r
@@ -502,29 +516,21 @@ Returns:
     PrivateData->PpiData.NotifyListEnd\r
     );\r
 \r
-\r
   return  EFI_SUCCESS;\r
 }\r
 \r
 \r
-VOID\r
-ProcessNotifyList (\r
-  IN PEI_CORE_INSTANCE  *PrivateData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Process the Notify List at dispatch level.\r
 \r
-Arguments:\r
-\r
-  PeiServices - Pointer to the PEI Service Table\r
-\r
-Returns:\r
-\r
---*/\r
+  @param PrivateData  PeiCore's private data structure.\r
 \r
+**/\r
+VOID\r
+ProcessNotifyList (\r
+  IN PEI_CORE_INSTANCE  *PrivateData\r
+  )\r
 {\r
   INTN                    TempValue;\r
 \r
@@ -564,7 +570,7 @@ Returns:
         EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH,\r
         PrivateData->PpiData.LastDispatchedInstall,\r
         PrivateData->PpiData.PpiListEnd,\r
-        FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1,\r
+        PcdGet32 (PcdPeiCoreMaxPpiSupported)-1,\r
         PrivateData->PpiData.DispatchListEnd\r
         );\r
       PrivateData->PpiData.LastDispatchedInstall = TempValue;\r
@@ -577,6 +583,18 @@ Returns:
   return;\r
 }\r
 \r
+/**\r
+\r
+  Dispatch notifications.\r
+\r
+  @param PrivateData        PeiCore's private data structure\r
+  @param NotifyType         Type of notify to fire.\r
+  @param InstallStartIndex  Install Beginning index.\r
+  @param InstallStopIndex   Install Ending index.\r
+  @param NotifyStartIndex   Notify Beginning index.\r
+  @param NotifyStopIndex    Notify Ending index.\r
+\r
+**/\r
 VOID\r
 DispatchNotify (\r
   IN PEI_CORE_INSTANCE  *PrivateData,\r
@@ -586,25 +604,6 @@ DispatchNotify (
   IN INTN                NotifyStartIndex,\r
   IN INTN                NotifyStopIndex\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Dispatch notifications.\r
-\r
-Arguments:\r
-\r
-  PeiServices         - Pointer to the PEI Service Table\r
-  NotifyType          - Type of notify to fire.\r
-  InstallStartIndex   - Install Beginning index.\r
-  InstallStopIndex    - Install Ending index.\r
-  NotifyStartIndex    - Notify Beginning index.\r
-  NotifyStopIndex    - Notify Ending index.\r
-\r
-Returns:  None\r
-\r
---*/\r
-\r
 {\r
   INTN                   Index1;\r
   INTN                   Index2;\r
@@ -631,19 +630,17 @@ Returns:  None
           (((INT32 *)SearchGuid)[1] == ((INT32 *)CheckGuid)[1]) &&\r
           (((INT32 *)SearchGuid)[2] == ((INT32 *)CheckGuid)[2]) &&\r
           (((INT32 *)SearchGuid)[3] == ((INT32 *)CheckGuid)[3])) {\r
-        DEBUG ((EFI_D_INFO, "Notify: PPI Guid: %g, Peim notify entry point: %x\n",\r
+        DEBUG ((EFI_D_INFO, "Notify: PPI Guid: %g, Peim notify entry point: %p\n",\r
           SearchGuid,\r
           NotifyDescriptor->Notify\r
           ));\r
         NotifyDescriptor->Notify (\r
-                            GetPeiServicesTablePointer (),\r
+                            (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),\r
                             NotifyDescriptor,\r
                             (PrivateData->PpiData.PpiListPtrs[Index2].Ppi)->Ppi\r
                             );\r
       }\r
     }\r
   }\r
-\r
-  return;\r
 }\r
 \r