]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiRuntimeLib.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / Library / UefiRuntimeLib.h
index d6a709f3532d42f388ce3e08568e5af383664bfa..888410921bc88f3747d4dfb5e771e3938030ff11 100644 (file)
@@ -2,11 +2,11 @@
   Provides library functions for each of the UEFI Runtime Services.\r
   Only available to DXE and UEFI module types.\r
 \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
-http://opensource.org/licenses/bsd-license.php\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under\r
+the terms and conditions of the BSD License that accompanies this distribution.\r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.\r
 \r
 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
@@ -15,11 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef __UEFI_RUNTIME_LIB__\r
 #define __UEFI_RUNTIME_LIB__\r
 \r
-\r
-extern const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[];\r
-\r
-extern const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[];\r
-\r
 /**\r
   This function allows the caller to determine if UEFI ExitBootServices() has been called.\r
 \r
@@ -39,7 +34,7 @@ EfiAtRuntime (
   );\r
 \r
 /**\r
-  This function allows the caller to determine if UEFI 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
@@ -65,7 +60,7 @@ EfiGoneVirtual (
   information returned by GetTime() are the values that were last set via SetTime().\r
   The GetTime() function should take approximately the same amount of time to read the time each\r
   time it is called. All reported device capabilities are to be rounded up.\r
-  During runtime, if a PC-AT CMOS device is present in the platform the caller must synchronize\r
+  During runtime, if a PC-AT CMOS device is present in the platform, the caller must synchronize\r
   access to the device before calling GetTime().\r
 \r
   @param  Time         A pointer to storage to receive a snapshot of the current time.\r
@@ -92,7 +87,7 @@ EfiGetTime (
   to loop based on the current time. For example, if the device does not support a hardware reset\r
   for the sub-resolution time, the code is not to implement the feature by waiting for the time to\r
   wrap.\r
-  During runtime, if a PC-AT CMOS device is present in the platform the caller must synchronize\r
+  During runtime, if a PC-AT CMOS device is present in the platform, the caller must synchronize\r
   access to the device before calling SetTime().\r
 \r
   @param  Time  A pointer to the current time. Type EFI_TIME is defined in the GetTime()\r
@@ -113,7 +108,7 @@ EfiSetTime (
   );\r
 \r
 /**\r
-  Returns the current wakeup alarm clock setting.\r
+  This service is a wrapper for the UEFI Runtime Service GetWakeupTime().\r
 \r
   The alarm clock time may be rounded from the set alarm clock time to be within the resolution\r
   of the alarm clock device. The resolution of the alarm clock device is defined to be one second.\r
@@ -125,7 +120,7 @@ EfiSetTime (
   @param  Time     The current alarm setting. Type EFI_TIME is defined in the GetTime()\r
                    function description.\r
 \r
-  @retval  EFI_SUCCESS           The alarm settings were returned.\r
+  @retval  EFI_SUCCESS            The alarm settings were returned.\r
   @retval  EFI_INVALID_PARAMETER  Enabled is NULL.\r
   @retval  EFI_INVALID_PARAMETER  Pending is NULL.\r
   @retval  EFI_INVALID_PARAMETER  Time is NULL.\r
@@ -142,7 +137,14 @@ EfiGetWakeupTime (
   );\r
 \r
 /**\r
-  Sets the system wakeup alarm clock time.\r
+  This service is a wrapper for the UEFI Runtime Service SetWakeupTime()\r
+\r
+  Setting a system wakeup alarm causes the system to wake up or power on at the set time.\r
+  When the alarm fires, the alarm signal is latched until it is acknowledged by calling SetWakeupTime()\r
+  to disable the alarm. If the alarm fires before the system is put into a sleeping or off state,\r
+  since the alarm signal is latched the system will immediately wake up. If the alarm fires while\r
+  the system is off and there is insufficient power to power on the system, the system is powered\r
+  on when power is restored.\r
 \r
   @param  Enable  Enable or disable the wakeup alarm.\r
   @param  Time    If Enable is TRUE, the time to set the wakeup alarm for. Type EFI_TIME\r
@@ -164,14 +166,21 @@ EfiSetWakeupTime (
   );\r
 \r
 /**\r
-  Return value of variable.\r
+  This service is a wrapper for the UEFI Runtime Service GetVariable().\r
 \r
-  @param  VariableName the name of the vendor's variable, it's a\r
-                       Null-Terminated Unicode String\r
+  Each vendor may create and manage its own variables without the risk of name conflicts by\r
+  using a unique VendorGuid. When a variable is set, its Attributes are supplied to indicate\r
+  how the data variable should be stored and maintained by the system. The attributes affect\r
+  when the variable may be accessed and volatility of the data. Any attempts to access a variable\r
+  that does not have the attribute set for runtime access will yield the EFI_NOT_FOUND error.\r
+  If the Data buffer is too small to hold the contents of the variable, the error EFI_BUFFER_TOO_SMALL\r
+  is returned and DataSize is set to the required buffer size to obtain the data.\r
+\r
+  @param  VariableName the name of the vendor's variable, it's a Null-Terminated Unicode String\r
   @param  VendorGuid   Unify identifier for vendor.\r
   @param  Attributes   Point to memory location to return the attributes of variable. If the point\r
                        is NULL, the parameter would be ignored.\r
-  @param  DataSize     As input, point to the maxinum size of return Data-Buffer.\r
+  @param  DataSize     As input, point to the maximum size of return Data-Buffer.\r
                        As output, point to the actual size of the returned Data-Buffer.\r
   @param  Data         Point to return Data-Buffer.\r
 \r
@@ -197,10 +206,16 @@ EfiGetVariable (
   );\r
 \r
 /**\r
-  Enumerates variable's name.\r
+  This service is a wrapper for the UEFI Runtime Service GetNextVariableName().\r
+\r
+  GetNextVariableName() is called multiple times to retrieve the VariableName and VendorGuid of\r
+  all variables currently available in the system. On each call to GetNextVariableName() the\r
+  previous results are passed into the interface, and on output the interface returns the next\r
+  variable name data. When the entire variable list has been returned, the error EFI_NOT_FOUND\r
+  is returned.\r
 \r
-  @param  VariableNameSize As input, point to maxinum size of variable name.\r
-                           As output, point to actual size of varaible name.\r
+  @param  VariableNameSize As input, point to maximum size of variable name.\r
+                           As output, point to actual size of variable name.\r
   @param  VariableName     As input, supplies the last VariableName that was returned by\r
                            GetNextVariableName().\r
                            As output, returns the name of variable. The name\r
@@ -229,9 +244,12 @@ EfiGetNextVariableName (
   );\r
 \r
 /**\r
-  Sets value of variable.\r
+  This service is a wrapper for the UEFI Runtime Service GetNextVariableName()\r
 \r
-  @param  VariableName the name of the vendor's variable, it's a\r
+  Variables are stored by the firmware and may maintain their values across power cycles. Each vendor\r
+  may create and manage its own variables without the risk of name conflicts by using a unique VendorGuid.\r
+\r
+  @param  VariableName the name of the vendor's variable, as a\r
                        Null-Terminated Unicode String\r
   @param  VendorGuid   Unify identifier for vendor.\r
   @param  Attributes   Point to memory location to return the attributes of variable. If the point\r
@@ -265,7 +283,13 @@ EfiSetVariable (
   );\r
 \r
 /**\r
-  Returns the next high 32 bits of platform's monotonic counter.\r
+  This service is a wrapper for the UEFI Runtime Service GetNextHighMonotonicCount().\r
+\r
+  The platform's monotonic counter is comprised of two 32-bit quantities: the high 32 bits and\r
+  the low 32 bits. During boot service time the low 32-bit value is volatile: it is reset to zero\r
+  on every system reset and is increased by 1 on every call to GetNextMonotonicCount(). The high\r
+  32-bit value is nonvolatile and is increased by 1 whenever the system resets or whenever the low\r
+  32-bit count (returned by GetNextMonoticCount()) overflows.\r
 \r
   @param  HighCount Pointer to returned value.\r
 \r
@@ -281,23 +305,32 @@ EfiGetNextHighMonotonicCount (
   );\r
 \r
 /**\r
-  Resets the entire platform.\r
+  This service is a wrapper for the UEFI Runtime Service ResetSystem().\r
+\r
+  The ResetSystem()function resets the entire platform, including all processors and devices,and reboots the system.\r
+  Calling this interface with ResetType of EfiResetCold causes a system-wide reset. This sets all circuitry within\r
+  the system to its initial state. This type of reset is asynchronous to system operation and operates without regard\r
+  to cycle boundaries. EfiResetCold is tantamount to a system power cycle.\r
+  Calling this interface with ResetType of EfiResetWarm causes a system-wide initialization. The processors are set to\r
+  their initial state, and pending cycles are not corrupted. If the system does not support this reset type, then an\r
+  EfiResetCold must be performed.\r
+  Calling this interface with ResetType of EfiResetShutdown causes the system to enter a power state equivalent to the\r
+  ACPI G2/S5 or G3 states. If the system does not support this reset type, then when the system is rebooted, it should\r
+  exhibit the EfiResetCold attributes.\r
+  The platform may optionally log the parameters from any non-normal reset that occurs.\r
+  The ResetSystem() function does not return.\r
 \r
   @param  ResetType   The type of reset to perform.\r
-  @param  ResetStatus The status code for the reset. If the system reset is part of a\r
-                      normal operation, the status code would be EFI_SUCCESS. If the system\r
-                      reset is due to some type of failure the most appropriate EFI Status\r
-                      code would be used.\r
+  @param  ResetStatus The status code for the reset. If the system reset is part of a normal operation, the status code\r
+                      would be EFI_SUCCESS. If the system reset is due to some type of failure the most appropriate EFI\r
+                      Status code would be used.\r
   @param  DataSizeThe size, in bytes, of ResetData.\r
-  @param  ResetData   For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown\r
-                      the data buffer starts with a Null-terminated Unicode string, optionally\r
-                      followed by additional binary data. The string is a description that the\r
-                      caller may use to further indicate the reason for the system reset. ResetData\r
-                      is only valid if ResetStatus is something other then EFI_SUCCESS. This\r
-                      pointer must be a physical address. For a ResetType of EfiRestUpdate the\r
-                      data buffer also starts with a Null-terminated string that is followed by\r
-                      a physical VOID * to an EFI_CAPSULE_HEADER.\r
-\r
+  @param  ResetData   For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown the data buffer starts with a\r
+                      Null-terminated Unicode string, optionally followed by additional binary data. The string is a\r
+                      description that the caller may use to further indicate the reason for the system reset. ResetData\r
+                      is only valid if ResetStatus is something other then EFI_SUCCESS. This pointer must be a physical\r
+                      address. For a ResetType of EfiResetPlatformSpecific the data buffer also starts with a Null-terminated\r
+                      string that is followed by an EFI_GUID that describes the specific type of reset to perform.\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -305,11 +338,14 @@ EfiResetSystem (
   IN EFI_RESET_TYPE               ResetType,\r
   IN EFI_STATUS                   ResetStatus,\r
   IN UINTN                        DataSize,\r
-  IN CHAR16                       *ResetData\r
+  IN VOID                         *ResetData OPTIONAL\r
   );\r
 \r
 /**\r
-  This service converts a function pointer from physical to virtual addressing. \r
+  This service is a wrapper for the UEFI Runtime Service ConvertPointer().\r
+\r
+  The ConvertPointer() function is used by an EFI component during the SetVirtualAddressMap() operation.\r
+  ConvertPointer()must be called using physical address pointers during the execution of SetVirtualAddressMap().\r
 \r
   @param  DebugDisposition   Supplies type information for the pointer being converted.\r
   @param  Address            The pointer to a pointer that is to be fixed to be the\r
@@ -333,8 +369,8 @@ EfiConvertPointer (
 /**\r
   Determines the new virtual address that is to be used on subsequent memory accesses.\r
 \r
-  For IA32, X64, and EBC, this service is a wrapper for the UEFI Runtime Service\r
-  ConvertPointer().  See the UEFI Specification for details. \r
+  For IA32, x64, and EBC, this service is a wrapper for the UEFI Runtime Service\r
+  ConvertPointer().  See the UEFI Specification for details.\r
   For IPF, this function interprets Address as a pointer to an EFI_PLABEL structure\r
   and both the EntryPoint and GP fields of an EFI_PLABEL are converted from physical\r
   to virtiual addressing.  Since IPF allows the GP to point to an address outside\r
@@ -360,7 +396,12 @@ EfiConvertFunctionPointer (
   );\r
 \r
 /**\r
-  Change the runtime addressing mode of EFI firmware from physical to virtual.\r
+  This service is a wrapper for the UEFI Runtime Service SetVirtualAddressMap().\r
+\r
+  The SetVirtualAddressMap() function is used by the OS loader. The function can only be called\r
+  at runtime, and is called by the owner of the system's memory map. I.e., the component which\r
+  called ExitBootServices(). All events of type EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE must be signaled\r
+  before SetVirtualAddressMap() returns.\r
 \r
   @param  MemoryMapSize         The size in bytes of VirtualMap.\r
   @param  DescriptorSize        The size in bytes of an entry in the VirtualMap.\r
@@ -400,8 +441,8 @@ EfiSetVirtualAddressMap (
   @param  DebugDisposition   Supplies type information for the pointer being converted.\r
   @param  ListHead           Head of linked list to convert.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to e3xecute the function.\r
+  @retval  EFI_SUCCESS  Successfully executed the function.\r
+  @retval  !EFI_SUCCESS Failed to execute the function.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -412,12 +453,12 @@ EfiConvertList (
   );\r
 \r
 /**\r
-  Passes capsules to the firmware with both virtual and physical mapping.\r
-  Depending on the intended consumption, the firmware may\r
-  process the capsule immediately. If the payload should persist across a\r
-  system reset, the reset value returned from EFI_QueryCapsuleCapabilities must\r
-  be passed into ResetSystem() and will cause the capsule to be processed by\r
-  the firmware as part of the reset process.\r
+  This service is a wrapper for the UEFI Runtime Service UpdateCapsule().\r
+\r
+  Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r
+  consumption, the firmware may process the capsule immediately. If the payload should persist across a\r
+  system reset, the reset value returned from EFI_QueryCapsuleCapabilities must be passed into ResetSystem()\r
+  and will cause the capsule to be processed by the firmware as part of the reset process.\r
 \r
   @param  CapsuleHeaderArray    Virtual pointer to an array of virtual pointers to the capsules\r
                                 being passed into update capsule. Each capsules is assumed to\r
@@ -436,9 +477,10 @@ EfiConvertList (
                                 CapsuleHeaderArray. This parameter is only referenced if\r
                                 the capsules are defined to persist across system reset.\r
 \r
-  @retval EFI_SUCCESS           Valid capsule was passed. If CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set,\r
+  @retval EFI_SUCCESS           A valid capsule was passed. If CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set,\r
                                 the capsule has been successfully processed by the firmware.\r
-  @retval EFI_INVALID_PARAMETER CapsuleSize or HeaderSize is NULL.\r
+  @retval EFI_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were\r
+                                set in the capsule header.\r
   @retval EFI_INVALID_PARAMETER CapsuleCount is 0\r
   @retval EFI_DEVICE_ERROR      The capsule update was started, but failed due to a device error.\r
   @retval EFI_UNSUPPORTED       The capsule type is not supported on this platform.\r
@@ -455,6 +497,8 @@ EfiUpdateCapsule (
 \r
 \r
 /**\r
+  This service is a wrapper for the UEFI Runtime Service QueryCapsuleCapabilities().\r
+\r
   The QueryCapsuleCapabilities() function allows a caller to test to see if a capsule or\r
   capsules can be updated via UpdateCapsule(). The Flags values in the capsule header and\r
   size of the entire capsule is checked.\r
@@ -479,7 +523,7 @@ EfiUpdateCapsule (
                                 Undefined on input.\r
   @param  ResetType             Returns the type of reset required for the capsule update.\r
 \r
-  @retval EFI_SUCCESS           Valid answer returned.\r
+  @retval EFI_SUCCESS           A valid answer was returned.\r
   @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.\r
   @retval EFI_UNSUPPORTED       The capsule type is not supported on this platform, and\r
                                 MaximumCapsuleSize and ResetType are undefined.\r
@@ -497,7 +541,7 @@ EfiQueryCapsuleCapabilities (
 \r
 \r
 /**\r
-  Returns information about the EFI variables.\r
+  This service is a wrapper for the UEFI Runtime Service QueryVariableInfo().\r
 \r
   The QueryVariableInfo() function allows a caller to obtain the information about the\r
   maximum size of the storage space available for the EFI variables, the remaining size of the storage\r
@@ -518,16 +562,17 @@ EfiQueryCapsuleCapabilities (
   @param  RemainingVariableStorageSize\r
                                 Returns the remaining size of the storage space\r
                                 available for the EFI variables associated with the\r
-                                attributes specified..\r
+                                attributes specified.\r
   @param  MaximumVariableSize   Returns the maximum size of the individual EFI\r
                                 variables associated with the attributes specified.\r
 \r
-  @retval EFI_SUCCESS           Valid answer returned.\r
+  @retval EFI_SUCCESS           A valid answer was returned.\r
   @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied.\r
   @retval EFI_UNSUPPORTED       EFI_UNSUPPORTED The attribute is not supported on this platform, and the\r
                                 MaximumVariableStorageSize,\r
                                 RemainingVariableStorageSize, MaximumVariableSize\r
                                 are undefined.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r