summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Library/VirtualRealTimeClockLib
Commit message (Collapse)AuthorAgeFilesLines
* EmbeddedPkg: Only print LibGetTime message about compile time epoch onceRebecca Cran2021-03-081-1/+9
| | | | | | | | | | | | | | | | | | | | The message "LibGetTime: RtcEpochSeconds non volatile variable was not found - Using compilation time epoch." can be printed a very large number of times, causing log files to become excessively large. This is because the RtcEpochSeconds variable only gets set if LibSetTime is called, for example by running 'time 12:00' in the UEFI Shell. Avoid this by setting RtcEpochSeconds to BUILD_EPOCH (EpochSeconds) after printing the message. It's set to a volatile variable so the message will be displayed on future boots and not hidden. Commit 44ae214591e58af468eacb7b873eaa0bc187c4fa reduced the verbosity of the message to DEBUG_VERBOSE. Revert it back to DEBUG_INFO so it's more prominent now that it doesn't get printed so frequently. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/VirtualRealTimeClockLib: Reduce DEBUG message verbositySamer El-Haj-Mahmoud2021-02-201-1/+1
| | | | | | | | | The DEBUG message for using compilation time epoch is appearing very frequently on DEBUG firmware builds, for example during UEFI SCT runs. Reduce verbosity to avoid the annoying repetitive message. Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
* EmbeddedPkg/VirtualRealTimeClockLib: Explicit cast to UINT32Pete Batard2020-10-221-2/+2
| | | | | | | | | | | | | | | | | Addresses BZ https://bugzilla.tianocore.org/show_bug.cgi?id=2380 where explicit casts are required for 64 to 32 bit assignment. We can apply a straight cast for Time->Nanosecond since we already checked for overflow. On the other hand, we may have a frequency that is greater than UINT32_MAX for Capabilities->Resolution. But using the frequency for the resolution is the wrong approach anyway, since we can't actually vouch for the actual resolution of the virtual library. Instead, play it safe by defaulting to 1 Hz, which is what a standard PC-AT CMOS RTC device would use. Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
* EmbeddedPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-092-14/+2
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/VirtualRealTimeClockLib: Fix correctness issuesPete Batard2019-02-261-9/+25
| | | | | | | | | | | | | | | | | | LibGetTime(): - Two variables were used for the epoch, where only one should have been [*]. - Also harmonize variable name to match the one used in LibSetTime. LibSetTime(): - Address possible underflows if time is set to start of epoch. - Ensure that time being read does actually match time that was manually set (plus the time elapsed since), by subtracting number of seconds since reset. [*] This fixes a build breakage, since one of these variables was set but never used, triggering a compiler diagnostic at some optimization levels. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg/Library: Add VirtualRealTimeClockLibPete Batard2019-02-152-0/+443
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 <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>