diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-21 23:50:39 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-21 23:50:39 +0000 |
commit | ee05a750df8c3f9f5d686affb4df7e316507797a (patch) | |
tree | 887af571215b85d480946bb169aafa0605c786db /sys/kern/kern_clock.c | |
parent | e84c5b85eb5d0fc9af7eb3cdcc77a22eb07dec74 (diff) |
First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.
ok art@ niklas@ nordin@
Diffstat (limited to 'sys/kern/kern_clock.c')
-rw-r--r-- | sys/kern/kern_clock.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 5a3df5ecec4..55a63e0bf61 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clock.c,v 1.44 2004/06/13 21:49:26 niklas Exp $ */ +/* $OpenBSD: kern_clock.c,v 1.45 2004/06/21 23:50:35 tholo Exp $ */ /* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */ /*- @@ -106,6 +106,9 @@ static int tickfixcnt; /* accumulated fractional error */ long cp_time[CPUSTATES]; +volatile time_t time_second; +volatile time_t time_uptime; + volatile struct timeval time __attribute__((__aligned__(__alignof__(quad_t)))); volatile struct timeval mono_time; @@ -234,6 +237,8 @@ hardclock(struct clockframe *frame) BUMPTIME(&time, delta); BUMPTIME(&mono_time, delta); + time_second = time.tv_sec; + time_uptime = mono_time.tv_sec; #ifdef CPU_CLOCKUPDATE CPU_CLOCKUPDATE(); |