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::142; helo=mail-it1-x142.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x142.google.com (mail-it1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (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 CB909208AE370 for ; Fri, 15 Feb 2019 05:40:12 -0800 (PST) Received: by mail-it1-x142.google.com with SMTP id z7so24156003iti.0 for ; Fri, 15 Feb 2019 05:40:12 -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=YfKyElmsNDFweM80FczobNuATc4aF5mSHMrm956fPlI=; b=f9B6en7sFWwtNrHbGrgV/+fT+68XZdCGJgKoBcc6qXZ4hf2oXfzlF5lWH194/T6fNn VZ9IL1ueWcUCHm4i+OKWUoVhDo5V9A0LaAwib1OmRPErrnBOFuNj0+5oM0DXwRXI/Oik bi01+ZAxySxEi5gl+f2YMoTYNT20P6ux+COFd/6ZEKZ8usAt/cPMzdbk5Bmg28Fr4wOH bQq4MPhYVHOpPRFL0jewYaiI28A7lOevAGqybmGkkoJzI3PCoJJotiYt0Eck6IWjlAja WQJ2cwlYF8QkmaDzLtdRGwZeEzOVJ1KTtIjOMwI1IbxvobenTUZs8ziQYRnqTxtT9R1u BhHQ== 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=YfKyElmsNDFweM80FczobNuATc4aF5mSHMrm956fPlI=; b=fu0vyCFnhy3OomVHRvbPvzblcY1ltclTawMXS3pIvxvW76kBofPWs7NMxKb/zRqnsb 4JzoAoM4ylZkD6hoBkCJGpoGcVAErI4/8gaBs55H6zFTj5yju91cK0TL8bUn8g0KrHqT e8BhwG947Ai3YKdrclcmezJdveuvjMvItebuAyquvQxnrmQVlHtqk2jQeJJyzgZeRNM3 3S9JwnXQcpOxY/0IvFraCfNNx22fJ9R30qlzL6tGjiHYf0gHxqiWU4G54kd4jB0uQIlK L5j4SCE7x4goLzT9ZO25pCPCUHMUWbQKIimEW9FBT5A2zZ4FD3LWdx2MQ9h3qqXqTw7t C1OA== X-Gm-Message-State: AHQUAuYUspYtZkGUhdmVJol65JkprAhtvdfIQ6lwVid6gl0D4Agdkmsn 7uKpkA6N43L0GKKpGpAJ4+kIusfd3pOaX5eK16THDA== X-Google-Smtp-Source: AHgI3IahYpib8cn4Cr3v56VG2HpYWnbwY01Cj8wsdq3cgo2PZvKknPHBQ9gOCFo8lRmI2NNpUjvew87y0BJVGOza4tg= X-Received: by 2002:a05:660c:4b:: with SMTP id p11mr5210706itk.71.1550238011288; Fri, 15 Feb 2019 05:40:11 -0800 (PST) MIME-Version: 1.0 References: <20190204124736.124-1-pete@akeo.ie> <20190204124736.124-2-pete@akeo.ie> <20190212181430.oji2fxzfpeq5lm4t@bivouac.eciton.net> In-Reply-To: From: Ard Biesheuvel Date: Fri, 15 Feb 2019 14:39:59 +0100 Message-ID: To: Leif Lindholm , Pete Batard Cc: "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 13:40:13 -0000 Content-Type: text/plain; charset="UTF-8" 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. It is not clear to me what the correct fix is, so Pete, could you please look into this?