3 Copyright (c) 2006 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <RuntimeLibInternal.h>
21 IN EFI_RESET_TYPE ResetType
,
22 IN EFI_STATUS ResetStatus
,
30 Resets the entire platform.
34 ResetType - The type of reset to perform.
35 ResetStatus - The status code for the reset.
36 DataSize - The size, in bytes, of ResetData.
37 ResetData - A data buffer that includes a Null-terminated Unicode string, optionally
38 followed by additional binary data.
46 mRT
->ResetSystem (ResetType
, ResetStatus
, DataSize
, ResetData
);
50 // The following functions hide the mRT local global from the call to
51 // runtime service in the EFI system table.
57 OUT EFI_TIME_CAPABILITIES
*Capabilities
63 Returns the current time and date information, and the time-keeping
64 capabilities of the hardware platform.
68 Time - A pointer to storage to receive a snapshot of the current time.
69 Capabilities - An optional pointer to a buffer to receive the real time clock device's
78 return mRT
->GetTime (Time
, Capabilities
);
90 Sets the current local time and date information.
94 Time - A pointer to the current time.
102 return mRT
->SetTime (Time
);
108 OUT BOOLEAN
*Enabled
,
109 OUT BOOLEAN
*Pending
,
116 Returns the current wakeup alarm clock setting.
120 Enabled - Indicates if the alarm is currently enabled or disabled.
121 Pending - Indicates if the alarm signal is pending and requires acknowledgement.
122 Time - The current alarm setting.
130 return mRT
->GetWakeupTime (Enabled
, Pending
, Time
);
143 Sets the system wakeup alarm clock time.
147 Enable - Enable or disable the wakeup alarm.
148 Time - If Enable is TRUE, the time to set the wakeup alarm for.
149 If Enable is FALSE, then this parameter is optional, and may be NULL.
157 return mRT
->SetWakeupTime (Enable
, Time
);
166 IN CHAR16
*VariableName
,
167 IN EFI_GUID
* VendorGuid
,
168 OUT UINT32
*Attributes OPTIONAL
,
169 IN OUT UINTN
*DataSize
,
176 Returns the value of a variable.
180 VariableName - A Null-terminated Unicode string that is the name of the
182 VendorGuid - A unique identifier for the vendor.
183 Attributes - If not NULL, a pointer to the memory location to return the
184 attributes bitmask for the variable.
185 DataSize - On input, the size in bytes of the return Data buffer.
186 On output the size of data returned in Data.
187 Data - The buffer to return the contents of the variable.
195 return mRT
->GetVariable (VariableName
, VendorGuid
, Attributes
, DataSize
, Data
);
200 EfiGetNextVariableName (
201 IN OUT UINTN
*VariableNameSize
,
202 IN OUT CHAR16
*VariableName
,
203 IN OUT EFI_GUID
*VendorGuid
209 Enumerates the current variable names.
213 VariableNameSize - The size of the VariableName buffer.
214 VariableName - On input, supplies the last VariableName that was returned
215 by GetNextVariableName().
216 On output, returns the Nullterminated Unicode string of the
218 VendorGuid - On input, supplies the last VendorGuid that was returned by
219 GetNextVariableName().
220 On output, returns the VendorGuid of the current variable.
228 return mRT
->GetNextVariableName (VariableNameSize
, VariableName
, VendorGuid
);
234 IN CHAR16
*VariableName
,
235 IN EFI_GUID
*VendorGuid
,
236 IN UINT32 Attributes
,
244 Sets the value of a variable.
248 VariableName - A Null-terminated Unicode string that is the name of the
250 VendorGuid - A unique identifier for the vendor.
251 Attributes - Attributes bitmask to set for the variable.
252 DataSize - The size in bytes of the Data buffer.
253 Data - The contents for the variable.
261 return mRT
->SetVariable (VariableName
, VendorGuid
, Attributes
, DataSize
, Data
);
266 EfiGetNextHighMonotonicCount (
267 OUT UINT32
*HighCount
273 Returns the next high 32 bits of the platform's monotonic counter.
277 HighCount - Pointer to returned value.
285 return mRT
->GetNextHighMonotonicCount (HighCount
);
291 IN UINTN DebugDisposition
,
292 IN OUT VOID
**Address
298 Determines the new virtual address that is to be used on subsequent memory accesses.
302 DebugDisposition - Supplies type information for the pointer being converted.
303 Address - A pointer to a pointer that is to be fixed to be the value needed
304 for the new virtual address mappings being applied.
312 return mRT
->ConvertPointer (DebugDisposition
, Address
);
318 IN UINTN DebugDisposition
,
319 IN OUT LIST_ENTRY
*ListHead
325 Conver the standard Lib double linked list to a virtual mapping.
329 DebugDisposition - Argument to EfiConvertPointer (EFI 1.0 API)
331 ListHead - Head of linked list to convert
340 LIST_ENTRY
*NextLink
;
343 // Convert all the ForwardLink & BackLink pointers in the list
347 NextLink
= Link
->ForwardLink
;
350 Link
->ForwardLink
== ListHead
? DebugDisposition
: 0,
351 (VOID
**) &Link
->ForwardLink
355 Link
->BackLink
== ListHead
? DebugDisposition
: 0,
356 (VOID
**) &Link
->BackLink
360 } while (Link
!= ListHead
);
366 Change the runtime addressing mode of EFI firmware from physical to virtual.
368 @param MemoryMapSize The size in bytes of VirtualMap.
369 @param DescriptorSize The size in bytes of an entry in the VirtualMap.
370 @param DescriptorVersion The version of the structure entries in VirtualMap.
371 @param VirtualMap An array of memory descriptors which contain new virtual
372 address mapping information for all runtime ranges. Type
373 EFI_MEMORY_DESCRIPTOR is defined in the
374 GetMemoryMap() function description.
376 @retval EFI_SUCCESS The virtual address map has been applied.
377 @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
378 virtual address mapped mode.
379 @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is
381 @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
382 map that requires a mapping.
383 @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
388 EfiSetVirtualAddressMap (
389 IN UINTN MemoryMapSize
,
390 IN UINTN DescriptorSize
,
391 IN UINT32 DescriptorVersion
,
392 IN CONST EFI_MEMORY_DESCRIPTOR
*VirtualMap
395 return mRT
->SetVirtualAddressMap (
399 (EFI_MEMORY_DESCRIPTOR
*) VirtualMap
407 IN EFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
408 IN UINTN CapsuleCount
,
409 IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
412 return mRT
->UpdateCapsule (
421 EfiQueryCapsuleCapabilities (
422 IN EFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
423 IN UINTN CapsuleCount
,
424 OUT UINT64
*MaximumCapsuleSize
,
425 OUT EFI_RESET_TYPE
*ResetType
428 return mRT
->QueryCapsuleCapabilities (
439 EfiQueryVariableInfo (
440 IN UINT32 Attributes
,
441 OUT UINT64
*MaximumVariableStorageSize
,
442 OUT UINT64
*RemainingVariableStorageSize
,
443 OUT UINT64
*MaximumVariableSize
446 return mRT
->QueryVariableInfo (
448 MaximumVariableStorageSize
,
449 RemainingVariableStorageSize
,