3 Copyright (c) 2004 - 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.
23 #include "..\RuntimeLibInternal.h"
28 IN EFI_RESET_TYPE ResetType
,
29 IN EFI_STATUS ResetStatus
,
37 Resets the entire platform.
41 ResetType - The type of reset to perform.
42 ResetStatus - The status code for the reset.
43 DataSize - The size, in bytes, of ResetData.
44 ResetData - A data buffer that includes a Null-terminated Unicode string, optionally
45 followed by additional binary data.
53 EFI_GUID Guid
= EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID
;
70 // The following functions hide the mRT local global from the call to
71 // runtime service in the EFI system table.
77 OUT EFI_TIME_CAPABILITIES
*Capabilities
83 Returns the current time and date information, and the time-keeping
84 capabilities of the hardware platform.
88 Time - A pointer to storage to receive a snapshot of the current time.
89 Capabilities - An optional pointer to a buffer to receive the real time clock device's
98 SAL_RETURN_REGS ReturnReg
;
99 EFI_GUID Guid
= EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID
;
101 ReturnReg
= EfiCallEsalService (&Guid
, GetTime
, (UINT64
) Time
, (UINT64
) Capabilities
, 0, 0, 0, 0, 0);
102 return ReturnReg
.Status
;
114 Sets the current local time and date information.
118 Time - A pointer to the current time.
126 SAL_RETURN_REGS ReturnReg
;
127 EFI_GUID Guid
= EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID
;
129 ReturnReg
= EfiCallEsalService (&Guid
, SetTime
, (UINT64
) Time
, 0, 0, 0, 0, 0, 0);
130 return ReturnReg
.Status
;
136 OUT BOOLEAN
*Enabled
,
137 OUT BOOLEAN
*Pending
,
144 Returns the current wakeup alarm clock setting.
148 Enabled - Indicates if the alarm is currently enabled or disabled.
149 Pending - Indicates if the alarm signal is pending and requires acknowledgement.
150 Time - The current alarm setting.
158 SAL_RETURN_REGS ReturnReg
;
159 EFI_GUID Guid
= EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID
;
161 ReturnReg
= EfiCallEsalService (&Guid
, GetWakeupTime
, (UINT64
) Enabled
, (UINT64
) Pending
, (UINT64
) Time
, 0, 0, 0, 0);
162 return ReturnReg
.Status
;
175 Sets the system wakeup alarm clock time.
179 Enable - Enable or disable the wakeup alarm.
180 Time - If Enable is TRUE, the time to set the wakeup alarm for.
181 If Enable is FALSE, then this parameter is optional, and may be NULL.
189 SAL_RETURN_REGS ReturnReg
;
190 EFI_GUID Guid
= EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID
;
192 ReturnReg
= EfiCallEsalService (&Guid
, SetWakeupTime
, (UINT64
) Enable
, (UINT64
) Time
, 0, 0, 0, 0, 0);
193 return ReturnReg
.Status
;
199 IN CHAR16
*VariableName
,
200 IN EFI_GUID
* VendorGuid
,
201 OUT UINT32
*Attributes OPTIONAL
,
202 IN OUT UINTN
*DataSize
,
209 Returns the value of a variable.
213 VariableName - A Null-terminated Unicode string that is the name of the
215 VendorGuid - A unique identifier for the vendor.
216 Attributes - If not NULL, a pointer to the memory location to return the
217 attributes bitmask for the variable.
218 DataSize - On input, the size in bytes of the return Data buffer.
219 On output the size of data returned in Data.
220 Data - The buffer to return the contents of the variable.
228 SAL_RETURN_REGS ReturnReg
;
229 EFI_GUID Guid
= EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID
;
231 ReturnReg
= EfiCallEsalService (
234 (UINT64
) VariableName
,
242 return (EFI_STATUS
) ReturnReg
.Status
;
247 EfiGetNextVariableName (
248 IN OUT UINTN
*VariableNameSize
,
249 IN OUT CHAR16
*VariableName
,
250 IN OUT EFI_GUID
*VendorGuid
256 Enumerates the current variable names.
260 VariableNameSize - The size of the VariableName buffer.
261 VariableName - On input, supplies the last VariableName that was returned
262 by GetNextVariableName().
263 On output, returns the Nullterminated Unicode string of the
265 VendorGuid - On input, supplies the last VendorGuid that was returned by
266 GetNextVariableName().
267 On output, returns the VendorGuid of the current variable.
275 SAL_RETURN_REGS ReturnReg
;
276 EFI_GUID Guid
= EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID
;
278 ReturnReg
= EfiCallEsalService (
280 EsalGetNextVariableName
,
281 (UINT64
) VariableNameSize
,
282 (UINT64
) VariableName
,
289 return (EFI_STATUS
) ReturnReg
.Status
;
295 IN CHAR16
*VariableName
,
296 IN EFI_GUID
*VendorGuid
,
297 IN UINT32 Attributes
,
305 Sets the value of a variable.
309 VariableName - A Null-terminated Unicode string that is the name of the
311 VendorGuid - A unique identifier for the vendor.
312 Attributes - Attributes bitmask to set for the variable.
313 DataSize - The size in bytes of the Data buffer.
314 Data - The contents for the variable.
322 SAL_RETURN_REGS ReturnReg
;
323 EFI_GUID Guid
= EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID
;
325 ReturnReg
= EfiCallEsalService (
328 (UINT64
) VariableName
,
336 return (EFI_STATUS
) ReturnReg
.Status
;
341 EfiGetNextHighMonotonicCount (
342 OUT UINT32
*HighCount
348 Returns the next high 32 bits of the platform's monotonic counter.
352 HighCount - Pointer to returned value.
360 SAL_RETURN_REGS ReturnReg
;
361 EFI_GUID Guid
= EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID
;
363 ReturnReg
= EfiCallEsalService (&Guid
, GetNextHighMonotonicCount
, (UINT64
) HighCount
, 0, 0, 0, 0, 0, 0);
364 return (EFI_STATUS
) ReturnReg
.Status
;
370 IN UINTN DebugDisposition
,
371 IN OUT VOID
**Address
377 Determines the new virtual address that is to be used on subsequent memory accesses.
381 DebugDisposition - Supplies type information for the pointer being converted.
382 Address - A pointer to a pointer that is to be fixed to be the value needed
383 for the new virtual address mappings being applied.
391 return mRT
->ConvertPointer (DebugDisposition
, Address
);
397 IN UINTN DebugDisposition
,
398 IN OUT LIST_ENTRY
*ListHead
404 Conver the standard Lib double linked list to a virtual mapping.
408 DebugDisposition - Argument to EfiConvertPointer (EFI 1.0 API)
410 ListHead - Head of linked list to convert
419 LIST_ENTRY
*NextLink
;
422 // Convert all the ForwardLink & BackLink pointers in the list
426 NextLink
= Link
->ForwardLink
;
429 Link
->ForwardLink
== ListHead
? DebugDisposition
: 0,
430 (VOID
**) &Link
->ForwardLink
434 Link
->BackLink
== ListHead
? DebugDisposition
: 0,
435 (VOID
**) &Link
->BackLink
439 } while (Link
!= ListHead
);
445 Change the runtime addressing mode of EFI firmware from physical to virtual.
447 @param MemoryMapSize The size in bytes of VirtualMap.
448 @param DescriptorSize The size in bytes of an entry in the VirtualMap.
449 @param DescriptorVersion The version of the structure entries in VirtualMap.
450 @param VirtualMap An array of memory descriptors which contain new virtual
451 address mapping information for all runtime ranges. Type
452 EFI_MEMORY_DESCRIPTOR is defined in the
453 GetMemoryMap() function description.
455 @retval EFI_SUCCESS The virtual address map has been applied.
456 @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
457 virtual address mapped mode.
458 @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is
460 @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
461 map that requires a mapping.
462 @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
467 EfiSetVirtualAddressMap (
468 IN UINTN MemoryMapSize
,
469 IN UINTN DescriptorSize
,
470 IN UINT32 DescriptorVersion
,
471 IN CONST EFI_MEMORY_DESCRIPTOR
*VirtualMap
474 SAL_RETURN_REGS ReturnReg
;
475 EFI_GUID Guid
= EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID
;
477 ReturnReg
= EfiCallEsalService (
480 (UINT64
) MemoryMapSize
,
481 (UINT64
) DescriptorSize
,
482 (UINT64
) DescriptorVersion
,
489 return ReturnReg
.Status
;
496 IN UEFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
497 IN UINTN CapsuleCount
,
498 IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
501 return EFI_UNSUPPORTED
;
506 EfiQueryCapsuleCapabilities (
507 IN UEFI_CAPSULE_HEADER
**CapsuleHeaderArray
,
508 IN UINTN CapsuleCount
,
509 OUT UINT64
*MaximumCapsuleSize
,
510 OUT EFI_RESET_TYPE
*ResetType
513 return EFI_UNSUPPORTED
;
519 EfiQueryVariableInfo (
520 IN UINT32 Attributes
,
521 OUT UINT64
*MaximumVariableStorageSize
,
522 OUT UINT64
*RemainingVariableStorageSize
,
523 OUT UINT64
*MaximumVariableSize
526 return EFI_UNSUPPORTED
;