]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiRuntimeLib/RuntimeLib.c
Clean up the unused EDK_RELEASE_VERSION, PI_SPECIFICATION_VERSION and EFI_SPECIFICATI...
[mirror_edk2.git] / MdePkg / Library / UefiRuntimeLib / RuntimeLib.c
index 4565955690fd41981af9ff421ec91aad844a39e7..3205d57bc0eac286829d92e387d92e6286dbeefe 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  Library utility functions for Runtime driver.\r
+  UEFI Runtime Library implementation for non IPF processor types.\r
 \r
-Copyright (c) 2006 Intel Corporation. <BR>\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
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -12,16 +12,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include <RuntimeLibInternal.h>\r
+#include "RuntimeLibInternal.h"\r
 \r
 ///\r
 /// Driver Lib Module Globals\r
 ///\r
 \r
-STATIC EFI_EVENT              mEfiVirtualNotifyEvent;\r
-STATIC EFI_EVENT              mEfiExitBootServicesEvent;\r
-STATIC BOOLEAN                mEfiGoneVirtual         = FALSE;\r
-STATIC BOOLEAN                mEfiAtRuntime           = FALSE;\r
+EFI_EVENT              mEfiVirtualNotifyEvent;\r
+EFI_EVENT              mEfiExitBootServicesEvent;\r
+BOOLEAN                mEfiGoneVirtual         = FALSE;\r
+BOOLEAN                mEfiAtRuntime           = FALSE;\r
 EFI_RUNTIME_SERVICES          *mRT;\r
 \r
 /**\r
@@ -70,6 +70,8 @@ RuntimeLibVirtualNotifyEvent (
 \r
 /**\r
   Intialize runtime Driver Lib if it has not yet been initialized.\r
+  It will ASSERT() if gRT is NULL or gBS is NULL.\r
+  It will ASSERT() if that operation fails.\r
 \r
   @param[in]  ImageHandle   The firmware allocated handle for the EFI image.\r
   @param[in]  SystemTable   A pointer to the EFI System Table.\r
@@ -85,13 +87,13 @@ RuntimeDriverLibConstruct (
 {\r
   EFI_STATUS  Status;\r
 \r
+  ASSERT (gRT != NULL);\r
+  ASSERT (gBS != NULL);\r
+\r
   mRT = gRT;\r
-  ASSERT (mRT != NULL);\r
-  \r
   //\r
   // Register SetVirtualAddressMap () notify function\r
   //\r
-  ASSERT (gBS != NULL);\r
   Status = gBS->CreateEvent (\r
                   EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,\r
                   TPL_NOTIFY,\r
@@ -116,9 +118,10 @@ RuntimeDriverLibConstruct (
 }\r
 \r
 /**\r
-  This routine will free some resources which have been allocated in\r
-  EfiInitializeRuntimeDriverLib(). If a runtime driver exits with an error,\r
-  it must call this routine to free the allocated resource before the exiting.\r
+  If a runtime driver exits with an error, it must call this routine \r
+  to free the allocated resource before the exiting.\r
+  It will ASSERT() if gBS is NULL.\r
+  It will ASSERT() if that operation fails.\r
 \r
   @param[in]  ImageHandle   The firmware allocated handle for the EFI image.\r
   @param[in]  SystemTable   A pointer to the EFI System Table.\r
@@ -149,9 +152,16 @@ RuntimeDriverLibDeconstruct (
 }\r
 \r
 /**\r
-  Return TRUE if ExitBootServices () has been called.\r
+  This function allows the caller to determine if UEFI ExitBootServices() has been called.\r
+\r
+  This function returns TRUE after all the EVT_SIGNAL_EXIT_BOOT_SERVICES functions have\r
+  executed as a result of the OS calling ExitBootServices().  Prior to this time FALSE\r
+  is returned. This function is used by runtime code to decide it is legal to access\r
+  services that go away after ExitBootServices().\r
+\r
+  @retval  TRUE  The system has finished executing the EVT_SIGNAL_EXIT_BOOT_SERVICES event.\r
+  @retval  FALSE The system has not finished executing the EVT_SIGNAL_EXIT_BOOT_SERVICES event.\r
 \r
-  @retval TRUE If ExitBootServices () has been called\r
 **/\r
 BOOLEAN\r
 EFIAPI\r
@@ -163,9 +173,16 @@ EfiAtRuntime (
 }\r
 \r
 /**\r
-  Return TRUE if SetVirtualAddressMap () has been called.\r
+  This function allows the caller to determine if UEFI SetVirtualAddressMap() has been called. \r
+\r
+  This function returns TRUE after all the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE functions have\r
+  executed as a result of the OS calling SetVirtualAddressMap(). Prior to this time FALSE\r
+  is returned. This function is used by runtime code to decide it is legal to access services\r
+  that go away after SetVirtualAddressMap().\r
+\r
+  @retval  TRUE  The system has finished executing the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.\r
+  @retval  FALSE The system has not finished executing the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.\r
 \r
-  @retval TRUE  If SetVirtualAddressMap () has been called\r
 **/\r
 BOOLEAN\r
 EFIAPI\r