[time] Use currticks() to provide the null system time

For platforms with no real-time clock (such as RISC-V SBI) we use the
null time source, which currently just returns a constant zero.

Switch to using currticks() to provide a clock that does not represent
the real current time, but does at least advance at approximately the
correct rate.  In conjunction with the "ntp" command, this allows
these platforms to use time-dependent features such as X.509
certificate verification for HTTPS connections.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-04-19 13:35:23 +01:00
parent 423cdbeb39
commit 453acba7dc
2 changed files with 13 additions and 6 deletions

View File

@@ -15,9 +15,4 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define TIME_PREFIX_null __null_
#endif
static inline __always_inline time_t
TIME_INLINE ( null, time_now ) ( void ) {
return 0;
}
#endif /* _IPXE_NULL_TIME_H */