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.
20 #include <RuntimeLibInternal.h>
25 IN EFI_RESET_TYPE ResetType
,
26 IN EFI_STATUS ResetStatus
,
34 Resets the entire platform.
38 ResetType - The type of reset to perform.
39 ResetStatus - The status code for the reset.
40 DataSize - The size, in bytes, of ResetData.
41 ResetData - A data buffer that includes a Null-terminated Unicode string, optionally
42 followed by additional binary data.
50 mRT
->ResetSystem (ResetType
, ResetStatus
, DataSize
, ResetData
);
54 // The following functions hide the mRT local global from the call to
55 // runtime service in the EFI system table.
61 OUT EFI_TIME_CAPABILITIES
*Capabilities
67 Returns the current time and date information, and the time-keeping
68 capabilities of the hardware platform.
72 Time - A pointer to storage to receive a snapshot of the current time.
73 Capabilities - An optional pointer to a buffer to receive the real time clock device's
82 return mRT
->GetTime (Time
, Capabilities
);
94 Sets the current local time and date information.
98 Time - A pointer to the current time.
106 return mRT
->SetTime (Time
);
112 OUT BOOLEAN
*Enabled
,
113 OUT BOOLEAN
*Pending
,
120 Returns the current wakeup alarm clock setting.
124 Enabled - Indicates if the alarm is currently enabled or disabled.
125 Pending - Indicates if the alarm signal is pending and requires acknowledgement.
126 Time - The current alarm setting.
134 return mRT
->GetWakeupTime (Enabled
, Pending
, Time
);
147 Sets the system wakeup alarm clock time.
151 Enable - Enable or disable the wakeup alarm.
152 Time - If Enable is TRUE, the time to set the wakeup alarm for.
153 If Enable is FALSE, then this parameter is optional, and may be NULL.
161 return mRT
->SetWakeupTime (Enable
, Time
);
170 IN CHAR16
*VariableName
,
171 IN EFI_GUID
* VendorGuid
,
172 OUT UINT32
*Attributes OPTIONAL
,
173 IN OUT UINTN
*DataSize
,
180 Returns the value of a variable.
184 VariableName - A Null-terminated Unicode string that is the name of the
186 VendorGuid - A unique identifier for the vendor.
187 Attributes - If not NULL, a pointer to the memory location to return the
188 attributes bitmask for the variable.
189 DataSize - On input, the size in bytes of the return Data buffer.
190 On output the size of data returned in Data.
191 Data - The buffer to return the contents of the variable.
199 return mRT
->GetVariable (VariableName
, VendorGuid
, Attributes
, DataSize
, Data
);
204 EfiGetNextVariableName (
205 IN OUT UINTN
*VariableNameSize
,
206 IN OUT CHAR16
*VariableName
,
207 IN OUT EFI_GUID
*VendorGuid
213 Enumerates the current variable names.
217 VariableNameSize - The size of the VariableName buffer.
218 VariableName - On input, supplies the last VariableName that was returned
219 by GetNextVariableName().
220 On output, returns the Nullterminated Unicode string of the
222 VendorGuid - On input, supplies the last VendorGuid that was returned by
223 GetNextVariableName().
224 On output, returns the VendorGuid of the current variable.
232 return mRT
->GetNextVariableName (VariableNameSize
, VariableName
, VendorGuid
);
238 IN CHAR16
*VariableName
,
239 IN EFI_GUID
*VendorGuid
,
240 IN UINT32 Attributes
,
248 Sets the value of a variable.
252 VariableName - A Null-terminated Unicode string that is the name of the
254 VendorGuid - A unique identifier for the vendor.
255 Attributes - Attributes bitmask to set for the variable.
256 DataSize - The size in bytes of the Data buffer.
257 Data - The contents for the variable.
265 return mRT
->SetVariable (VariableName
, VendorGuid
, Attributes
, DataSize
, Data
);
270 EfiGetNextHighMonotonicCount (
271 OUT UINT32
*HighCount
277 Returns the next high 32 bits of the platform's monotonic counter.
281 HighCount - Pointer to returned value.
289 return mRT
->GetNextHighMonotonicCount (HighCount
);
295 IN UINTN DebugDisposition
,
296 IN OUT VOID
**Address
302 Determines the new virtual address that is to be used on subsequent memory accesses.
306 DebugDisposition - Supplies type information for the pointer being converted.
307 Address - A pointer to a pointer that is to be fixed to be the value needed
308 for the new virtual address mappings being applied.
316 return mRT
->ConvertPointer (DebugDisposition
, Address
);
322 IN UINTN DebugDisposition
,
323 IN OUT LIST_ENTRY
*ListHead
329 Conver the standard Lib double linked list to a virtual mapping.
333 DebugDisposition - Argument to EfiConvertPointer (EFI 1.0 API)
335 ListHead - Head of linked list to convert
344 LIST_ENTRY
*NextLink
;
347 // Convert all the ForwardLink & BackLink pointers in the list
351 NextLink
= Link
->ForwardLink
;
354 Link
->ForwardLink
== ListHead
? DebugDisposition
: 0,
355 (VOID
**) &Link
->ForwardLink
359 Link
->BackLink
== ListHead
? DebugDisposition
: 0,
360 (VOID
**) &Link
->BackLink
364 } while (Link
!= ListHead
);
370 Change the runtime addressing mode of EFI firmware from physical to virtual.
372 @param MemoryMapSize The size in bytes of VirtualMap.
373 @param DescriptorSize The size in bytes of an entry in the VirtualMap.
374 @param DescriptorVersion The version of the structure entries in VirtualMap.
375 @param VirtualMap An array of memory descriptors which contain new virtual
376 address mapping information for all runtime ranges. Type
377 EFI_MEMORY_DESCRIPTOR is defined in the
378 GetMemoryMap() function description.
380 @retval EFI_SUCCESS The virtual address map has been applied.
381 @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
382 virtual address mapped mode.
383 @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is
385 @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
386 map that requires a mapping.
387 @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
392 EfiSetVirtualAddressMap (
393 IN UINTN MemoryMapSize
,
394 IN UINTN DescriptorSize
,
395 IN UINT32 DescriptorVersion
,
396 IN CONST EFI_MEMORY_DESCRIPTOR
*VirtualMap
399 return mRT
->SetVirtualAddressMap (
403 (EFI_MEMORY_DESCRIPTOR
*) VirtualMap
411 IN UEFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
412 IN UINTN CapsuleCount
,
413 IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
416 return mRT
->UpdateCapsule (
425 EfiQueryCapsuleCapabilities (
426 IN UEFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
427 IN UINTN CapsuleCount
,
428 OUT UINT64
*MaximumCapsuleSize
,
429 OUT EFI_RESET_TYPE
*ResetType
432 return mRT
->QueryCapsuleCapabilities (
443 EfiQueryVariableInfo (
444 IN UINT32 Attributes
,
445 OUT UINT64
*MaximumVariableStorageSize
,
446 OUT UINT64
*RemainingVariableStorageSize
,
447 OUT UINT64
*MaximumVariableSize
450 return mRT
->QueryVariableInfo (
452 MaximumVariableStorageSize
,
453 RemainingVariableStorageSize
,