]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeLib.c
Only include SAL related definitions if the CPU Arch is IPF
[mirror_edk2.git] / EdkModulePkg / Library / EdkUefiRuntimeLib / Ipf / RuntimeLib.c
index 00f557aa413870bdaa6aec6326c0efc3de6554d0..ba00daf0ff97b409a62bfff97bda6b2998266f37 100644 (file)
@@ -15,19 +15,15 @@ Module Name:
 \r
 --*/\r
 \r
-#include <SalApi.h>\r
+//#include <SalApi.h>\r
 #include <RuntimeLibInternal.h>\r
 \r
 //\r
 // Driver Lib Module Globals\r
 //\r
+static EFI_EVENT      mEfiVirtualNotifyEvent;\r
+EFI_RUNTIME_SERVICES  *mRT;\r
 \r
-STATIC EFI_EVENT                          mRuntimeNotifyEvent;\r
-STATIC EFI_EVENT                          mEfiVirtualNotifyEvent;\r
-\r
-EFI_RUNTIME_SERVICES                      *mRT;\r
-\r
-STATIC\r
 VOID\r
 EFIAPI\r
 RuntimeDriverExitBootServices (\r
@@ -52,21 +48,11 @@ Returns:
 \r
 --*/\r
 {\r
-  EFI_EVENT_NOTIFY  ChildNotifyEventHandler;\r
-  UINTN             Index;\r
-\r
-  for (Index = 0; _gDriverExitBootServicesEvent[Index] != NULL; Index++) {\r
-    ChildNotifyEventHandler = _gDriverExitBootServicesEvent[Index];\r
-    ChildNotifyEventHandler (Event, NULL);\r
+  if (EfiAtRuntime()) {\r
+    return;\r
   }\r
-\r
-  //\r
-  // Clear out BootService globals\r
-  //\r
-  gBS             = NULL;\r
 }\r
 \r
-STATIC\r
 VOID\r
 EFIAPI\r
 RuntimeLibVirtualNotifyEvent (\r
@@ -93,7 +79,7 @@ Returns:
 \r
 --*/\r
 {\r
-  UINTN Index;\r
+  UINTN             Index;\r
   EFI_EVENT_NOTIFY  ChildNotifyEventHandler;\r
 \r
   for (Index = 0; _gDriverSetVirtualAddressMapEvent[Index] != NULL; Index++) {\r
@@ -137,31 +123,19 @@ Returns:
 \r
   mRT = SystemTable->RuntimeServices;\r
 \r
-  //\r
-  // Register our ExitBootServices () notify function\r
-  //\r
-\r
-  Status = gBS->CreateEvent (\r
-                  EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,\r
-                  EFI_TPL_NOTIFY,\r
-                  RuntimeDriverExitBootServices,\r
-                  NULL,\r
-                  &mRuntimeNotifyEvent\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
   //\r
   // Register SetVirtualAddressMap () notify function\r
   //\r
-  \r
-  Status = gBS->CreateEvent (\r
-                  EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,\r
-                  EFI_TPL_NOTIFY,\r
-                  RuntimeLibVirtualNotifyEvent,\r
-                  NULL,\r
-                  &mEfiVirtualNotifyEvent\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
+  if (_gDriverSetVirtualAddressMapEvent[0] != NULL) {\r
+    Status = gBS->CreateEvent (\r
+                    EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,\r
+                    EFI_TPL_NOTIFY,\r
+                    RuntimeLibVirtualNotifyEvent,\r
+                    NULL,\r
+                    &mEfiVirtualNotifyEvent\r
+                    );\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -192,17 +166,13 @@ Returns:
 {\r
   EFI_STATUS  Status;\r
 \r
-  //\r
-  // Close our ExitBootServices () notify function\r
-  //\r
-  Status = gBS->CloseEvent (mRuntimeNotifyEvent);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
   //\r
   // Close SetVirtualAddressMap () notify function\r
   //\r
-  Status = gBS->CloseEvent (mEfiVirtualNotifyEvent);\r
-  ASSERT_EFI_ERROR (Status);\r
+  if (_gDriverSetVirtualAddressMapEvent[0] != NULL) {\r
+    Status = gBS->CloseEvent (mEfiVirtualNotifyEvent);\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
 \r
   return EFI_SUCCESS;\r
 }\r