From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::143; helo=mail-it1-x143.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x143.google.com (mail-it1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 41385208AE365 for ; Tue, 19 Feb 2019 23:43:04 -0800 (PST) Received: by mail-it1-x143.google.com with SMTP id v72so13360834itc.0 for ; Tue, 19 Feb 2019 23:43:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BLaLIdzgcpkbj0LbT8J1I4RkpY2mAsZvk3lsKLekxLc=; b=dqlVxt/z0rTveeK15lWSl+NlC7oxDy3zIHgF1Xy1s6wRE2ACZ0JBk0BH4P019LScp8 wFgmxWUrDnZblrXzQl/EjYukQw2Unv/jMpA7H82FBxQSby1O5gHt/XX54xOH64Vkhd9M mCDyPXE8VWKrmXmLPRL1CCdXbBwD8fcUDYAwXglDCnj4L/ho1r/kqJTGh3AF7iR60uxC Yfxog5v1JR65vIm+mt2LrzwdAq2E3S4tG6S1ltnU7DHpXWMhW76yI8CcGBNjKU6QlD7o 2j8e4O7ULDBouycTlAsqnGO62aBugGXHoZHm8f9LY8CD/loGTbLdMQ29rKgWJWmH+JvF zt3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BLaLIdzgcpkbj0LbT8J1I4RkpY2mAsZvk3lsKLekxLc=; b=OLywu3QxzGAxlwpSYoxoorfre3DJctNHx0/rKBRXW5JnrCzxmfCGhalT06nyb5Laz2 q9eMblnvaGI4D/sYQ+LVK52sLVj8iQglgvhQSUI7QbLBwwkKRT3x3Jmy0JxeATPKM2sb fdQ/TBXsqbvTatzaIBssWIqJCB+0K6R6LhlBAO1PL+3KSZkJ9FOK3M0PrU1Sf43DbvG2 eMmqU8Rhtaxq97eMykJxgejl5WaSO2WTfltRGHs2ZRDMzVkOYCWiWjcZGHYXcbHGSLVR TgdJSS0HtefGuVdaPI78i5JIleD9zPFG8BKTMO6pMP1uPllsnO11GmaEtK9L1cq3sLJW m/0w== X-Gm-Message-State: AHQUAuZik5KJjF8+ekjeTE2pKLQIG8muw1x2cqV4XdVnmtn+AgdF5X0j rpUr7HEJd8gUZiBrz6l/UvkZhgtcd37mRYxOgKwCfg== X-Google-Smtp-Source: AHgI3Ia+1NxiGjYuAEnhEorqSkEQk0CRvEZSJbDhLcdN/pC6udV8z6bUHtXB1Vu+qhe+9tST8z/2757ecqB+75zcfBw= X-Received: by 2002:a24:1947:: with SMTP id b68mr4136926itb.121.1550648583406; Tue, 19 Feb 2019 23:43:03 -0800 (PST) MIME-Version: 1.0 References: <20190204124736.124-1-pete@akeo.ie> <20190204124736.124-2-pete@akeo.ie> <20190212181430.oji2fxzfpeq5lm4t@bivouac.eciton.net> <327e7ce8-b300-e239-0d47-13ee925711b0@akeo.ie> In-Reply-To: <327e7ce8-b300-e239-0d47-13ee925711b0@akeo.ie> From: Ard Biesheuvel Date: Wed, 20 Feb 2019 08:42:51 +0100 Message-ID: To: Pete Batard Cc: Leif Lindholm , "edk2-devel@lists.01.org" Subject: Re: [PATCH 1/1] EmbeddedPkg/Library: Add VirtualRealTimeClockLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 07:43:04 -0000 Content-Type: text/plain; charset="UTF-8" On Fri, 15 Feb 2019 at 15:57, Pete Batard wrote: > > On 2019-02-15 14:39, Ard Biesheuvel wrote: > > On Fri, 15 Feb 2019 at 11:07, Ard Biesheuvel wrote: > >> > >> On Tue, 12 Feb 2019 at 19:14, Leif Lindholm wrote: > >>> > >>> On Mon, Feb 04, 2019 at 12:47:36PM +0000, Pete Batard wrote: > >>>> This is designed to be used on platforms where a a real RTC is not > >>>> available and relies on an RtcEpochSeconds variable having been set or, > >>>> if that is not the case, falls back to using the epoch embedded at > >>>> compilation time. > >>>> > >>>> Note that, in order to keep things simple for the setting of the > >>>> compilation time variable, only GCC environments with UNIX-like shells > >>>> and where a 'date' command is available are meant to be supported for > >>>> now. > >>>> > >>>> Contributed-under: TianoCore Contribution Agreement 1.1 > >>>> Signed-off-by: Pete Batard > >>> > >>> On the whole, this looks good to me. > >>> One addition we'll need, so that we can build this library standalone > >>> is an entry in EmbeddedPkg.dsc: > >>> > >>> diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc > >>> index 4d9e6399d5..dc5040e611 100644 > >>> --- a/EmbeddedPkg/EmbeddedPkg.dsc > >>> +++ b/EmbeddedPkg/EmbeddedPkg.dsc > >>> @@ -218,6 +218,7 @@ [Components.common] > >>> EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.inf > >>> EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf > >>> EmbeddedPkg/Library/DxeDtPlatformDtbLoaderLibDefault/DxeDtPlatformDtbLoaderLibDefault.inf > >>> + EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf > >>> EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf > >>> EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf > >>> > >>> I don't have any strong opinions on either of Phil's suggestions, but > >>> if you could give some feedback on those and fold the above in, this > >>> could go in. > >>> > >> > >> WIth this addition > >> > >> Reviewed-by: Ard Biesheuvel > >> > >> Pushed as 1b261a705f94..64a17fadcb79 > > > > OK, there is a problem with this code: > > > > +EFI_STATUS > > +EFIAPI > > +LibGetTime ( > > + OUT EFI_TIME *Time, > > + OUT EFI_TIME_CAPABILITIES *Capabilities > > + ) > > +{ > > + EFI_STATUS Status; > > + UINT32 EpochSeconds; > > > > EpochSeconds is declared here, and updated depending on time zone and > > DST settings. However, the resulting value is never used anywhere. > > You're right. > > Looks like I forgot to merge all the use of EpochSeconds into > ElapsedSeconds, from the code I copy/pasted. > > I'm very sorry about this, as it's something I should have picked up > before sending this patch for review. > > It is not clear to me what the correct fix is, so Pete, could you > > please look into this? > > I'll send a fix for this as soon as I have a chance. Thanks for pointing > the mistake. > Any progress here?