3 Copyright (c) 2006, 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.
18 #include <RuntimeLibInternal.h>
23 IN EFI_RESET_TYPE ResetType
,
24 IN EFI_STATUS ResetStatus
,
32 Resets the entire platform.
36 ResetType - The type of reset to perform.
37 ResetStatus - The status code for the reset.
38 DataSize - The size, in bytes, of ResetData.
39 ResetData - A data buffer that includes a Null-terminated Unicode string, optionally
40 followed by additional binary data.
48 mRT
->ResetSystem (ResetType
, ResetStatus
, DataSize
, ResetData
);
52 // The following functions hide the mRT local global from the call to
53 // runtime service in the EFI system table.
59 OUT EFI_TIME_CAPABILITIES
*Capabilities
65 Returns the current time and date information, and the time-keeping
66 capabilities of the hardware platform.
70 Time - A pointer to storage to receive a snapshot of the current time.
71 Capabilities - An optional pointer to a buffer to receive the real time clock device¡¯s
80 return mRT
->GetTime (Time
, Capabilities
);
92 Sets the current local time and date information.
96 Time - A pointer to the current time.
104 return mRT
->SetTime (Time
);
110 OUT BOOLEAN
*Enabled
,
111 OUT BOOLEAN
*Pending
,
118 Returns the current wakeup alarm clock setting.
122 Enabled - Indicates if the alarm is currently enabled or disabled.
123 Pending - Indicates if the alarm signal is pending and requires acknowledgement.
124 Time - The current alarm setting.
132 return mRT
->GetWakeupTime (Enabled
, Pending
, Time
);
145 Sets the system wakeup alarm clock time.
149 Enable - Enable or disable the wakeup alarm.
150 Time - If Enable is TRUE, the time to set the wakeup alarm for.
151 If Enable is FALSE, then this parameter is optional, and may be NULL.
159 return mRT
->SetWakeupTime (Enable
, Time
);
168 IN CHAR16
*VariableName
,
169 IN EFI_GUID
* VendorGuid
,
170 OUT UINT32
*Attributes OPTIONAL
,
171 IN OUT UINTN
*DataSize
,
178 Returns the value of a variable.
182 VariableName - A Null-terminated Unicode string that is the name of the
184 VendorGuid - A unique identifier for the vendor.
185 Attributes - If not NULL, a pointer to the memory location to return the
186 attributes bitmask for the variable.
187 DataSize - On input, the size in bytes of the return Data buffer.
188 On output the size of data returned in Data.
189 Data - The buffer to return the contents of the variable.
197 return mRT
->GetVariable (VariableName
, VendorGuid
, Attributes
, DataSize
, Data
);
202 EfiGetNextVariableName (
203 IN OUT UINTN
*VariableNameSize
,
204 IN OUT CHAR16
*VariableName
,
205 IN OUT EFI_GUID
*VendorGuid
211 Enumerates the current variable names.
215 VariableNameSize - The size of the VariableName buffer.
216 VariableName - On input, supplies the last VariableName that was returned
217 by GetNextVariableName().
218 On output, returns the Nullterminated Unicode string of the
220 VendorGuid - On input, supplies the last VendorGuid that was returned by
221 GetNextVariableName().
222 On output, returns the VendorGuid of the current variable.
230 return mRT
->GetNextVariableName (VariableNameSize
, VariableName
, VendorGuid
);
236 IN CHAR16
*VariableName
,
237 IN EFI_GUID
*VendorGuid
,
238 IN UINT32 Attributes
,
246 Sets the value of a variable.
250 VariableName - A Null-terminated Unicode string that is the name of the
252 VendorGuid - A unique identifier for the vendor.
253 Attributes - Attributes bitmask to set for the variable.
254 DataSize - The size in bytes of the Data buffer.
255 Data - The contents for the variable.
263 return mRT
->SetVariable (VariableName
, VendorGuid
, Attributes
, DataSize
, Data
);
268 EfiGetNextHighMonotonicCount (
269 OUT UINT32
*HighCount
275 Returns the next high 32 bits of the platform¡¯s monotonic counter.
279 HighCount - Pointer to returned value.
287 return mRT
->GetNextHighMonotonicCount (HighCount
);
293 IN UINTN DebugDisposition
,
300 Determines the new virtual address that is to be used on subsequent memory accesses.
304 DebugDisposition - Supplies type information for the pointer being converted.
305 Address - A pointer to a pointer that is to be fixed to be the value needed
306 for the new virtual address mappings being applied.
314 return mRT
->ConvertPointer (DebugDisposition
, Address
);
320 IN UINTN DebugDisposition
,
321 IN OUT LIST_ENTRY
*ListHead
327 Conver the standard Lib double linked list to a virtual mapping.
331 DebugDisposition - Argument to EfiConvertPointer (EFI 1.0 API)
333 ListHead - Head of linked list to convert
342 LIST_ENTRY
*NextLink
;
345 // Convert all the ForwardLink & BackLink pointers in the list
349 NextLink
= Link
->ForwardLink
;
352 Link
->ForwardLink
== ListHead
? DebugDisposition
: 0,
353 (VOID
**) &Link
->ForwardLink
357 Link
->BackLink
== ListHead
? DebugDisposition
: 0,
358 (VOID
**) &Link
->BackLink
362 } while (Link
!= ListHead
);
368 Change the runtime addressing mode of EFI firmware from physical to virtual.
370 @param MemoryMapSize The size in bytes of VirtualMap.
371 @param DescriptorSize The size in bytes of an entry in the VirtualMap.
372 @param DescriptorVersion The version of the structure entries in VirtualMap.
373 @param VirtualMap An array of memory descriptors which contain new virtual
374 address mapping information for all runtime ranges. Type
375 EFI_MEMORY_DESCRIPTOR is defined in the
376 GetMemoryMap() function description.
378 @retval EFI_SUCCESS The virtual address map has been applied.
379 @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
380 virtual address mapped mode.
381 @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is
383 @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
384 map that requires a mapping.
385 @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
390 EfiSetVirtualAddressMap (
391 IN UINTN MemoryMapSize
,
392 IN UINTN DescriptorSize
,
393 IN UINT32 DescriptorVersion
,
394 IN CONST EFI_MEMORY_DESCRIPTOR
*VirtualMap
397 return mRT
->SetVirtualAddressMap (
401 (EFI_MEMORY_DESCRIPTOR
*) VirtualMap
409 IN UEFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
410 IN UINTN CapsuleCount
,
411 IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
414 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
415 return mRT
->UpdateCapsule (
421 return EFI_UNSUPPORTED
;
427 EfiQueryCapsuleCapabilities (
428 IN UEFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
429 IN UINTN CapsuleCount
,
430 OUT UINT64
*MaximumCapsuleSize
,
431 OUT EFI_RESET_TYPE
*ResetType
434 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
435 return mRT
->QueryCapsuleCapabilities (
442 return EFI_UNSUPPORTED
;
449 EfiQueryVariableInfo (
450 IN UINT32 Attributes
,
451 OUT UINT64
*MaximumVariableStorageSize
,
452 OUT UINT64
*RemainingVariableStorageSize
,
453 OUT UINT64
*MaximumVariableSize
456 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
457 return mRT
->QueryVariableInfo (
459 MaximumVariableStorageSize
,
460 RemainingVariableStorageSize
,
464 return EFI_UNSUPPORTED
;