]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTime
authorMarcin Wojtas <mw@semihalf.com>
Mon, 24 May 2021 03:54:41 +0000 (05:54 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 2 Jun 2021 07:16:28 +0000 (07:16 +0000)
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>
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClock.c

index e59036badc91fb90024edb763f16f84bf443e04d..85650a6edefc8b08343d08a9c31915ee2ebd58e1 100644 (file)
@@ -143,6 +143,17 @@ GetWakeupTime (
   OUT EFI_TIME    *Time\r
   )\r
 {\r
+  if (Time == NULL || Enabled == NULL || Pending == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // Set these first so the RealTimeClockLib implementation\r
+  // can override them based on its own settings.\r
+  //\r
+  Time->TimeZone = mTimeSettings.TimeZone;\r
+  Time->Daylight = mTimeSettings.Daylight;\r
+\r
   return LibGetWakeupTime (Enabled, Pending, Time);\r
 }\r
 \r