On 06/10/15 06:10, Ruiyu Ni wrote: > 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...@intel.com> > Cc: Feng Tian <feng.t...@intel.com> > Cc: Liming Gao <liming....@intel.com> > Cc: Michael D Kinney <michael.d.kin...@intel.com> > --- > PcAtChipsetPkg/PcAtChipsetPkg.dec | 5 +- > PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c | 55 > +++++++++------------- > PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h | 11 +---- > 3 files changed, 27 insertions(+), 44 deletions(-) > > diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dec > b/PcAtChipsetPkg/PcAtChipsetPkg.dec > index fb6fb8b..6a1415c 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
This @Expression is malformed, it causes the following build error: > build.py... > : error C0DE: Unknown fatal error when processing > [.../PcAtChipsetPkg/PcAtChipsetPkg.dec] > > (Please send email to edk2-devel@lists.sourceforge.net for help, attaching > following call stack trace!) > > (Python 2.7.5 on linux2) Traceback (most recent call last): > File > ".../BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", > line 2032, in Main > MyBuild.Launch() > File > ".../BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", > line 1788, in Launch > self._MultiThreadBuildPlatform() > File > ".../BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", > line 1583, in _MultiThreadBuildPlatform > self.Progress > File ".../BaseTools/Source/Python/AutoGen/AutoGen.py", line 175, in __new__ > if not AutoGenObject._Init(Workspace, MetaFile, Target, Toolchain, Arch, > *args, **kwargs): > File ".../BaseTools/Source/Python/AutoGen/AutoGen.py", line 357, in _Init > for Pcd in Pkg.Pcds: > File ".../BaseTools/Source/Python/Workspace/WorkspaceDatabase.py", line > 1487, in _GetPcds > self._Pcds.update(self._GetPcd(MODEL_PCD_FIXED_AT_BUILD)) > File ".../BaseTools/Source/Python/Workspace/WorkspaceDatabase.py", line > 1521, in _GetPcd > validateranges, validlists, expressions = > self._RawData.GetValidExpression(TokenSpaceGuid, PcdCName) > File ".../BaseTools/Source/Python/Workspace/MetaFileParser.py", line 380, > in GetValidExpression > return self._Table.GetValidExpression(TokenSpaceGuid, PcdCName) > File ".../BaseTools/Source/Python/Workspace/MetaFileTable.py", line 246, in > GetValidExpression > expressions.append(comment.split("|")[1].strip()) > IndexError: list index out of range > > - Failed - @Expression's should have a number (I guess a bitmask of flags?) associated with them, and that number should be separated from the actual expression with a filter bar (|). Example: MdePkg/MdePkg.dec: # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask & 0xC0) == 0 The above @Expression in "PcAtChipsetPkg/PcAtChipsetPkg.dec" lacks the bitmask and the "|" separator. (Which makes me question if this patch was ever build tested.) Thanks Laszlo ------------------------------------------------------------------------------ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel