TianoCore EDK2 master
RealTimeClock.c File Reference

Go to the source code of this file.

Data Structures

struct  NON_VOLATILE_TIME_SETTINGS
 

Functions

EFI_STATUS EFIAPI GetTime (OUT EFI_TIME *Time, OUT EFI_TIME_CAPABILITIES *Capabilities)
 
EFI_STATUS EFIAPI SetTime (IN EFI_TIME *Time)
 
EFI_STATUS EFIAPI GetWakeupTime (OUT BOOLEAN *Enabled, OUT BOOLEAN *Pending, OUT EFI_TIME *Time)
 
EFI_STATUS EFIAPI SetWakeupTime (IN BOOLEAN Enabled, OUT EFI_TIME *Time)
 
EFI_STATUS EFIAPI InitializeRealTimeClock (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

EFI_HANDLE mHandle = NULL
 
STATIC CONST CHAR16 mTimeSettingsVariableName [] = L"RtcTimeSettings"
 
STATIC NON_VOLATILE_TIME_SETTINGS mTimeSettings
 

Detailed Description

Implement EFI RealTimeClock runtime services via RTC Lib.

Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Copyright (c) 2017, Linaro, Ltd. All rights reserved.
Copyright (c) 2021, Ampere Computing LLC. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file RealTimeClock.c.

Function Documentation

◆ GetTime()

EFI_STATUS EFIAPI GetTime ( OUT EFI_TIME Time,
OUT EFI_TIME_CAPABILITIES Capabilities 
)

Returns the current time and date information, and the time-keeping capabilities of the hardware platform.

Parameters
TimeA pointer to storage to receive a snapshot of the current time.
CapabilitiesAn optional pointer to a buffer to receive the real time clock device's capabilities.
Return values
EFI_SUCCESSThe operation completed successfully.
EFI_INVALID_PARAMETERTime is NULL.
EFI_DEVICE_ERRORThe time could not be retrieved due to hardware error.

Definition at line 51 of file RealTimeClock.c.

◆ GetWakeupTime()

EFI_STATUS EFIAPI GetWakeupTime ( OUT BOOLEAN Enabled,
OUT BOOLEAN Pending,
OUT EFI_TIME Time 
)

Returns the current wakeup alarm clock setting.

Parameters
EnabledIndicates if the alarm is currently enabled or disabled.
PendingIndicates if the alarm signal is pending and requires acknowledgement.
TimeThe current alarm setting.
Return values
EFI_SUCCESSThe alarm settings were returned.
EFI_INVALID_PARAMETERAny parameter is NULL.
EFI_DEVICE_ERRORThe wakeup time could not be retrieved due to a hardware error.

Definition at line 139 of file RealTimeClock.c.

◆ InitializeRealTimeClock()

EFI_STATUS EFIAPI InitializeRealTimeClock ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

This is the declaration of an EFI image entry point. This can be the entry point to an application written to this specification, an EFI boot service driver, or an EFI runtime driver.

Parameters
ImageHandleHandle that identifies the loaded image.
SystemTableSystem Table for this image.
Return values
EFI_SUCCESSThe operation completed successfully.

Definition at line 194 of file RealTimeClock.c.

◆ SetTime()

EFI_STATUS EFIAPI SetTime ( IN EFI_TIME Time)

Sets the current local time and date information.

Parameters
TimeA pointer to the current time.
Return values
EFI_SUCCESSThe operation completed successfully.
EFI_INVALID_PARAMETERA time field is out of range.
EFI_DEVICE_ERRORThe time could not be set due due to hardware error.

Definition at line 82 of file RealTimeClock.c.

◆ SetWakeupTime()

EFI_STATUS EFIAPI SetWakeupTime ( IN BOOLEAN  Enabled,
OUT EFI_TIME Time 
)

Sets the system wakeup alarm clock time.

Parameters
EnabledEnable or disable the wakeup alarm.
TimeIf Enable is TRUE, the time to set the wakeup alarm for.
Return values
EFI_SUCCESSIf Enable is TRUE, then the wakeup alarm was enabled. If Enable is FALSE, then the wakeup alarm was disabled.
EFI_INVALID_PARAMETERA time field is out of range.
EFI_DEVICE_ERRORThe wakeup time could not be set due to a hardware error.
EFI_UNSUPPORTEDA wakeup timer is not supported on this platform.

Definition at line 174 of file RealTimeClock.c.

Variable Documentation

◆ mHandle

EFI_HANDLE mHandle = NULL

Definition at line 21 of file RealTimeClock.c.

◆ mTimeSettings

Definition at line 34 of file RealTimeClock.c.

◆ mTimeSettingsVariableName

STATIC CONST CHAR16 mTimeSettingsVariableName[] = L"RtcTimeSettings"

Definition at line 33 of file RealTimeClock.c.