diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2021-05-25 14:19:50 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-05-30 20:24:13 +0000 |
commit | 1724b74f693812b48fa7e36e69174b271f3b5310 (patch) | |
tree | 378ae8901d1986efac1845283956220b941ae134 /src/include | |
parent | 80d5a05cfd08936d5a5f2c44643358d388d84d63 (diff) |
lib/rtc: Add sanity check for time and date
Add a function to check sanity of a given RTC date and time.
Invalid values in terms of overrun ranges of the registers can lead to
strange issues in the OS.
Change-Id: I0a381d445c894eee4f82b50fe86dad22cc587605
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54913
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/rtc.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/rtc.h b/src/include/rtc.h index 0a380745d3..6d562f76b0 100644 --- a/src/include/rtc.h +++ b/src/include/rtc.h @@ -21,5 +21,6 @@ int rtc_get(struct rtc_time *time); int rtc_to_tm(int tim, struct rtc_time *tm); unsigned long rtc_mktime(const struct rtc_time *tm); void rtc_display(const struct rtc_time *tm); +int rtc_invalid(const struct rtc_time *tm); #endif /* _RTC_H_ */ |