]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
Move registration and processing of ExitBootServices() events into UefiDriverEntryPoi...
[mirror_edk2.git] / EdkModulePkg / Library / EdkUefiRuntimeLib / Ipf / RuntimeLib.c
index a4eeb3383838d3ff29a9d6f284ee1dd18be3ab09..00f557aa413870bdaa6aec6326c0efc3de6554d0 100644 (file)
@@ -13,10 +13,6 @@ Module Name:
 \r
     RuntimeLib.c\r
 \r
-Abstract:\r
-\r
-  Light weight lib to support Tiano drivers.\r
-\r
 --*/\r
 \r
 #include <SalApi.h>\r
@@ -26,13 +22,10 @@ Abstract:
 // Driver Lib Module Globals\r
 //\r
 \r
-STATIC EFI_EVENT            mRuntimeNotifyEvent;\r
-STATIC EFI_EVENT            mEfiVirtualNotifyEvent;\r
-\r
-STATIC EFI_PLABEL           mPlabel;\r
-STATIC EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *mEsalBootService;\r
+STATIC EFI_EVENT                          mRuntimeNotifyEvent;\r
+STATIC EFI_EVENT                          mEfiVirtualNotifyEvent;\r
 \r
-EFI_RUNTIME_SERVICES        *mRT                    = NULL;\r
+EFI_RUNTIME_SERVICES                      *mRT;\r
 \r
 STATIC\r
 VOID\r
@@ -66,6 +59,11 @@ Returns:
     ChildNotifyEventHandler = _gDriverExitBootServicesEvent[Index];\r
     ChildNotifyEventHandler (Event, NULL);\r
   }\r
+\r
+  //\r
+  // Clear out BootService globals\r
+  //\r
+  gBS             = NULL;\r
 }\r
 \r
 STATIC\r
@@ -103,20 +101,14 @@ Returns:
     ChildNotifyEventHandler (Event, NULL);\r
   }\r
 \r
-  mRT->ConvertPointer (0x0, (VOID **) &mPlabel.EntryPoint);\r
-  mRT->ConvertPointer (EFI_IPF_GP_POINTER, (VOID **) &mPlabel.GP);\r
-\r
-  SetEsalVirtualEntryPoint (mPlabel.EntryPoint, mPlabel.GP);\r
-\r
   //\r
-  // Clear out BootService globals\r
+  // Update global for Runtime Services Table\r
   //\r
-  gBS             = NULL;\r
-  gST             = NULL;\r
-  mRT             = NULL;\r
+  EfiConvertPointer (0, (VOID **) &mRT);\r
 }\r
 \r
 EFI_STATUS\r
+EFIAPI\r
 RuntimeDriverLibConstruct (\r
   IN EFI_HANDLE           ImageHandle,\r
   IN EFI_SYSTEM_TABLE     *SystemTable\r
@@ -141,29 +133,10 @@ Returns:
 \r
 --*/\r
 {\r
-  EFI_PLABEL  *Plabel;\r
   EFI_STATUS  Status;\r
 \r
   mRT = SystemTable->RuntimeServices;\r
 \r
-  //\r
-  // The protocol contains a function pointer, which is an indirect procedure call.\r
-  // An indirect procedure call goes through a plabel, and pointer to a function is\r
-  // a pointer to a plabel. To implement indirect procedure calls that can work in\r
-  // both physical and virtual mode, two plabels are required (one physical and one\r
-  // virtual). So lets grap the physical PLABEL for the EsalEntryPoint and store it\r
-  // away. We cache it in a module global, so we can register the vitrual version.\r
-  //\r
-  Status = gBS->LocateProtocol (&gEfiExtendedSalBootServiceProtocolGuid, NULL, &mEsalBootService);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Plabel              = (EFI_PLABEL *) (UINTN) mEsalBootService->ExtendedSalProc;\r
-\r
-  mPlabel.EntryPoint  = Plabel->EntryPoint;\r
-  mPlabel.GP          = Plabel->GP;\r
-\r
-  SetEsalPhysicalEntryPoint (mPlabel.EntryPoint, mPlabel.GP);\r
-\r
   //\r
   // Register our ExitBootServices () notify function\r
   //\r
@@ -186,7 +159,7 @@ Returns:
                   EFI_TPL_NOTIFY,\r
                   RuntimeLibVirtualNotifyEvent,\r
                   NULL,\r
-                  mEfiVirtualNotifyEvent\r
+                  &mEfiVirtualNotifyEvent\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
@@ -194,6 +167,7 @@ Returns:
 }\r
 \r
 EFI_STATUS\r
+EFIAPI\r
 RuntimeDriverLibDeconstruct (\r
   VOID\r
   )\r
@@ -234,6 +208,7 @@ Returns:
 }\r
 \r
 BOOLEAN\r
+EFIAPI\r
 EfiAtRuntime (\r
   VOID\r
   )\r
@@ -259,6 +234,7 @@ Returns:
 }\r
 \r
 BOOLEAN\r
+EFIAPI\r
 EfiGoneVirtual (\r
   VOID\r
   )\r
@@ -282,3 +258,4 @@ Returns:
 \r
   return (BOOLEAN) (ReturnReg.r9 == 1);\r
 }\r
+\r