diff options
author | Michael Brown | 2016-06-13 16:29:05 +0200 |
---|---|---|
committer | Michael Brown | 2016-06-13 16:29:05 +0200 |
commit | e6111c151794c4c15a0988e259666ef5be24ffcc (patch) | |
tree | 6e4febac53299a9ecbf4bff3c0a5dd676de75094 /src/include/time.h | |
parent | [tg3] Add missing memory barrier (diff) | |
download | ipxe-e6111c151794c4c15a0988e259666ef5be24ffcc.tar.gz ipxe-e6111c151794c4c15a0988e259666ef5be24ffcc.tar.xz ipxe-e6111c151794c4c15a0988e259666ef5be24ffcc.zip |
[time] Allow system clock to be adjusted at runtime
Provide a mechanism to allow an arbitrary adjustment to be applied to
all subsequent calls to time().
Note that the underlying clock source (e.g. the RTC clock) will not be
changed; only the time as reported within iPXE will be affected.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/time.h')
-rw-r--r-- | src/include/time.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/time.h b/src/include/time.h index 462ac699..ab93a3db 100644 --- a/src/include/time.h +++ b/src/include/time.h @@ -39,10 +39,10 @@ struct tm { * @v t Time to fill in, or NULL * @ret time Current time */ -static inline time_t time ( time_t *t ) { +static inline __attribute__ (( always_inline )) time_t time ( time_t *t ) { time_t now; - now = time_now(); + now = ( time_now() + time_offset ); if ( t ) *t = now; return now; |