TianoCore EDK2 master
Loading...
Searching...
No Matches
PL031RealTimeClockLib.c File Reference

Go to the source code of this file.

Functions

EFI_STATUS IdentifyPL031 (VOID)
 
EFI_STATUS InitializePL031 (VOID)
 
EFI_STATUS EFIAPI LibGetTime (OUT EFI_TIME *Time, OUT EFI_TIME_CAPABILITIES *Capabilities)
 
EFI_STATUS EFIAPI LibSetTime (IN EFI_TIME *Time)
 
EFI_STATUS EFIAPI LibGetWakeupTime (OUT BOOLEAN *Enabled, OUT BOOLEAN *Pending, OUT EFI_TIME *Time)
 
EFI_STATUS EFIAPI LibSetWakeupTime (IN BOOLEAN Enabled, OUT EFI_TIME *Time)
 
STATIC VOID EFIAPI VirtualNotifyEvent (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI LibRtcInitialize (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC BOOLEAN mPL031Initialized = FALSE
 
STATIC EFI_EVENT mRtcVirtualAddrChangeEvent
 
STATIC UINTN mPL031RtcBase
 

Detailed Description

Implement EFI RealTimeClock runtime services via RTC Lib.

Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.
Copyright (c) 2019, Linaro Ltd. All rights reserved.

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

Definition in file PL031RealTimeClockLib.c.

Function Documentation

◆ IdentifyPL031()

EFI_STATUS IdentifyPL031 ( VOID  )

Definition at line 37 of file PL031RealTimeClockLib.c.

◆ InitializePL031()

EFI_STATUS InitializePL031 ( VOID  )

Definition at line 70 of file PL031RealTimeClockLib.c.

◆ LibGetTime()

EFI_STATUS EFIAPI LibGetTime ( 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.
EFI_UNSUPPORTEDThis call is not supported by this platform at the time the call is made. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table.

Definition at line 121 of file PL031RealTimeClockLib.c.

◆ LibGetWakeupTime()

EFI_STATUS EFIAPI LibGetWakeupTime ( 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_PARAMETEREnabled is NULL.
EFI_INVALID_PARAMETERPending is NULL.
EFI_INVALID_PARAMETERTime is NULL.
EFI_DEVICE_ERRORThe wakeup time could not be retrieved due to a hardware error.
EFI_UNSUPPORTEDThis call is not supported by this platform at the time the call is made. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table.

Definition at line 243 of file PL031RealTimeClockLib.c.

◆ LibRtcInitialize()

EFI_STATUS EFIAPI LibRtcInitialize ( 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 319 of file PL031RealTimeClockLib.c.

◆ LibSetTime()

EFI_STATUS EFIAPI LibSetTime ( 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 to hardware error.
EFI_UNSUPPORTEDThis call is not supported by this platform at the time the call is made. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table.

Definition at line 184 of file PL031RealTimeClockLib.c.

◆ LibSetWakeupTime()

EFI_STATUS EFIAPI LibSetWakeupTime ( 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_PARAMETEREnabled is NULL.
EFI_INVALID_PARAMETERPending is NULL.
EFI_INVALID_PARAMETERTime is NULL.
EFI_DEVICE_ERRORThe wakeup time could not be set due to a hardware error.
EFI_UNSUPPORTEDThis call is not supported by this platform at the time the call is made. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table.

Definition at line 272 of file PL031RealTimeClockLib.c.

◆ VirtualNotifyEvent()

STATIC VOID EFIAPI VirtualNotifyEvent ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Fixup internal data so that EFI can be call in virtual mode. Call the passed in Child Notify event and convert any pointers in lib to virtual mode.

Parameters
[in]EventThe Event that is being processed
[in]ContextEvent Context

Definition at line 292 of file PL031RealTimeClockLib.c.

Variable Documentation

◆ mPL031Initialized

STATIC BOOLEAN mPL031Initialized = FALSE

Definition at line 32 of file PL031RealTimeClockLib.c.

◆ mPL031RtcBase

STATIC UINTN mPL031RtcBase

Definition at line 34 of file PL031RealTimeClockLib.c.

◆ mRtcVirtualAddrChangeEvent

STATIC EFI_EVENT mRtcVirtualAddrChangeEvent

Definition at line 33 of file PL031RealTimeClockLib.c.