diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2015-06-11 07:14:18 +0000 |
---|---|---|
committer | niruiyu <niruiyu@Edk2> | 2015-06-11 07:14:18 +0000 |
commit | fe32096778cf248e36d6d00cd958d73fb903126f (patch) | |
tree | fd68eb64acfe87dcc681e7b686a57ddb2406c897 /PcAtChipsetPkg/PcAtChipsetPkg.dec | |
parent | e63ec1beac46991176b18c859372f0f16fb97b13 (diff) | |
download | edk2-platforms-fe32096778cf248e36d6d00cd958d73fb903126f.tar.xz |
PcAtChipsetPkg/PcRtc: Fix a Y2K bug
The original driver cannot handle the case when system time runs from 1999/12/31 23:59:59
to 2000/1/1 0:0:0.
A simple test to set system time to 1999/12/31 23:59:59 can expose this bug.
The patch limits the driver to only support year in 100 range and decide the century value based
on the supporting range: Century either equals to PcdMinimalYear / 100 or equals to PcdMinimalYear / 100 + 1.
The patch passed the Y2K test.
However with year range [1998, 2097], when system time is 2097/12/31 23:59:59,
the next second system time will become 1998/1/1 0:0:0. I think it's a acceptable limitation.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17624 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'PcAtChipsetPkg/PcAtChipsetPkg.dec')
-rw-r--r-- | PcAtChipsetPkg/PcAtChipsetPkg.dec | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dec b/PcAtChipsetPkg/PcAtChipsetPkg.dec index fb6fb8b9f7..6a1415c25c 100644 --- a/PcAtChipsetPkg/PcAtChipsetPkg.dec +++ b/PcAtChipsetPkg/PcAtChipsetPkg.dec @@ -123,7 +123,8 @@ ## This PCD specifies the maximal valid year in RTC.
# @Prompt Maximal valid year in RTC.
- gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear|2099|UINT16|0x0000000E
+ # @Expression gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear < gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear + 100
+ gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear|2097|UINT16|0x0000000E
[PcdsFixedAtBuild, PcdsPatchableInModule]
## Defines the ACPI register set base address.
@@ -168,4 +169,4 @@ gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddressMask |0xFFFE|UINT16|0x00000018
[UserExtensions.TianoCore."ExtraFiles"]
- PcAtChipsetPkgExtra.uni
\ No newline at end of file + PcAtChipsetPkgExtra.uni
|