2 Library to abstract runtime services
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 Module Name: DxeRuntimeDriverLib.h
17 #ifndef __DXE_RUNTIME_DRIVER_LIB__
18 #define __DXE_RUNTIME_DRIVER_LIB__
21 extern const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent
[];
23 extern const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent
[];
26 Check to see if the execute context is in Runtime phase or not.
30 @retval TRUE The driver is in SMM.
31 @retval FALSE The driver is not in SMM.
41 Check to see if the SetVirtualAddressMsp() is invoked or not.
43 @retval TRUE SetVirtualAddressMsp() has been called.
44 @retval FALSE SetVirtualAddressMsp() has not been called.
54 Return current time and date information, and time-keeping
55 capabilities of hardware platform.
57 @param Time A pointer to storage to receive a snapshot of the current time.
58 @param Capabilities An optional pointer to a buffer to receive the real time clock device¡¯s
61 @retval EFI_SUCCESS Success to execute the function.
62 @retval !EFI_SUCCESS Failed to e3xecute the function.
69 OUT EFI_TIME_CAPABILITIES
*Capabilities
73 Set current time and date information.
75 @param Time A pointer to cache of time setting.
77 @retval EFI_SUCCESS Success to execute the function.
78 @retval !EFI_SUCCESS Failed to execute the function.
88 Return current wakeup alarm clock setting.
90 @param Enabled Indicate if the alarm clock is enabled or disabled.
91 @param Pending Indicate if the alarm signal is pending and requires acknowledgement.
92 @param Time Current alarm clock setting.
94 @retval EFI_SUCCESS Success to execute the function.
95 @retval !EFI_SUCCESS Failed to e3xecute the function.
101 OUT BOOLEAN
*Enabled
,
102 OUT BOOLEAN
*Pending
,
107 Set current wakeup alarm clock.
109 @param Enable Enable or disable current alarm clock..
110 @param Time Point to alarm clock setting.
112 @retval EFI_SUCCESS Success to execute the function.
113 @retval !EFI_SUCCESS Failed to e3xecute the function.
124 Return value of variable.
126 @param VariableName the name of the vendor's variable, it's a
127 Null-Terminated Unicode String
128 @param VendorGuid Unify identifier for vendor.
129 @param Attributes Point to memory location to return the attributes of variable. If the point
130 is NULL, the parameter would be ignored.
131 @param DataSize As input, point to the maxinum size of return Data-Buffer.
132 As output, point to the actual size of the returned Data-Buffer.
133 @param Data Point to return Data-Buffer.
135 @retval EFI_SUCCESS Success to execute the function.
136 @retval !EFI_SUCCESS Failed to e3xecute the function.
142 IN CHAR16
*VariableName
,
143 IN EFI_GUID
*VendorGuid
,
144 OUT UINT32
*Attributes
,
145 IN OUT UINTN
*DataSize
,
151 Enumerates variable's name.
153 @param VariableNameSize As input, point to maxinum size of variable name.
154 As output, point to actual size of varaible name.
155 @param VariableName As input, supplies the last VariableName that was returned by
156 GetNextVariableName().
157 As output, returns the name of variable. The name
158 string is Null-Terminated Unicode string.
159 @param VendorGuid As input, supplies the last VendorGuid that was returned by
160 GetNextVriableName().
161 As output, returns the VendorGuid of the current variable.
163 @retval EFI_SUCCESS Success to execute the function.
164 @retval !EFI_SUCCESS Failed to e3xecute the function.
169 EfiGetNextVariableName (
170 IN OUT UINTN
*VariableNameSize
,
171 IN OUT CHAR16
*VariableName
,
172 IN OUT EFI_GUID
*VendorGuid
176 Sets value of variable.
178 @param VariableName the name of the vendor's variable, it's a
179 Null-Terminated Unicode String
180 @param VendorGuid Unify identifier for vendor.
181 @param Attributes Point to memory location to return the attributes of variable. If the point
182 is NULL, the parameter would be ignored.
183 @param DataSize The size in bytes of Data-Buffer.
184 @param Data Point to the content of the variable.
186 @retval EFI_SUCCESS Success to execute the function.
187 @retval !EFI_SUCCESS Failed to e3xecute the function.
193 IN CHAR16
*VariableName
,
194 IN EFI_GUID
*VendorGuid
,
195 IN UINT32 Attributes
,
201 Returns the next high 32 bits of platform's monotonic counter.
203 @param HighCount Pointer to returned value.
205 @retval EFI_SUCCESS Success to execute the function.
206 @retval !EFI_SUCCESS Failed to e3xecute the function.
211 EfiGetNextHighMonotonicCount (
212 OUT UINT32
*HighCount
216 Resets the entire platform.
218 @param ResetType The type of reset to perform.
219 @param ResetStatus The status code for reset.
220 @param DataSize The size in bytes of reset data.
221 @param ResetData Pointer to data buffer that includes
222 Null-Terminated Unicode string.
224 @retval EFI_SUCCESS Success to execute the function.
225 @retval !EFI_SUCCESS Failed to e3xecute the function.
230 IN EFI_RESET_TYPE ResetType
,
231 IN EFI_STATUS ResetStatus
,
237 Determines the new virtual address that is to be used on subsequent memory accesses.
239 @param DebugDisposition Supplies type information for the pointer being converted.
240 @param Address The pointer to a pointer that is to be fixed to be the
241 value needed for the new virtual address mapping being
244 @retval EFI_SUCCESS Success to execute the function.
245 @retval !EFI_SUCCESS Failed to e3xecute the function.
251 IN UINTN DebugDisposition
,
257 Change the runtime addressing mode of EFI firmware from physical to virtual.
259 @param MemoryMapSize The size in bytes of VirtualMap.
260 @param DescriptorSize The size in bytes of an entry in the VirtualMap.
261 @param DescriptorVersion The version of the structure entries in VirtualMap.
262 @param VirtualMap An array of memory descriptors which contain new virtual
263 address mapping information for all runtime ranges. Type
264 EFI_MEMORY_DESCRIPTOR is defined in the
265 GetMemoryMap() function description.
267 @retval EFI_SUCCESS The virtual address map has been applied.
268 @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
269 virtual address mapped mode.
270 @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is
272 @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
273 map that requires a mapping.
274 @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
279 EfiSetVirtualAddressMap (
280 IN UINTN MemoryMapSize
,
281 IN UINTN DescriptorSize
,
282 IN UINT32 DescriptorVersion
,
283 IN CONST EFI_MEMORY_DESCRIPTOR
*VirtualMap
288 Conver the standard Lib double linked list to a virtual mapping.
290 @param DebugDisposition Supplies type information for the pointer being converted.
291 @param ListHead Head of linked list to convert.
293 @retval EFI_SUCCESS Success to execute the function.
294 @retval !EFI_SUCCESS Failed to e3xecute the function.
300 IN UINTN DebugDisposition
,
301 IN OUT LIST_ENTRY
*ListHead
308 IN UEFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
309 IN UINTN CapsuleCount
,
310 IN EFI_PHYSICAL_ADDRESS ScatterGatherList
316 EfiQueryCapsuleCapabilities (
317 IN UEFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
318 IN UINTN CapsuleCount
,
319 OUT UINT64
*MaximumCapsuleSize
,
320 OUT EFI_RESET_TYPE
*ResetType
325 EfiQueryVariableInfo (
326 IN UINT32 Attrubutes
,
327 OUT UINT64
*MaximumVariableStorageSize
,
328 OUT UINT64
*RemainingVariableStorageSize
,
329 OUT UINT64
*MaximumVariableSize