diff --git a/src/core/null_time.c b/src/core/null_time.c index 90041a456..15d8a57a5 100644 --- a/src/core/null_time.c +++ b/src/core/null_time.c @@ -30,5 +30,17 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); */ #include +#include -PROVIDE_TIME_INLINE ( null, time_now ); +/** + * Get current time in seconds + * + * @ret time Time, in seconds + */ +static time_t null_now ( void ) { + + /* Provide a non-absolute timer bassed on currticks() */ + return ( currticks() / TICKS_PER_SEC ); +} + +PROVIDE_TIME ( null, time_now, null_now ); diff --git a/src/include/ipxe/null_time.h b/src/include/ipxe/null_time.h index d2b15194b..c670a5fce 100644 --- a/src/include/ipxe/null_time.h +++ b/src/include/ipxe/null_time.h @@ -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 */