+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
-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
- \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
- \r
-\r
-Module Name:\r
-\r
- EdkIIGlueDxeRuntimeDriverLib.h\r
- \r
-Abstract: \r
-\r
- Library that abstracts runtime services\r
-\r
---*/\r
-\r
-#ifndef __EDKII_GLUE_DXE_RUNTIME_DRIVER_LIB_H__\r
-#define __EDKII_GLUE_DXE_RUNTIME_DRIVER_LIB_H__\r
-\r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-\r
-typedef struct {\r
- EFI_GUID CapsuleGuid;\r
- UINT32 HeaderSize;\r
- UINT32 Flags;\r
- UINT32 CapsuleImageSize;\r
-} UEFI_CAPSULE_HEADER;\r
-\r
-#else\r
-\r
-typedef EFI_CAPSULE_HEADER UEFI_CAPSULE_HEADER;\r
-\r
-#endif\r
-\r
-extern const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[];\r
-\r
-extern const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[];\r
-\r
-/**\r
- Check to see if the execute context is in Runtime phase or not.\r
-\r
- @param None.\r
-\r
- @retval TRUE The driver is in SMM.\r
- @retval FALSE The driver is not in SMM.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-EfiAtRuntime (\r
- VOID \r
- );\r
-\r
-/**\r
- Check to see if the SetVirtualAddressMsp() is invoked or not.\r
-\r
- @retval TRUE SetVirtualAddressMsp() has been called.\r
- @retval FALSE SetVirtualAddressMsp() has not been called.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-EfiGoneVirtual (\r
- VOID \r
- );\r
-\r
-/**\r
- Return current time and date information, and time-keeping \r
- capabilities of hardware platform.\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
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiGetTime (\r
- OUT EFI_TIME *Time,\r
- OUT EFI_TIME_CAPABILITIES *Capabilities\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
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiSetTime (\r
- IN EFI_TIME *Time\r
- );\r
-\r
-/**\r
- Return 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
- \r
- @retval EFI_SUCCESS Success to execute the function.\r
- @retval !EFI_SUCCESS Failed to e3xecute the function.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiGetWakeupTime (\r
- OUT BOOLEAN *Enabled,\r
- OUT BOOLEAN *Pending,\r
- OUT EFI_TIME *Time\r
- );\r
-\r
-/**\r
- Set current wakeup alarm clock.\r
-\r
- @param Enable Enable or disable current alarm clock..\r
- @param Time Point to alarm clock setting.\r
- \r
- @retval EFI_SUCCESS Success to execute the function.\r
- @retval !EFI_SUCCESS Failed to e3xecute the function.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiSetWakeupTime (\r
- IN BOOLEAN Enable,\r
- IN EFI_TIME *Time\r
- );\r
-\r
-/**\r
- Return value of variable.\r
-\r
- @param VariableName the name of the vendor's variable, it's 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
- is NULL, the parameter would be ignored.\r
- @param DataSize As input, point to the maxinum 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
- @retval EFI_SUCCESS Success to execute the function.\r
- @retval !EFI_SUCCESS Failed to e3xecute the function.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiGetVariable (\r
- IN CHAR16 *VariableName,\r
- IN EFI_GUID *VendorGuid,\r
- OUT UINT32 *Attributes,\r
- IN OUT UINTN *DataSize,\r
- OUT VOID *Data\r
- );\r
-\r
-/**\r
- Enumerates variable's name.\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 VariableName As input, supplies the last VariableName that was returned by \r
- GetNextVariableName().\r
- As output, returns the name of variable. The name \r
- string is Null-Terminated Unicode string.\r
- @param VendorGuid As input, supplies the last VendorGuid that was returned by \r
- 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
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiGetNextVariableName (\r
- IN OUT UINTN *VariableNameSize,\r
- IN OUT CHAR16 *VariableName,\r
- IN OUT EFI_GUID *VendorGuid\r
- );\r
-\r
-/**\r
- Sets value of variable.\r
-\r
- @param VariableName the name of the vendor's variable, it's 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
- is NULL, the parameter would be ignored.\r
- @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
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiSetVariable (\r
- IN CHAR16 *VariableName,\r
- IN EFI_GUID *VendorGuid,\r
- IN UINT32 Attributes,\r
- IN UINTN DataSize,\r
- IN VOID *Data\r
- );\r
-\r
-/**\r
- Returns the next high 32 bits of platform's monotonic counter.\r
-\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
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiGetNextHighMonotonicCount (\r
- OUT UINT32 *HighCount\r
- );\r
-\r
-/**\r
- 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
-\r
- @retval EFI_SUCCESS Success to execute the function.\r
- @retval !EFI_SUCCESS Failed to e3xecute the function.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EfiResetSystem (\r
- IN EFI_RESET_TYPE ResetType,\r
- IN EFI_STATUS ResetStatus,\r
- IN UINTN DataSize,\r
- IN CHAR16 *ResetData\r
- );\r
-\r
-/**\r
- Determines the new virtual address that is to be used on subsequent memory accesses.\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
- 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 e3xecute the function.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiConvertPointer (\r
- IN UINTN DebugDisposition,\r
- IN OUT VOID **Address\r
- );\r
-\r
-\r
-/**\r
- Change the runtime addressing mode of EFI firmware from physical to virtual.\r
-\r
- @param MemoryMapSize The size in bytes of VirtualMap.\r
- @param DescriptorSize The size in bytes of an entry in the VirtualMap.\r
- @param DescriptorVersion The version of the structure entries in VirtualMap.\r
- @param VirtualMap An array of memory descriptors which contain new virtual\r
- address mapping information for all runtime ranges. Type\r
- EFI_MEMORY_DESCRIPTOR is defined in the\r
- GetMemoryMap() function description.\r
-\r
- @retval EFI_SUCCESS The virtual address map has been applied.\r
- @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in\r
- virtual address mapped mode.\r
- @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is\r
- invalid.\r
- @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory\r
- map that requires a mapping.\r
- @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found\r
- in the memory map.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiSetVirtualAddressMap (\r
- IN UINTN MemoryMapSize,\r
- IN UINTN DescriptorSize,\r
- IN UINT32 DescriptorVersion,\r
- IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap\r
- );\r
-\r
-\r
-/**\r
- Conver the standard Lib double linked list to a virtual mapping.\r
-\r
- @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
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiConvertList (\r
- IN UINTN DebugDisposition,\r
- IN OUT LIST_ENTRY *ListHead\r
- );\r
-\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
- \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
- stored in contiguous virtual memory. The capsules in the\r
- CapsuleHeaderArray must be the same capsules as the\r
- ScatterGatherList. The CapsuleHeaderArray must\r
- have the capsules in the same order as the ScatterGatherList.\r
- @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r
- CaspuleHeaderArray.\r
- @param ScatterGatherList Physical pointer to a set of\r
- EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the\r
- location in physical memory of a set of capsules. See Related\r
- Definitions for an explanation of how more than one capsule is\r
- passed via this interface. The capsules in the\r
- ScatterGatherList must be in the same order as the\r
- 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_DEVICE_ERROR The capsule update was started, but failed due to a device error.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiUpdateCapsule (\r
- IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,\r
- IN UINTN CapsuleCount,\r
- IN EFI_PHYSICAL_ADDRESS ScatterGatherList\r
- );\r
-\r
-\r
-/**\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
- If the caller needs to query for generic capsule capability a fake EFI_CAPSULE_HEADER can be\r
- constructed where CapsuleImageSize is equal to HeaderSize that is equal to sizeof\r
- (EFI_CAPSULE_HEADER). To determine reset requirements,\r
- CAPSULE_FLAGS_PERSIST_ACROSS_RESET should be set in the Flags field of the\r
- EFI_CAPSULE_HEADER.\r
- The firmware must support any capsule that has the\r
- CAPSULE_FLAGS_PERSIST_ACROSS_RESET flag set in EFI_CAPSULE_HEADER. The\r
- firmware sets the policy for what capsules are supported that do not have the\r
- CAPSULE_FLAGS_PERSIST_ACROSS_RESET flag set.\r
- \r
- @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules\r
- being passed into update capsule. The capsules are assumed to\r
- stored in contiguous virtual memory.\r
- @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in\r
- CaspuleHeaderArray.\r
- @param MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can\r
- support as an argument to UpdateCapsule() via\r
- CapsuleHeaderArray and ScatterGatherList.\r
- 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_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
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiQueryCapsuleCapabilities (\r
- IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,\r
- IN UINTN CapsuleCount,\r
- OUT UINT64 *MaximumCapsuleSize,\r
- OUT EFI_RESET_TYPE *ResetType\r
- );\r
-\r
-\r
-/**\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
- associated with the attributes specified.\r
- The returned MaximumVariableStorageSize, RemainingVariableStorageSize,\r
- MaximumVariableSize information may change immediately after the call based on other\r
- runtime activities including asynchronous error events. Also, these values associated with different\r
- attributes are not additive in nature.\r
- \r
- @param Attributes Attributes bitmask to specify the type of variables on\r
- which to return information. Refer to the\r
- GetVariable() function description.\r
- @param MaximumVariableStorageSize \r
- On output the maximum size of the storage space\r
- available for the EFI variables associated with the\r
- attributes specified.\r
- @param RemainingVariableStorageSize \r
- Returns the remaining size of the storage space\r
- available for the EFI variables associated with the\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_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
-EFI_STATUS\r
-EFIAPI\r
-EfiQueryVariableInfo (\r
- IN UINT32 Attrubutes,\r
- OUT UINT64 *MaximumVariableStorageSize,\r
- OUT UINT64 *RemainingVariableStorageSize,\r
- OUT UINT64 *MaximumVariableSize\r
- );\r
-\r
-#endif\r
-\r