X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=PcAtChipsetPkg%2FPcatRealTimeClockRuntimeDxe%2FPcRtc.h;h=8aeb12c88ad1d92a337c940f9123c4c95811946a;hp=d38c8e1464a4e88c644f57a19e99b87347b24c95;hb=8794bf26c624cc0f569e0770381a0f6207602b9a;hpb=24115e44926b33c763f81026690f20efd913daf2 diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h index d38c8e1464..8aeb12c88a 100644 --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h @@ -1,7 +1,9 @@ /** @file Header file for real time clock driver. -Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2017, AMD Inc. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -19,6 +21,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include +#include + #include #include @@ -32,14 +36,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include - +#include typedef struct { EFI_LOCK RtcLock; INT16 SavedTimeZone; UINT8 Daylight; + UINT8 CenturyRtcAddress; } PC_RTC_MODULE_GLOBALS; +extern PC_RTC_MODULE_GLOBALS mModuleGlobal; + #define PCAT_RTC_ADDRESS_REGISTER 0x70 #define PCAT_RTC_DATA_REGISTER 0x71 @@ -60,7 +67,6 @@ typedef struct { #define RTC_ADDRESS_REGISTER_B 11 // R/W #define RTC_ADDRESS_REGISTER_C 12 // RO #define RTC_ADDRESS_REGISTER_D 13 // RO -#define RTC_ADDRESS_CENTURY 50 // R/W Range 19..20 Bit 8 is R/W // // Date and time initial values. // They are used if the RTC values are invalid during driver initialization @@ -70,14 +76,6 @@ typedef struct { #define RTC_INIT_HOUR 0 #define RTC_INIT_DAY 1 #define RTC_INIT_MONTH 1 -#define RTC_INIT_YEAR 2001 - -// -// Register initial values -// -#define RTC_INIT_REGISTER_A 0x26 -#define RTC_INIT_REGISTER_B 0x02 -#define RTC_INIT_REGISTER_D 0x0 #pragma pack(1) // @@ -286,14 +284,11 @@ RtcTimeFieldsValid ( @param Time On input, the time data read from UEFI to convert On output, the time converted to RTC format @param RegisterB Value of Register B of RTC, indicating data mode - @param Century It is set according to EFI_TIME Time. - **/ VOID ConvertEfiTimeToRtcTime ( IN OUT EFI_TIME *Time, - IN RTC_REGISTER_B RegisterB, - OUT UINT8 *Century + IN RTC_REGISTER_B RegisterB ); @@ -307,7 +302,6 @@ ConvertEfiTimeToRtcTime ( @param Time On input, the time data read from RTC to convert On output, the time converted to UEFI format - @param Century Value of century read from RTC. @param RegisterB Value of Register B of RTC, indicating data mode and hour format. @@ -318,7 +312,6 @@ ConvertEfiTimeToRtcTime ( EFI_STATUS ConvertRtcTimeToEfiTime ( IN OUT EFI_TIME *Time, - IN UINT8 Century, IN RTC_REGISTER_B RegisterB ); @@ -361,4 +354,30 @@ IsLeapYear ( IN EFI_TIME *Time ); +/** + Get the century RTC address from the ACPI FADT table. + + @return The century RTC address or 0 if not found. +**/ +UINT8 +GetCenturyRtcAddress ( + VOID + ); + +/** + 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. + + @param Event Event whose notification function is being invoked. + @param Context Pointer to the notification function's context. + +**/ +VOID +EFIAPI +PcRtcAcpiTableChangeCallback ( + IN EFI_EVENT Event, + IN VOID *Context + ); #endif