TianoCore EDK2 master
Loading...
Searching...
No Matches
PcRtcEntry.c File Reference
#include <Library/DxeServicesTableLib.h>
#include "PcRtc.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI PcRtcEfiGetTime (OUT EFI_TIME *Time, OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL)
 
EFI_STATUS EFIAPI PcRtcEfiSetTime (IN EFI_TIME *Time)
 
EFI_STATUS EFIAPI PcRtcEfiGetWakeupTime (OUT BOOLEAN *Enabled, OUT BOOLEAN *Pending, OUT EFI_TIME *Time)
 
EFI_STATUS EFIAPI PcRtcEfiSetWakeupTime (IN BOOLEAN Enabled, IN EFI_TIME *Time OPTIONAL)
 
STATIC VOID EFIAPI VirtualNotifyEvent (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI InitializePcRtc (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

PC_RTC_MODULE_GLOBALS mModuleGlobal
 
EFI_HANDLE mHandle = NULL
 
STATIC EFI_EVENT mVirtualAddrChangeEvent
 
UINTN mRtcIndexRegister
 
UINTN mRtcTargetRegister
 
UINT16 mRtcDefaultYear
 
UINT16 mMinimalValidYear
 
UINT16 mMaximalValidYear
 

Detailed Description

Provides Set/Get time operations.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2018 - 2020, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PcRtcEntry.c.

Function Documentation

◆ InitializePcRtc()

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

The user Entry Point for PcRTC module.

This is the entry point for PcRTC module. It installs the UEFI runtime service including GetTime(),SetTime(),GetWakeupTime(),and SetWakeupTime().

Parameters
ImageHandleThe firmware allocated handle for the EFI image.
SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
OthersSome error occurs when executing this entry point.

Definition at line 157 of file PcRtcEntry.c.

◆ PcRtcEfiGetTime()

EFI_STATUS EFIAPI PcRtcEfiGetTime ( OUT EFI_TIME Time,
OUT EFI_TIME_CAPABILITIES *Capabilities  OPTIONAL 
)

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 40 of file PcRtcEntry.c.

◆ PcRtcEfiGetWakeupTime()

EFI_STATUS EFIAPI PcRtcEfiGetWakeupTime ( 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_UNSUPPORTEDA wakeup timer is not supported on this platform.

Definition at line 84 of file PcRtcEntry.c.

◆ PcRtcEfiSetTime()

EFI_STATUS EFIAPI PcRtcEfiSetTime ( 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 60 of file PcRtcEntry.c.

◆ PcRtcEfiSetWakeupTime()

EFI_STATUS EFIAPI PcRtcEfiSetWakeupTime ( IN BOOLEAN  Enabled,
IN EFI_TIME *Time  OPTIONAL 
)

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. If Enable is FALSE, then this parameter is optional, and may be NULL.
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 109 of file PcRtcEntry.c.

◆ VirtualNotifyEvent()

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

Fixup internal data so that EFI can be called 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 128 of file PcRtcEntry.c.

Variable Documentation

◆ mHandle

EFI_HANDLE mHandle = NULL

Handle for the Capsule Update Policy Protocol

Definition at line 15 of file PcRtcEntry.c.

◆ mMaximalValidYear

UINT16 mMaximalValidYear

Definition at line 23 of file PcRtcEntry.c.

◆ mMinimalValidYear

UINT16 mMinimalValidYear

Definition at line 22 of file PcRtcEntry.c.

◆ mModuleGlobal

PC_RTC_MODULE_GLOBALS mModuleGlobal

Definition at line 13 of file PcRtcEntry.c.

◆ mRtcDefaultYear

UINT16 mRtcDefaultYear

Definition at line 21 of file PcRtcEntry.c.

◆ mRtcIndexRegister

UINTN mRtcIndexRegister

Definition at line 19 of file PcRtcEntry.c.

◆ mRtcTargetRegister

UINTN mRtcTargetRegister

Definition at line 20 of file PcRtcEntry.c.

◆ mVirtualAddrChangeEvent

STATIC EFI_EVENT mVirtualAddrChangeEvent

Definition at line 17 of file PcRtcEntry.c.