diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-24 19:35:28 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-24 19:35:28 +0000 |
commit | c6cc17e855e1d9fe177fba41d00de6e89fdc852e (patch) | |
tree | bdc6bde04c820ca59fe49d60185cf6ac40b44e30 /sys/compat/osf1 | |
parent | 128dd71ffeec48b94e085c757b3626553d619e7c (diff) |
This moves access to wall and uptime variables in MI code,
encapsulating all such access into wall-defined functions
that makes sure locking is done as needed.
It also cleans up some uses of wall time vs. uptime some
places, but there is sure to be more of these needed as
well, particularily in MD code. Also, many current calls
to microtime() should probably be changed to getmicrotime(),
or to the {,get}microuptime() versions.
ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others
"Oh, that is not your problem!" from miod@
Diffstat (limited to 'sys/compat/osf1')
-rw-r--r-- | sys/compat/osf1/osf1_misc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/compat/osf1/osf1_misc.c b/sys/compat/osf1/osf1_misc.c index 3c94c5b17d7..8f0311dc841 100644 --- a/sys/compat/osf1/osf1_misc.c +++ b/sys/compat/osf1/osf1_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: osf1_misc.c,v 1.15 2004/06/22 23:52:18 jfb Exp $ */ +/* $OpenBSD: osf1_misc.c,v 1.16 2004/06/24 19:35:23 tholo Exp $ */ /* $NetBSD: osf1_misc.c,v 1.55 2000/06/28 15:39:33 mrg Exp $ */ /* @@ -277,7 +277,7 @@ osf1_sys_usleep_thread(p, v, retval) struct osf1_timeval otv, endotv; struct timeval tv, endtv; u_long ticks; - int error, s; + int error; if ((error = copyin(SCARG(uap, sleep), &otv, sizeof otv))) return (error); @@ -288,16 +288,16 @@ osf1_sys_usleep_thread(p, v, retval) if (ticks == 0) ticks = 1; - s = splclock(); - tv = time; - splx(s); + getmicrotime(&tv); tsleep(p, PUSER|PCATCH, "uslpthrd", ticks); /* XXX */ if (SCARG(uap, slept) != NULL) { - s = splclock(); - timersub(&time, &tv, &endtv); - splx(s); + struct timval tv2; + + getmicrotime(&tv2); + timersub(&tv2, &tv, &endtv); + if (endtv.tv_sec < 0 || endtv.tv_usec < 0) endtv.tv_sec = endtv.tv_usec = 0; |