From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web10.10510.1596459657756804002 for ; Mon, 03 Aug 2020 06:00:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=VmnRk+Rh; spf=pass (domain: nuviainc.com, ip: 209.85.221.68, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f68.google.com with SMTP id f1so33581746wro.2 for ; Mon, 03 Aug 2020 06:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1LvLS3vg8HyWGcb8Y0BNGHc2zM9mGh7UA7njTQUuEXc=; b=VmnRk+Rh+Apsz1pQJxFM2Pza3O50vhbo2ipqiDTqUDkQ66IaqR3uz7P8hfdA7jfY9y vRaALXUPjn3accaL8nWAzKUI+7Mh4Uz8Y2cf5azR223o8XgYI5f4xoHh4SwQejp3yx1V UiyhZvOUpUJ6JSkMcEJYgjDC72DElBYH9sFWH15EwTW61oLu6dtAK8uqPRP8YG/WyFaI Tk5A9BFfE7vb1/wDTeh242Ng+AQJRD6uy1NLgfnKABjWvrNxvMMKm1ddDxzqRg0v6J7X u1+8TQYTapD7pVbJ9dqkINtfOPkBnsF8aN3b49CD/Q+ly18DOH1QGYTJiXhMYCaFTN3E oo7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1LvLS3vg8HyWGcb8Y0BNGHc2zM9mGh7UA7njTQUuEXc=; b=TqfsrR54bo9o2A79oOEFaJs2Kwxq92fK0f4cctWNfR4+B2od/6Cd5hHGuVN/CNY1+V ahU0QqnJV+uCXJ8Z4mRmRkWEWr+OM4cfWc5VTzHnitRvE27jbzsvHyGJNGHCJM5bgbND someKefwfgcTSh+FtET0zYgji7HRh2522GnR+FdAq90b8r7MhWFHoUx93wzn0Rtzfoax SEDPCxP/0/pPfVSAyi09OXsbbO6MIITWc/mvLg2eo4ED4nqoU/y8vepyXs87O68YygYe vvtiMg+F6RZTf754wqdC/mTu/NYdn/kxNJuEbJicw1vZrvuythV7mCS70o+IuKxEwKEX pwAQ== X-Gm-Message-State: AOAM532Am9ZVxjRm1tvF5M47PFFHLy4lKraKA9AZta/NMpiJeQuA6zZC DDNwx3RvzNPEsMDlLkVhzaZ8+Q== X-Google-Smtp-Source: ABdhPJyhtt9cGt/wMaN60je+q962anWM9MSnpBK8qdI7yHNYDa8ilZUY+gxTXZxd68xMgi3+sWyAGQ== X-Received: by 2002:a5d:5383:: with SMTP id d3mr15022805wrv.42.1596459655958; Mon, 03 Aug 2020 06:00:55 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id t202sm24375498wmt.20.2020.08.03.06.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 06:00:55 -0700 (PDT) Date: Mon, 3 Aug 2020 14:00:53 +0100 From: "Leif Lindholm" To: Pete Batard Cc: devel@edk2.groups.io, ard.biesheuvel@arm.com Subject: Re: [PATCH 1/1] EmbeddedPkg/TimeBaseLib: Add macros to get build year/month/day Message-ID: <20200803130053.GY31778@vanye> References: <20200724163742.5828-1-pete@akeo.ie> <20200803120911.GX31778@vanye> <06364725-a179-003b-29b8-f75128599bc5@akeo.ie> MIME-Version: 1.0 In-Reply-To: <06364725-a179-003b-29b8-f75128599bc5@akeo.ie> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Pete, On Mon, Aug 03, 2020 at 13:21:41 +0100, Pete Batard wrote: > On 2020.08.03 13:09, Leif Lindholm wrote: > > Hi Pete, > > > > Well prodded (off-list). > > > > I expect I saw that arrive, expected the corresponding RPi > > resubmission to arrive shortly afterwards for me to test with and put > > it soundly at the back of my mind. Presumably you were waiting for > > this to be merged before resubmitting that one? > > Yes. I tend to find it inconvenient to reference to work that has not yet > been integrated, as I'm not sure how you're suppose to reference it. Should > you point to an edk2-devel post in the commit message? In the cover letter? > Something else? The cover letter is a good place to describe such dependencies. We always merge edk2 portions before edk2-platforms, so once it's merged the only ordering requirement is that your edk2 isn't older than your edk2-platforms. Hence, we don't really need it in commit messages. > As a result, provided the dependency should be simple enough to review > independently, I prefer to alleviate that issue by just waiting for it to be > integrated. But if that's a problem, I can certainly ensure that future > co-dependent patches are submitted together. In this particular case, it wasn't actually important, we just ended up with mismatched expectations. Since it was fairly isolated code that I had already been able to test build in my environments when it formed part of the original driver. Regards, Leif > > Anyway: > > Reviewed-by: Leif Lindholm > > Pushed as bbb8a8185838. > > Thanks! > > /Pete > > > > > Regards, > > > > Leif > > > > On Fri, Jul 24, 2020 at 17:37:42 +0100, Pete Batard wrote: > > > These can be used, for instance, to automate the population of an SMBIOS > > > Type 0 BIOS Release Date when building a UEFI firmware (which is how we > > > plan to use these macros for the Raspberry Pi platform). > > > > > > These macros should work for any compiler that follows ISO/IEC 9899, but > > > we add a check for the compiler we have tested to be on the safe side. > > > > > > Note that we decided against adding a #error or #warn for compilers that > > > haven't been validated, as we don't want to introduce breakage for people > > > who may already be using the header with something else than gcc, MSVC or > > > Clang. Instead, we expect those to send a patch that adds their compiler > > > to the list, once they have tested the macros there. > > > > > > Signed-off-by: Pete Batard > > > --- > > > EmbeddedPkg/Include/Library/TimeBaseLib.h | 32 ++++++++++++++++++++ > > > 1 file changed, 32 insertions(+) > > > > > > diff --git a/EmbeddedPkg/Include/Library/TimeBaseLib.h b/EmbeddedPkg/Include/Library/TimeBaseLib.h > > > index 4103c89b3891..ee2f191d985b 100644 > > > --- a/EmbeddedPkg/Include/Library/TimeBaseLib.h > > > +++ b/EmbeddedPkg/Include/Library/TimeBaseLib.h > > > @@ -12,6 +12,38 @@ > > > #include > > > +// > > > +// Convenience macros to obtain a build date > > > +// > > > +// These macros should work for any compiler that follows ISO/IEC 9899, > > > +// in which case __DATE__ is defined as a "Mmm dd yyyy" 11 chars string, > > > +// but add an explicit filter for compilers that have been validated. > > > +// > > > +#if (defined(__GNUC__) || defined(_MSC_VER) || defined(__clang__)) > > > +#define TIME_BUILD_YEAR (__DATE__[7] == '?' ? 1900 \ > > > + : (((__DATE__[7] - '0') * 1000 ) \ > > > + + (__DATE__[8] - '0') * 100 \ > > > + + (__DATE__[9] - '0') * 10 \ > > > + + __DATE__[10] - '0')) > > > +#define TIME_BUILD_MONTH ( __DATE__ [2] == '?' ? 1 \ > > > + : __DATE__ [2] == 'n' ? ( \ > > > + __DATE__ [1] == 'a' ? 1 : 6) \ > > > + : __DATE__ [2] == 'b' ? 2 \ > > > + : __DATE__ [2] == 'r' ? ( \ > > > + __DATE__ [0] == 'M' ? 3 : 4) \ > > > + : __DATE__ [2] == 'y' ? 5 \ > > > + : __DATE__ [2] == 'l' ? 7 \ > > > + : __DATE__ [2] == 'g' ? 8 \ > > > + : __DATE__ [2] == 'p' ? 9 \ > > > + : __DATE__ [2] == 't' ? 10 \ > > > + : __DATE__ [2] == 'v' ? 11 \ > > > + : 12) > > > +#define TIME_BUILD_DAY ( __DATE__[4] == '?' ? 1 \ > > > + : ((__DATE__[4] == ' ' ? 0 : \ > > > + ((__DATE__[4] - '0') * 10)) \ > > > + + __DATE__[5] - '0')) > > > +#endif > > > + > > > // Define EPOCH (1970-JANUARY-01) in the Julian Date representation > > > #define EPOCH_JULIAN_DATE 2440588 > > > -- > > > 2.21.0.windows.1 > > > >