aboutsummaryrefslogtreecommitdiff
path: root/include/os.h
diff options
context:
space:
mode:
authorHeinrich Schuchardt2020-12-30 18:07:48 +0100
committerSimon Glass2021-01-30 14:25:42 -0700
commit43db07507abdb54b6575345300c171b0486e46be (patch)
tree7c6ba06d302c3cc443b6f7cf73bd8ff7b4ea69f7 /include/os.h
parent5e6c9029cdeae72eeeb4e05caa4ce3d48e2e86fb (diff)
sandbox: keep time offset when resetting
The UEFI Self Certification Test (SCT) checks the SetTime() service with the following steps: * set date * reset * check date matches To be compliant the sandbox should keep the offset to the host RTC during resets. The implementation uses the environment variable UBOOT_SB_TIME_OFFSET to persist the offset. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/os.h')
-rw-r--r--include/os.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/os.h b/include/os.h
index 0913b47b3a8..e192e32d592 100644
--- a/include/os.h
+++ b/include/os.h
@@ -424,4 +424,22 @@ int os_setup_signal_handlers(void);
*/
void os_signal_action(int sig, unsigned long pc);
+/**
+ * os_get_time_offset() - get time offset
+ *
+ * Get the time offset from environment variable UBOOT_SB_TIME_OFFSET.
+ *
+ * Return: offset in seconds
+ */
+long os_get_time_offset(void);
+
+/**
+ * os_set_time_offset() - set time offset
+ *
+ * Save the time offset in environment variable UBOOT_SB_TIME_OFFSET.
+ *
+ * @offset: offset in seconds
+ */
+void os_set_time_offset(long offset);
+
#endif