aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/bios
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1998-03-30 09:56:58 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1998-03-30 09:56:58 +0000
commit227ee8a188f0f8da52dabd7c2c13748a2578efce (patch)
tree3bc7a5b892410dae1a4e23ebbc2cb43913cd6195 /sys/i386/bios
parent20344e15827694bd1a50248ac0c415925ed510e6 (diff)
downloadsrc-227ee8a188f0f8da52dabd7c2c13748a2578efce.tar.gz
src-227ee8a188f0f8da52dabd7c2c13748a2578efce.zip
Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
Notes
Notes: svn path=/head/; revision=34961
Diffstat (limited to 'sys/i386/bios')
-rw-r--r--sys/i386/bios/apm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c
index 58e75b8c9c46..204a72fa1928 100644
--- a/sys/i386/bios/apm.c
+++ b/sys/i386/bios/apm.c
@@ -15,7 +15,7 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm.c,v 1.68 1998/01/24 02:54:08 eivind Exp $
+ * $Id: apm.c,v 1.69 1998/02/09 06:08:06 eivind Exp $
*/
#include "opt_devfs.h"
@@ -364,9 +364,14 @@ apm_default_resume(void *arg)
pl = splsoftclock();
inittodr(0); /* adjust time to RTC */
microtime(&resume_time);
- tmp_time = time; /* because 'time' is volatile */
+ getmicrotime(&tmp_time);
timevaladd(&tmp_time, &diff_time);
+
+#ifdef FIXME
+ /* XXX THIS DOESN'T WORK!!! */
time = tmp_time;
+#endif
+
#ifdef APM_FIXUP_CALLTODO
/* Calculate the delta time suspended */
timevalsub(&resume_time, &suspend_time);