summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/sound/soundcard.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-03-23 19:27:52 +0000
committerache <ache@FreeBSD.org>1994-03-23 19:27:52 +0000
commit43f82d2bd1a6c7378e80685320118b8089b06268 (patch)
tree387af0d88c516c4dca3edfcdc3743e967de2fe4b /sys/i386/isa/sound/soundcard.c
parentd377492fa0f3c359340d7e0d573999e302dcf192 (diff)
downloadFreeBSD-src-43f82d2bd1a6c7378e80685320118b8089b06268.zip
FreeBSD-src-43f82d2bd1a6c7378e80685320118b8089b06268.tar.gz
1) GET_TIME function completely broken
it returns time in microseconds instead of HZ (feel difference!) 2) change GET_TIME type to unsigned long in all places to prevent overflow
Diffstat (limited to 'sys/i386/isa/sound/soundcard.c')
-rw-r--r--sys/i386/isa/sound/soundcard.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c
index 3448f32..36b5a1e 100644
--- a/sys/i386/isa/sound/soundcard.c
+++ b/sys/i386/isa/sound/soundcard.c
@@ -67,12 +67,18 @@ int sndwrite (int dev, struct uio *uio);
int sndselect (int dev, int rw);
static void sound_mem_init(void);
+unsigned
long
get_time()
{
extern struct timeval time;
+struct timeval timecopy;
+int x = splclock();
- return(time.tv_usec + (time.tv_sec*1000000));
+ timecopy = time;
+ splx(x);
+ return ((unsigned long)timecopy.tv_usec*HZ)/1000000 +
+ (unsigned long)timecopy.tv_sec*HZ;
}
OpenPOWER on IntegriCloud