From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.2233.1589360578013558838 for ; Wed, 13 May 2020 02:02:58 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: ray.ni@intel.com) IronPort-SDR: XQ1I22tKEeDFnjLtE/bsSNahCUiQjZoRFW2/34jmMjdmpgyxLX76b0vTjEAzac1Z6CSsQAe+AE 4yjpmE9NSz2Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2020 02:02:57 -0700 IronPort-SDR: zIV04b717+eoOo/dffOVgzzmqLSNZZMcjwbUiSB/cZR8MivH8hYd2zIogyUQzkWrFh48w5PenM GIjaJ+Zwp7xg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,387,1583222400"; d="scan'208";a="262415877" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 13 May 2020 02:02:56 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 13 May 2020 02:02:56 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 13 May 2020 02:02:55 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.210]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.248]) with mapi id 14.03.0439.000; Wed, 13 May 2020 17:02:51 +0800 From: "Ni, Ray" To: "Yau, KaiX" , "devel@edk2.groups.io" , "kaiyau@gmail.com" CC: "Jiang, Guomin" , "Gao, Liming" , "Archield, Ralphal" , "Zhao, Lijian" Subject: Re: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR displayed in SETUP Thread-Topic: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR displayed in SETUP Thread-Index: AQHWAMIW/k98ZzzV00mjseooVZSurqiMedbQ//+tKwCAF9ZJMP//fbgAgADC61D//31RAAA99D9Q//986gD//2jOkIAAuyuA//9F0lA= Date: Wed, 13 May 2020 09:02:51 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C53B2D9@SHSMSX104.ccr.corp.intel.com> References: <50102ef8b38c0e5287ab4d1cb8fc636213f67299.1584672719.git.kaix.yau@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C51152B@SHSMSX104.ccr.corp.intel.com> <3f6385f623054e24b44a375765246d2f@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53809A@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53887A@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53A7C4@SHSMSX104.ccr.corp.intel.com> <213de571cb0b4471852cb3b8c616a8da@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53A9CE@SHSMSX104.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable If the PCD value is 2020/2119, setting year out of this range [2020 - 2119]= is not supported. It's clearly stated in the PCD definition in PcAtChipsetPkg.dec. The PCD value in PcAtChipsetPkg.dec assumes this driver and RTC HW are not= needed in year 2098 and after. ## This PCD specifies the minimal valid year in RTC. # @Prompt Minimal valid year in RTC. gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear|1998|UINT16|0x0000000D ## This PCD specifies the maximal valid year in RTC. # @Prompt Maximal valid year in RTC. # @Expression 0x80000001 | gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValid= Year < gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear + 100 gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear|2097|UINT16|0x0000000E > -----Original Message----- > From: Yau, KaiX > Sent: Wednesday, May 13, 2020 1:45 PM > To: Ni, Ray ; devel@edk2.groups.io; kaiyau@gmail.com > Cc: Jiang, Guomin ; Gao, Liming ; Archield, Ralphal > ; Zhao, Lijian > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR disp= layed in SETUP >=20 > HI Ray, >=20 > If you have PCD 2020 and 2119 > And the user set 2125 (out of BIOS). >=20 > Time->Year =3D CheckAndConvertBcd8ToDecimal8 ((UINT8) Time->Year); = <-- Time->Year =3D 25 > Century =3D (UINT8) (PcdGet16 (PcdMinimalValidYear) / 100); = <-- Century =3D 20 > if (Time->Year < PcdGet16 (PcdMinimalValidYear) % 100) { = <-- (25 < 19) =3D FALSE > Century++; = <-- since it is FALSE, we will not= get to here > } > Time->Year =3D (UINT16) (Century * 100 + Time->Year); = <-- Time->Year =3D 2025 (20 x 100 + 25). > 2025 is within the RANGE, so it is considered as "VALID" data in BIOS; > however it is wrong because this logic change 2125 to 2025. >=20 > If we fixed the PCD values at 2000 and 2099, the current logic is workin= g. That was the original design. > BTW, you can look at gitk. Someone changed them to 1998 and 2097 on pur= pose after this code are written. > The guy who changed the PCD values does not know the code has problem. >=20 > Regards > Kai Yau >=20 >=20 >=20 >=20 > -----Original Message----- > From: Ni, Ray > Sent: Wednesday, May 13, 2020 12:46 AM > To: Yau, KaiX ; devel@edk2.groups.io; kaiyau@gmail.c= om > Cc: Jiang, Guomin ; Gao, Liming ; Archield, Ralphal > ; Zhao, Lijian > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR disp= layed in SETUP >=20 > Kai, > In your case, the two PCD value should be set to 2020/2119. > With the new PCD value the issue you see will disappear. > I won't approve code changes unless you convince me there is a logic err= or in code. >=20 > + Lijian >=20 > Thanks, > Ray >=20 > > -----Original Message----- > > From: Yau, KaiX > > Sent: Wednesday, May 13, 2020 11:37 AM > > To: Ni, Ray ; devel@edk2.groups.io; kaiyau@gmail.com > > Cc: Jiang, Guomin ; Gao, Liming > > ; Archield, Ralphal > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR > > displayed in SETUP > > > > Hi, > > > > Lijian Zhou is also able to reproduce the error. You can ask him for m= ore details if you guys are in the same building. > > > > > > Current Default PcdMinimalValidYear =3D 1998 Current Default > > PcdMaximalValidYear =3D 2097 > > > > If we can set the YEAR to 2099, we will end up getting 1999 instead. = The reason why user have not found this problem > > because Windows does not allow user to set the YEAR to 2099. If we > > make the PcdMinimalValidYear & PcdMaximalValidYear smaller for testin= g (such as 1948 and 2047), you can reproduce > this issue easily. > > > > Time->Year =3D CheckAndConvertBcd8ToDecimal8 ((UINT8) Time->Year);= <-- Time->Year =3D 99 > > Century =3D (UINT8) (PcdGet16 (PcdMinimalValidYear) / 100); = <-- Century =3D 19 > > if (Time->Year < PcdGet16 (PcdMinimalValidYear) % 100) { = <-- (99 < 97) =3D FALSE > > Century++; > > } > > Time->Year =3D (UINT16) (Century * 100 + Time->Year); = <-- Time->Year =3D 1999 (19 x 100 + 99). Also 1999 is > > within the RANGE, so it is considered as "VALID" data; however it is w= rong. > > > > > > Regards > > Kai > > > > > > -----Original Message----- > > From: Ni, Ray > > Sent: Tuesday, May 12, 2020 11:27 PM > > To: Yau, KaiX ; devel@edk2.groups.io; > > kaiyau@gmail.com > > Cc: Jiang, Guomin ; Gao, Liming > > ; Archield, Ralphal > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR > > displayed in SETUP > > > > Kai, > > Can you please explain what logic error in code is wrong? > > > > Thanks, > > Ray > > > > > -----Original Message----- > > > From: Yau, KaiX > > > Sent: Tuesday, May 12, 2020 1:52 PM > > > To: Ni, Ray ; devel@edk2.groups.io; > > > kaiyau@gmail.com > > > Cc: Jiang, Guomin ; Gao, Liming > > > ; Archield, Ralphal > > > > > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR > > > displayed in SETUP > > > > > > Hi Ray, > > > > > > We cannot use 2020 and 2119 if we don't fix the current logic. > > > > > > If they keep that code, The PCD values have to be "2000 and 2099" > > > (or > > > 1900 and 1999) > > > > > > Any specific reasons why you don't fix the logic? I will need to upd= ate the HSD with your reason. > > > If we fixed it, we don't need to worry about the PCD values anymore. > > > > > > Regards > > > Kai Yau > > > > > > > > > > > > -----Original Message----- > > > From: Ni, Ray > > > Sent: Tuesday, May 12, 2020 1:41 AM > > > To: Yau, KaiX ; devel@edk2.groups.io; > > > kaiyau@gmail.com > > > Cc: Jiang, Guomin ; Gao, Liming > > > ; Archield, Ralphal > > > > > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR > > > displayed in SETUP > > > > > > I am ok if you change the PCD default value to [2020, 2119]. > > > > > > Please send out separate patch for the PCD default value change if y= ou want. > > > > > > Thanks, > > > Ray > > > > > > > -----Original Message----- > > > > From: Yau, KaiX > > > > Sent: Tuesday, May 12, 2020 10:02 AM > > > > To: Ni, Ray ; devel@edk2.groups.io; > > > > kaiyau@gmail.com > > > > Cc: Jiang, Guomin ; Gao, Liming > > > > ; Archield, Ralphal > > > > > > > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System > > > > YEAR displayed in SETUP > > > > > > > > Hi, > > > > > > > > The current default PCD values has issue with the current logic. > > > > > > > > How do you want to resolve this? > > > > If you decide not to fix the logic, at least we need to change the= Min value to 2000 and Max value to 2099. > > > > > > > > If you agreed, you can remove my logic fix (PcRtc.c) from the > > > > Gerrit, and just keep the PCD changes and check-in the > > code. > > > > > > > > Regards > > > > Kai Yau > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > From: Ni, Ray > > > > Sent: Monday, May 11, 2020 9:52 PM > > > > To: Yau, KaiX ; devel@edk2.groups.io; > > > > kaiyau@gmail.com > > > > Cc: Jiang, Guomin ; Gao, Liming > > > > ; Archield, Ralphal > > > > > > > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System > > > > YEAR displayed in SETUP > > > > > > > > The PCD range (100 years) assumes that: > > > > there is no such a x86 system that can use a bios flashed in year > > > > 1998 and this system will be functional till 2097. Or even it can > > > > be functional till 2097, its bios should be flashed multiple > > > times during the 100 years. > > > > > > > > I don't think we need to consider the solution to Y3K because I > > > > guess (90% believe) the RTC hardware will disappear after > > > > 10 years at most. > > > > > > > > Thanks, > > > > Ray > > > > > > > > > -----Original Message----- > > > > > From: Yau, KaiX > > > > > Sent: Monday, April 27, 2020 1:47 PM > > > > > To: Ni, Ray ; devel@edk2.groups.io; > > > > > kaiyau@gmail.com > > > > > Cc: Jiang, Guomin ; Gao, Liming > > > > > ; Archield, Ralphal > > > > > > > > > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System > > > > > YEAR displayed in SETUP > > > > > > > > > > Hi Ray, > > > > > > > > > > The current logic in PcRtc.c will give us WRONG year. (I > > > > > explained > > > > > below) If we only change the PCD Min. value to 2000 and Max. > > > > > value to 2099. The current logic will work. But we still > > > > have Y3K bug. > > > > > > > > > > That is why we need to read from Hardware. > > > > > If any reasons you guys doesn't want to read from hardware, at l= east we need to change Min. and Max. value ASAP. > > > > > (you can go ahead to delete the change in PcRtc.c and just > > > > > submit the PCD changes) > > > > > > > > > > Regards > > > > > Kai Yau > > > > > > > > > > > > > > > > > > > > ---------------------------------------------------------------- > > > > > -- > > > > > -- > > > > > -- > > > > > ------- The root cause is from the following logic (PcRtc.c): > > > > > > > > > > Current Default PcdMinimalValidYear =3D 1998 Current Default > > > > > PcdMaximalValidYear =3D 2097 > > > > > > > > > > If we can set the YEAR to 2099, we will end up getting 1999 inst= ead. The reason why user have not found this > > problem > > > > > because Windows does not allow user to set the YEAR to 2099. If > > > > > we make the PcdMaximalValidYear smaller, you can reproduce this= issue. > > > > > > > > > > Time->Year =3D CheckAndConvertBcd8ToDecimal8 ((UINT8) Time->= Year); <-- Time->Year =3D 99 > > > > > Century =3D (UINT8) (PcdGet16 (PcdMinimalValidYear) / 100); = <-- Century =3D 19 > > > > > if (Time->Year < PcdGet16 (PcdMinimalValidYear) % 100) { = <-- (99 < 97) =3D FALSE > > > > > Century++; > > > > > } > > > > > Time->Year =3D (UINT16) (Century * 100 + Time->Year); = <-- Time->Year =3D 1999 (19 x 100 + 99). Also > > 1999 > > > is > > > > > within the RANGE, so it is considered as "VALID" data; however i= t is wrong. > > > > > > > > > > Regards > > > > > Kai > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > From: Ni, Ray > > > > > Sent: Monday, April 27, 2020 12:54 AM > > > > > To: devel@edk2.groups.io; kaiyau@gmail.com > > > > > Cc: Yau, KaiX ; Jiang, Guomin > > > > > ; Gao, Liming > > > > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System > > > > > YEAR displayed in SETUP > > > > > > > > > > This patch introduces several changes for different purposes. > > > > > At least I can see: > > > > > 1. Default PCD value change > > > > > 2. Consume century value from HW > > > > > > > > > > Can you separate the patches to 2 patches? > > > > > > > > > > > > > > > For the purpose #2, can you explain more background/reason? > > > > > > > > > > The PcdMinimalValidYear/ PcdMaximalValidYear value are chosen > > > > > that when a two-digit year is read from HW, there is no confusio= n to convert to 4-digit year. > > > > > Are you aware of this when you made the patch? > > > > > > > > > > Thanks, > > > > > Ray > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: devel@edk2.groups.io On Behalf Of > > > > > > Yau > > > > > > Sent: Friday, March 20, 2020 11:42 AM > > > > > > To: devel@edk2.groups.io > > > > > > Cc: Yau, KaiX > > > > > > Subject: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System > > > > > > YEAR displayed in SETUP > > > > > > > > > > > > Function ConvertRtcTimeToEfiTime() will reset to Century 19XX > > > > > > when the year is set larger than the value of PcdMaximalValidY= ear outside SETUP. > > > > > > > > > > > > Signed-off-by: Yau > > > > > > --- > > > > > > PcAtChipsetPkg/PcAtChipsetPkg.dec | 7 +++--- > > > > > > .../PcatRealTimeClockRuntimeDxe/PcRtc.c | 25 ++++++++++= +-------- > > > > > > .../PcatRealTimeClockRuntimeDxe/PcRtc.h | 17 +++++++---= --- > > > > > > 3 files changed, 27 insertions(+), 22 deletions(-) > > > > > > > > > > > > diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dec > > > > > > b/PcAtChipsetPkg/PcAtChipsetPkg.dec > > > > > > index 88de5cceea..660cb5d52e 100644 > > > > > > --- a/PcAtChipsetPkg/PcAtChipsetPkg.dec > > > > > > +++ b/PcAtChipsetPkg/PcAtChipsetPkg.dec > > > > > > @@ -4,7 +4,7 @@ > > > > > > # This package is designed to public interfaces and > > > > > > implementation which follows # PcAt defacto standard. > > > > > > # > > > > > > -# Copyright (c) 2009 - 2019, Intel Corporation. All rights > > > > > > reserved.
> > > > > > +# Copyright (c) 2009 - 2020, Intel Corporation. All rights > > > > > > +reserved.
> > > > > > # Copyright (c) 2017, AMD Inc. All rights reserved.
# # > > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent @@ -61,12 +61,13 > > > > > > @@ > > > > > > > > > > > > ## This PCD specifies the minimal valid year in RTC. > > > > > > # @Prompt Minimal valid year in RTC. > > > > > > - > > > > > > gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear|1998|UINT16| > > > > > > 0x > > > > > > 00 > > > > > > 00 > > > > > > 0 > > > > > > 00D > > > > > > + # @Expression 0x80000001 | > > > > > > gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear >=3D 2000 > > > > > > + > > > > > > gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear|2000|UINT16| > > > > > > 0x > > > > > > 00 > > > > > > 00 > > > > > > 0 > > > > > > 00D > > > > > > > > > > > > ## This PCD specifies the maximal valid year in RTC. > > > > > > # @Prompt Maximal valid year in RTC. > > > > > > # @Expression 0x80000001 | > > > > > > gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear < > > > > > > gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear + 100 > > > > > > - > > > > > > gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear|2097|UINT16| > > > > > > 0x > > > > > > 00 > > > > > > 00 > > > > > > 0 > > > > > > 00E > > > > > > + > > > > > > gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear|2099|UINT16| > > > > > > 0x > > > > > > 00 > > > > > > 00 > > > > > > 0 > > > > > > 00E > > > > > > > > > > > > [PcdsFixedAtBuild, PcdsPatchableInModule] > > > > > > ## Defines the ACPI register set base address. > > > > > > diff --git > > > > > > a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c > > > > > > b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c > > > > > > index 52af179417..38a3521dfc 100644 > > > > > > --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c > > > > > > +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c > > > > > > @@ -1,7 +1,7 @@ > > > > > > /** @file > > > > > > RTC Architectural Protocol GUID as defined in DxeCis 0.96. > > > > > > > > > > > > -Copyright (c) 2006 - 2018, Intel Corporation. All rights > > > > > > reserved.
> > > > > > +Copyright (c) 2006 - 2020, Intel Corporation. All rights > > > > > > +reserved.
> > > > > > Copyright (c) 2017, AMD Inc. All rights reserved.
> > > > > > > > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent @@ -441,8 +441,8 > > > > > > @@ PcRtcGetTime ( **/ EFI_STATUS PcRtcSetTime ( > > > > > > - IN EFI_TIME *Time, > > > > > > - IN PC_RTC_MODULE_GLOBALS *Global > > > > > > + IN EFI_TIME *Time, > > > > > > + IN OUT PC_RTC_MODULE_GLOBALS *Global > > > > > > ) > > > > > > { > > > > > > EFI_STATUS Status; > > > > > > @@ -525,6 +525,8 @@ PcRtcSetTime ( > > > > > > // > > > > > > if (Global->CenturyRtcAddress !=3D 0) { > > > > > > RtcWrite (Global->CenturyRtcAddress, DecimalToBcd8 > > > > > > ((UINT8) (RtcTime.Year / 100))); > > > > > > + } else { > > > > > > + DEBUG ((EFI_D_INFO, "PcRtc: Century RTC Address is not > > > > > > + found\n")); > > > > > > } > > > > > > > > > > > > ConvertEfiTimeToRtcTime (&RtcTime, RegisterB); @@ -868,6 > > > > > > +870,9 @@ ConvertRtcTimeToEfiTime ( { > > > > > > BOOLEAN IsPM; > > > > > > UINT8 Century; > > > > > > + UINT8 CenturyRtcAddress; > > > > > > + > > > > > > + CenturyRtcAddress =3D GetCenturyRtcAddress (); > > > > > > > > > > > > if ((Time->Hour & 0x80) !=3D 0) { > > > > > > IsPM =3D TRUE; > > > > > > @@ -891,14 +896,12 @@ ConvertRtcTimeToEfiTime ( > > > > > > return EFI_INVALID_PARAMETER; > > > > > > } > > > > > > > > > > > > - // > > > > > > - // For minimal/maximum year range [1970, 2069], > > > > > > - // Century is 19 if RTC year >=3D 70, > > > > > > - // Century is 20 otherwise. > > > > > > - // > > > > > > - Century =3D (UINT8) (PcdGet16 (PcdMinimalValidYear) / 100); > > > > > > - if (Time->Year < PcdGet16 (PcdMinimalValidYear) % 100) { > > > > > > - Century++; > > > > > > + if (CenturyRtcAddress !=3D 0) { > > > > > > + Century =3D CheckAndConvertBcd8ToDecimal8 ((UINT8) (RtcRe= ad > > > > > > (CenturyRtcAddress))); > > > > > > + } else if ((PcdGet16 (PcdMinimalValidYear) / 100) =3D=3D > > > > > > + (PcdGet16 > > > > > > (PcdMaximalValidYear) / 100)) { > > > > > > + Century =3D (UINT8)(PcdGet16 (PcdMinimalValidYear) / 100)= ; > > > > > > + } else { > > > > > > + Century =3D RTC_INIT_CENTURY; > > > > > > } > > > > > > Time->Year =3D (UINT16) (Century * 100 + Time->Year); > > > > > > > > > > > > diff --git > > > > > > a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h > > > > > > b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h > > > > > > index 47293ce44c..94926fe73e 100644 > > > > > > --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h > > > > > > +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h > > > > > > @@ -1,7 +1,7 @@ > > > > > > /** @file > > > > > > Header file for real time clock driver. > > > > > > > > > > > > -Copyright (c) 2006 - 2018, Intel Corporation. All rights > > > > > > reserved.
> > > > > > +Copyright (c) 2006 - 2020, Intel Corporation. All rights > > > > > > +reserved.
> > > > > > Copyright (c) 2017, AMD Inc. All rights reserved.
> > > > > > > > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent @@ -62,11 +62,12 > > > > > > @@ extern PC_RTC_MODULE_GLOBALS mModuleGlobal; // Date and > > > > > > time initial values. > > > > > > // They are used if the RTC values are invalid during driver > > > > > > initialization // -#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_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_INIT_CENTURY 20 > > > > > > > > > > > > #pragma pack(1) > > > > > > // > > > > > > @@ -160,8 +161,8 @@ PcRtcInit ( **/ EFI_STATUS PcRtcSetTime > > > > > > ( > > > > > > - IN EFI_TIME *Time, > > > > > > - IN PC_RTC_MODULE_GLOBALS *Global > > > > > > + IN EFI_TIME *Time, > > > > > > + IN OUT PC_RTC_MODULE_GLOBALS *Global > > > > > > ); > > > > > > > > > > > > /** > > > > > > -- > > > > > > 2.17.1.windows.2 > > > > > > > > > > > > > > > > > >=20