]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code have been checked with spec.
authorjji4 <jji4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 20 Nov 2008 05:19:15 +0000 (05:19 +0000)
committerjji4 <jji4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 20 Nov 2008 05:19:15 +0000 (05:19 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6646 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Library/UefiRuntimeLib.h

index c29d9a15b446671a09c055ea847c8b68379fa8a3..d6a709f3532d42f388ce3e08568e5af383664bfa 100644 (file)
@@ -2,7 +2,7 @@
   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\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
@@ -21,12 +21,15 @@ extern const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[];
 extern const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[];\r
 \r
 /**\r
-  Check to see if the execute context is in Runtime phase or not.\r
+  This function allows the caller to determine if UEFI ExitBootServices() has been called.\r
 \r
-  @param  None.\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 driver is in SMM.\r
-  @retval  FALSE The driver is not in SMM.\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
 **/\r
 BOOLEAN\r
@@ -36,10 +39,15 @@ EfiAtRuntime (
   );\r
 \r
 /**\r
-  Check to see if the SetVirtualAddressMsp() is invoked or not.\r
+  This function allows the caller to determine if UEFI SetVirtualAddressMap() has been called. \r
 \r
-  @retval  TRUE  SetVirtualAddressMsp() has been called.\r
-  @retval  FALSE SetVirtualAddressMsp() has not been called.\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
 **/\r
 BOOLEAN\r
@@ -49,31 +57,53 @@ EfiGoneVirtual (
   );\r
 \r
 /**\r
-  Return current time and date information, and time-keeping\r
-  capabilities of hardware platform.\r
+  This service is a wrapper for the UEFI Runtime Service GetTime().\r
+\r
+  The GetTime() function returns a time that was valid sometime during the call to the function.\r
+  While the returned EFI_TIME structure contains TimeZone and Daylight savings time information,\r
+  the actual clock does not maintain these values. The current time zone and daylight saving time\r
+  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
+  access to the device before calling GetTime().\r
 \r
   @param  Time         A pointer to storage to receive a snapshot of the current time.\r
   @param  Capabilities An optional pointer to a buffer to receive the real time clock device's\r
                        capabilities.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to e3xecute the function.\r
+  @retval  EFI_SUCCESS            The operation completed successfully.\r
+  @retval  EFI_INVALID_PARAMETER  Time is NULL.\r
+  @retval  EFI_DEVICE_ERROR       The time could not be retrieved due to a hardware error.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 EfiGetTime (\r
   OUT EFI_TIME                    *Time,\r
-  OUT EFI_TIME_CAPABILITIES       *Capabilities\r
+  OUT EFI_TIME_CAPABILITIES       *Capabilities  OPTIONAL\r
   );\r
 \r
 /**\r
-  Set current time and date information.\r
-\r
-  @param  Time         A pointer to cache of time setting.\r
-\r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  This service is a wrapper for the UEFI Runtime Service SetTime().\r
+\r
+  The SetTime() function sets the real time clock device to the supplied time, and records the\r
+  current time zone and daylight savings time information. The SetTime() function is not allowed\r
+  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
+  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
+                function description. Full error checking is performed on the different\r
+                fields of the EFI_TIME structure (refer to the EFI_TIME definition in the\r
+                GetTime() function description for full details), and EFI_INVALID_PARAMETER\r
+                is returned if any field is out of range.\r
+\r
+  @retval  EFI_SUCCESS            The operation completed successfully.\r
+  @retval  EFI_INVALID_PARAMETER  A time field is out of range.\r
+  @retval  EFI_DEVICE_ERROR       The time could not be set due to a hardware error.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -83,14 +113,24 @@ EfiSetTime (
   );\r
 \r
 /**\r
-  Return current wakeup alarm clock setting.\r
+  Returns the current wakeup alarm clock setting.\r
 \r
-  @param  Enabled Indicate if the alarm clock is enabled or disabled.\r
-  @param  Pending Indicate if the alarm signal is pending and requires acknowledgement.\r
-  @param  Time    Current alarm clock setting.\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
+  During runtime, if a PC-AT CMOS device is present in the platform the caller must synchronize\r
+  access to the device before calling GetWakeupTime().\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to e3xecute the function.\r
+  @param  Enabled  Indicates if the alarm is currently enabled or disabled.\r
+  @param  Pending  Indicates if the alarm signal is pending and requires acknowledgement.\r
+  @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_INVALID_PARAMETER  Enabled is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  Pending is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  Time is NULL.\r
+  @retval  EFI_DEVICE_ERROR       The wakeup time could not be retrieved due to a hardware error.\r
+  @retval  EFI_UNSUPPORTED        A wakeup timer is not supported on this platform.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -102,20 +142,25 @@ EfiGetWakeupTime (
   );\r
 \r
 /**\r
-  Set current wakeup alarm clock.\r
+  Sets the system wakeup alarm clock time.\r
 \r
-  @param  Enable Enable or disable current alarm clock..\r
-  @param  Time   Point to alarm clock setting.\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
+                  is defined in the GetTime() function description. If Enable is FALSE,\r
+                  then this parameter is optional, and may be NULL.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to e3xecute the function.\r
+  @retval  EFI_SUCCESS            If Enable is TRUE, then the wakeup alarm was enabled.\r
+                                  If Enable is FALSE, then the wakeup alarm was disabled.\r
+  @retval  EFI_INVALID_PARAMETER  A time field is out of range.\r
+  @retval  EFI_DEVICE_ERROR       The wakeup time could not be set due to a hardware error.\r
+  @retval  EFI_UNSUPPORTED        A wakeup timer is not supported on this platform.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 EfiSetWakeupTime (\r
   IN BOOLEAN                      Enable,\r
-  IN EFI_TIME                     *Time\r
+  IN EFI_TIME                     *Time   OPTIONAL\r
   );\r
 \r
 /**\r
@@ -130,9 +175,16 @@ EfiSetWakeupTime (
                        As output, point to the actual size of the returned Data-Buffer.\r
   @param  Data         Point to return Data-Buffer.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to e3xecute the function.\r
-\r
+  @retval  EFI_SUCCESS            The function completed successfully.\r
+  @retval  EFI_NOT_FOUND          The variable was not found.\r
+  @retval  EFI_BUFFER_TOO_SMALL   The DataSize is too small for the result. DataSize has\r
+                                  been updated with the size needed to complete the request.\r
+  @retval  EFI_INVALID_PARAMETER  VariableName is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  VendorGuid is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  DataSize is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  The DataSize is not too small and Data is NULL.\r
+  @retval  EFI_DEVICE_ERROR       The variable could not be retrieved due to a hardware error.\r
+  @retval  EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -157,8 +209,15 @@ EfiGetVariable (
                            GetNextVriableName().\r
                            As output, returns the VendorGuid of the current variable.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to e3xecute the function.\r
+  @retval  EFI_SUCCESS           The function completed successfully.\r
+  @retval  EFI_NOT_FOUND         The next variable was not found.\r
+  @retval  EFI_BUFFER_TOO_SMALL  The VariableNameSize is too small for the result.\r
+                                 VariableNameSize has been updated with the size needed\r
+                                 to complete the request.\r
+  @retval  EFI_INVALID_PARAMETER VariableNameSize is NULL.\r
+  @retval  EFI_INVALID_PARAMETER VariableName is NULL.\r
+  @retval  EFI_INVALID_PARAMETER VendorGuid is NULL.\r
+  @retval  EFI_DEVICE_ERROR      The variable name could not be retrieved due to a hardware error.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -180,8 +239,19 @@ EfiGetNextVariableName (
   @param  DataSize     The size in bytes of Data-Buffer.\r
   @param  Data         Point to the content of the variable.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to e3xecute the function.\r
+  @retval  EFI_SUCCESS            The firmware has successfully stored the variable and its data as\r
+                                  defined by the Attributes.\r
+  @retval  EFI_INVALID_PARAMETER  An invalid combination of attribute bits was supplied, or the\r
+                                  DataSize exceeds the maximum allowed.\r
+  @retval  EFI_INVALID_PARAMETER  VariableName is an empty Unicode string.\r
+  @retval  EFI_OUT_OF_RESOURCES   Not enough storage is available to hold the variable and its data.\r
+  @retval  EFI_DEVICE_ERROR       The variable could not be saved due to a hardware failure.\r
+  @retval  EFI_WRITE_PROTECTED    The variable in question is read-only.\r
+  @retval  EFI_WRITE_PROTECTED    The variable in question cannot be deleted.\r
+  @retval  EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\r
+                                  set but the AuthInfo does NOT pass the validation check carried\r
+                                  out by the firmware.\r
+  @retval  EFI_NOT_FOUND          The variable trying to be updated or deleted was not found.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -199,8 +269,9 @@ EfiSetVariable (
 \r
   @param  HighCount Pointer to returned value.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to e3xecute the function.\r
+  @retval  EFI_SUCCESS           The next high monotonic count was returned.\r
+  @retval  EFI_DEVICE_ERROR      The device is not functioning properly.\r
+  @retval  EFI_INVALID_PARAMETER HighCount is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -213,10 +284,19 @@ EfiGetNextHighMonotonicCount (
   Resets the entire platform.\r
 \r
   @param  ResetType   The type of reset to perform.\r
-  @param  ResetStatus The status code for reset.\r
-  @param  DataSize    The size in bytes of reset data.\r
-  @param  ResetData   Pointer to data buffer that includes\r
-                      Null-Terminated Unicode string.\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  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
 **/\r
 VOID\r
@@ -236,8 +316,11 @@ EfiResetSystem (
                              value needed for the new virtual address mapping being\r
                              applied.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @retval  EFI_SUCCESS            The pointer pointed to by Address was modified.\r
+  @retval  EFI_NOT_FOUND          The pointer pointed to by Address was not found to be part of\r
+                                  the current memory map. This is normally fatal.\r
+  @retval  EFI_INVALID_PARAMETER  Address is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  *Address is NULL and DebugDispositio\r
 \r
 **/\r
 EFI_STATUS\r
@@ -266,8 +349,7 @@ EfiConvertPointer (
                              value needed for the new virtual address mapping being\r
                              applied.\r
 \r
-  @retval  EFI_SUCCESS  Success to execute the function.\r
-  @retval  !EFI_SUCCESS Failed to execute the function.\r
+  @return  EFI_STATUS value from EfiConvertPointer().\r
 \r
 **/\r
 EFI_STATUS\r
@@ -311,6 +393,10 @@ EfiSetVirtualAddressMap (
 /**\r
   Convert the standard Lib double linked list to a virtual mapping.\r
 \r
+  This service uses EfiConvertPointer() to walk a double linked list and convert all the link\r
+  pointers to their virtual mappings. This function is only guaranteed to work during the\r
+  EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event and calling it at other times has undefined results.\r
+\r
   @param  DebugDisposition   Supplies type information for the pointer being converted.\r
   @param  ListHead           Head of linked list to convert.\r
 \r
@@ -350,11 +436,13 @@ 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. I Valid capsule was passed. If\r
-                                CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the\r
-                                capsule has been successfully processed by the firmware.\r
-  @retval EFI_INVALID_PARAMETER CapsuleSize is NULL or ResetTye is NULL.\r
+  @retval EFI_SUCCESS           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 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
+  @retval EFI_OUT_OF_RESOURCES  There were insufficient resources to process the capsule.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -391,10 +479,11 @@ 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           Valid answer 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
+  @retval EFI_OUT_OF_RESOURCES  There were insufficient resources to process the query request.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -408,6 +497,8 @@ EfiQueryCapsuleCapabilities (
 \r
 \r
 /**\r
+  Returns information about the EFI variables.\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
   space available for the EFI variables and the maximum size of each individual EFI variable,\r