summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Wojtas <mw@semihalf.com>2021-05-24 05:54:41 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-06-02 07:16:28 +0000
commitb233eb1849ac01bdd5b24ea84460a2e481a4c5a9 (patch)
tree5ddd72bdd0f349323d6779889f22c17c271e4a21
parentfdf3666f01a2dd02d83a808f609b9c744a74c652 (diff)
downloadedk2-b233eb1849ac01bdd5b24ea84460a2e481a4c5a9.tar.gz
edk2-b233eb1849ac01bdd5b24ea84460a2e481a4c5a9.tar.bz2
edk2-b233eb1849ac01bdd5b24ea84460a2e481a4c5a9.zip
EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTime
GetWakeupTime should return full time information, including the daylight/timezone. Make use of the existing non-volatile variables for that purpose. Moreover add an error checking of possibly invalid parameters. This partially fixes FWTS and SCT Set/GetWakeupTime tests on Marvell platforms. Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r--EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
index e59036badc..85650a6ede 100644
--- a/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
+++ b/EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c
@@ -143,6 +143,17 @@ GetWakeupTime (
OUT EFI_TIME *Time
)
{
+ if (Time == NULL || Enabled == NULL || Pending == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Set these first so the RealTimeClockLib implementation
+ // can override them based on its own settings.
+ //
+ Time->TimeZone = mTimeSettings.TimeZone;
+ Time->Daylight = mTimeSettings.Daylight;
+
return LibGetWakeupTime (Enabled, Pending, Time);
}