Reviewed-by: Liming Gao <liming....@intel.com> -----Original Message----- From: Feng, Bob C [mailto:bob.c.f...@intel.com] Sent: Tuesday, June 16, 2015 10:36 AM To: edk2-devel@lists.sourceforge.net; Laszlo Ersek; Ni, Ruiyu Cc: Gerd Hoffmann (GMail address) Subject: Re: [edk2] [Patch] PcAtChipsetPkg/PcRtc: Fix a Y2K bug
Hello Laszlo and Ray, I created a patch to fix the build crash. When the build tool find there is incorrect syntax in @expression, @ValidList and @ValidRange in DEC file, the build tool will break and report an error message. Please review. Thanks, Bob -----Original Message----- From: Ni, Ruiyu [mailto:ruiyu...@intel.com] Sent: Friday, June 12, 2015 9:16 AM To: Laszlo Ersek Cc: edk2-devel@lists.sourceforge.net; Gerd Hoffmann (GMail address) Subject: Re: [edk2] [Patch] PcAtChipsetPkg/PcRtc: Fix a Y2K bug Laszlo, Yes I can reproduce this build failure. I did build without the expression comments but didn't do that again after adding the expression comments in DEC. I thought it was only comments and not checked by tool. We are working on patch to fix the build failure. Thanks, Ray > -----Original Message----- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: Thursday, June 11, 2015 11:17 PM > To: Ni, Ruiyu > Cc: edk2-devel@lists.sourceforge.net; Gerd Hoffmann (GMail address) > Subject: Re: [edk2] [Patch] PcAtChipsetPkg/PcRtc: Fix a Y2K bug > > 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|0x000 > 0000E > > + # @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.p > y", > line 2032, in Main > > MyBuild.Launch() > > File > ".../BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.p > y", > line 1788, in Launch > > self._MultiThreadBuildPlatform() > > File > ".../BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.p > y", 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 ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel