TianoCore EDK2 master
|
#include <Uefi.h>
#include <Guid/Acpi.h>
#include <Protocol/RealTimeClock.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/IoLib.h>
#include <Library/TimerLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/PcdLib.h>
#include <Library/ReportStatusCodeLib.h>
Go to the source code of this file.
Data Structures | |
struct | PC_RTC_MODULE_GLOBALS |
struct | RTC_REGISTER_A_BITS |
union | RTC_REGISTER_A |
struct | RTC_REGISTER_B_BITS |
union | RTC_REGISTER_B |
struct | RTC_REGISTER_C_BITS |
union | RTC_REGISTER_C |
struct | RTC_REGISTER_D_BITS |
union | RTC_REGISTER_D |
Macros | |
#define | RTC_ADDRESS_SECONDS 0 |
#define | RTC_ADDRESS_SECONDS_ALARM 1 |
#define | RTC_ADDRESS_MINUTES 2 |
#define | RTC_ADDRESS_MINUTES_ALARM 3 |
#define | RTC_ADDRESS_HOURS 4 |
#define | RTC_ADDRESS_HOURS_ALARM 5 |
#define | RTC_ADDRESS_DAY_OF_THE_WEEK 6 |
#define | RTC_ADDRESS_DAY_OF_THE_MONTH 7 |
#define | RTC_ADDRESS_MONTH 8 |
#define | RTC_ADDRESS_YEAR 9 |
#define | RTC_ADDRESS_REGISTER_A 10 |
#define | RTC_ADDRESS_REGISTER_B 11 |
#define | RTC_ADDRESS_REGISTER_C 12 |
#define | RTC_ADDRESS_REGISTER_D 13 |
#define | RTC_INIT_SECOND 0 |
#define | RTC_INIT_MINUTE 0 |
#define | RTC_INIT_HOUR 0 |
#define | RTC_INIT_DAY 1 |
#define | RTC_INIT_MONTH 1 |
#define | RTC_DIV_RESET 0x70 |
Variables | |
PC_RTC_MODULE_GLOBALS | mModuleGlobal |
Header file for real time clock driver.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PcRtc.h.
VOID ConvertEfiTimeToRtcTime | ( | IN OUT EFI_TIME * | Time, |
IN RTC_REGISTER_B | RegisterB | ||
) |
Converts time from EFI_TIME format defined by UEFI spec to RTC format.
This function converts time from EFI_TIME format defined by UEFI spec to RTC format. If data mode of RTC is BCD, then converts EFI_TIME to it. If RTC is in 12-hour format, then converts EFI_TIME to it.
Time | On input, the time data read from UEFI to convert On output, the time converted to RTC format |
RegisterB | Value of Register B of RTC, indicating data mode |
EFI_STATUS ConvertRtcTimeToEfiTime | ( | IN OUT EFI_TIME * | Time, |
IN RTC_REGISTER_B | RegisterB | ||
) |
Converts time read from RTC to EFI_TIME format defined by UEFI spec.
This function converts raw time data read from RTC to the EFI_TIME format defined by UEFI spec. If data mode of RTC is BCD, then converts it to decimal, If RTC is in 12-hour format, then converts it to 24-hour format.
Time | On input, the time data read from RTC to convert On output, the time converted to UEFI format |
RegisterB | Value of Register B of RTC, indicating data mode and hour format. |
EFI_INVALID_PARAMETER | Parameters passed in are invalid. |
EFI_SUCCESS | Convert RTC time to EFI time successfully. |
See if field Day of an EFI_TIME is correct.
Time | Its Day field is to be checked. |
TRUE | Day field of Time is correct. |
FALSE | Day field of Time is NOT correct. |
Definition at line 271 of file RealTimeClock.c.
UINT8 GetCenturyRtcAddress | ( | VOID | ) |
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().
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
Others | Some error occurs when executing this entry point. |
Definition at line 157 of file PcRtcEntry.c.
Check if it is a leapyear.
Time | The time to be checked. |
TRUE | It is a leapyear. |
FALSE | It is NOT a leapyear. |
Check if it is a leap year.
Time | The UEFI time to be checked. |
TRUE | It is a leap year. |
FALSE | It is NOT a leap year. |
Check if it is a leap year.
Time | The time to be checked. |
TRUE | It is a leap year. |
FALSE | It is NOT a leap year. |
Definition at line 166 of file TimeBaseLib.c.
Notification function of ACPI Table change.
This is a notification function registered on ACPI Table change event. It saves the Century address stored in ACPI FADT table.
Event | Event whose notification function is being invoked. |
Context | Pointer to the notification function's context. |
EFI_STATUS PcRtcGetTime | ( | OUT EFI_TIME * | Time, |
OUT EFI_TIME_CAPABILITIES *Capabilities | OPTIONAL, | ||
IN PC_RTC_MODULE_GLOBALS * | Global | ||
) |
Returns the current time and date information, and the time-keeping capabilities of the hardware platform.
Time | A pointer to storage to receive a snapshot of the current time. |
Capabilities | An optional pointer to a buffer to receive the real time clock device's capabilities. |
Global | For global use inside this module. |
EFI_SUCCESS | The operation completed successfully. |
EFI_INVALID_PARAMETER | Time is NULL. |
EFI_DEVICE_ERROR | The time could not be retrieved due to hardware error. |
EFI_STATUS PcRtcGetWakeupTime | ( | OUT BOOLEAN * | Enabled, |
OUT BOOLEAN * | Pending, | ||
OUT EFI_TIME * | Time, | ||
IN PC_RTC_MODULE_GLOBALS * | Global | ||
) |
Returns the current wakeup alarm clock setting.
Enabled | Indicates if the alarm is currently enabled or disabled. |
Pending | Indicates if the alarm signal is pending and requires acknowledgement. |
Time | The current alarm setting. |
Global | For global use inside this module. |
EFI_SUCCESS | The alarm settings were returned. |
EFI_INVALID_PARAMETER | Enabled is NULL. |
EFI_INVALID_PARAMETER | Pending is NULL. |
EFI_INVALID_PARAMETER | Time is NULL. |
EFI_DEVICE_ERROR | The wakeup time could not be retrieved due to a hardware error. |
EFI_UNSUPPORTED | A wakeup timer is not supported on this platform. |
Returns the current wakeup alarm clock setting.
Enabled | Indicates if the alarm is currently enabled or disabled. |
Pending | Indicates if the alarm signal is pending and requires acknowledgment. |
Time | The current alarm setting. |
Global | For global use inside this module. |
EFI_SUCCESS | The alarm settings were returned. |
EFI_INVALID_PARAMETER | Enabled is NULL. |
EFI_INVALID_PARAMETER | Pending is NULL. |
EFI_INVALID_PARAMETER | Time is NULL. |
EFI_DEVICE_ERROR | The wakeup time could not be retrieved due to a hardware error. |
EFI_UNSUPPORTED | A wakeup timer is not supported on this platform. |
EFI_STATUS PcRtcInit | ( | IN PC_RTC_MODULE_GLOBALS * | Global | ) |
EFI_STATUS PcRtcSetTime | ( | IN EFI_TIME * | Time, |
IN PC_RTC_MODULE_GLOBALS * | Global | ||
) |
Sets the current local time and date information.
Time | A pointer to the current time. |
Global | For global use inside this module. |
EFI_SUCCESS | The operation completed successfully. |
EFI_INVALID_PARAMETER | A time field is out of range. |
EFI_DEVICE_ERROR | The time could not be set due due to hardware error. |
EFI_STATUS PcRtcSetWakeupTime | ( | IN BOOLEAN | Enable, |
IN EFI_TIME *Time | OPTIONAL, | ||
IN PC_RTC_MODULE_GLOBALS * | Global | ||
) |
Sets the system wakeup alarm clock time.
Enabled | Enable or disable the wakeup alarm. |
Time | If Enable is TRUE, the time to set the wakeup alarm for. If Enable is FALSE, then this parameter is optional, and may be NULL. |
Global | For global use inside this module. |
EFI_SUCCESS | If Enable is TRUE, then the wakeup alarm was enabled. If Enable is FALSE, then the wakeup alarm was disabled. |
EFI_INVALID_PARAMETER | A time field is out of range. |
EFI_DEVICE_ERROR | The wakeup time could not be set due to a hardware error. |
EFI_UNSUPPORTED | A wakeup timer is not supported on this platform. |
EFI_STATUS RtcTimeFieldsValid | ( | IN EFI_TIME * | Time | ) |
See if all fields of a variable of EFI_TIME type is correct.
Time | The time to be checked. |
EFI_INVALID_PARAMETER | Some fields of Time are not correct. |
EFI_SUCCESS | Time is a valid EFI_TIME variable. |
Definition at line 238 of file RealTimeClock.c.
EFI_STATUS RtcWaitToUpdate | ( | UINTN | Timeout | ) |
|
extern |
Definition at line 13 of file PcRtcEntry.c.