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::141; helo=mail-it1-x141.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x141.google.com (mail-it1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 3C17D208AE352 for ; Fri, 15 Feb 2019 07:09:19 -0800 (PST) Received: by mail-it1-x141.google.com with SMTP id x131so23533284itc.3 for ; Fri, 15 Feb 2019 07:09:19 -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=Q35X3AijmokBqB9vQeolzDMwC2JmiqTcmmthAtoTXsY=; b=eFwA+LWhSzeq5XJnYfHjmc8sfSIIQrMuDrI8BrpjcMZmpPZzSr9dpWA1dDIM6/rDK1 6UVxaeGNu3obeRQ8xtDrSN8cwBQGenxMFGgSM3fibsOTjiVqclEcSyGlZB6a2VUmjtqA X0UzPYuGgl6ncf8AWPq2NmuqsTpaQu/gtX8siNJBdNqHvCR007Xh//iuvhjJvPst3BG4 Nvmu2UgEeya0b6jzD2i1lf/ya+r5tSaiTeuh0+Whd9yM8rJyCQgKo6EFJ/w7q4pu8x5X FeqVFox816GSUOrmMrrWnnQLwx+yd9GloQSrANqeuAb5d82fpgFL8R8GvuvR4Tc0Elvv OnRw== 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=Q35X3AijmokBqB9vQeolzDMwC2JmiqTcmmthAtoTXsY=; b=ruGEe/CVoiZM5SfPIQzSYlqa2T1dBhXNZi4oBV3LbxDOga5c4g0lPhVIoWGtZrWyI4 7wWjw/iGu3GQBggyPA3AGP/QLcotlzP662HhUb2v+pVvyINQOB8rvAz+38MMVjDGXZdW u23UzSo6g+lqZkCn8bF2tCZ7oAxzz0OFFtG27M2qwyy1uY+VOvbG4PNerA5wT0r4GE5E EObiEXKkOUJm1Sik5vaCf41tVHImoDkdiWtllSLGiieXknGGc0LRllgrZVLPBRM6z88l 59kVia9lejBaYPNa0Rzllv1Mtysvncjrwx1Zdh2ZTKZmWdwCDA7M3ybiTAanHva4wr8w 42fA== X-Gm-Message-State: AHQUAubfGjHxryUn34gV21rUuDlZaGI5gaf8ezcqqI7HLo21CDdcenEa 0K/+U5UybQWE+7syA4TidROcCOCT24smmYVE4LaS7g== X-Google-Smtp-Source: AHgI3IYkLOP3ntmC83P4hS3spNGUjoDqEcWlje4ObKdEvtvNq66MjNkah+QSioGQPDVtQhWbb9zKcSHr9LtwEo5iBJ8= X-Received: by 2002:a02:5782:: with SMTP id b2mr5416658jad.2.1550243359014; Fri, 15 Feb 2019 07:09:19 -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: Fri, 15 Feb 2019 16:09:07 +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: Fri, 15 Feb 2019 15:09:20 -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. No need to worry about it, as long as you get it fixed :-) > > 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. >