summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-01-16 06:07:09 +0000
committerache <ache@FreeBSD.org>1996-01-16 06:07:09 +0000
commitad0738fce47baa54c0c44140dae71b46c95ed816 (patch)
tree0c71e03e2bb91d11d0fc6bbd8a3d7b49dfa1a52f /sys/i386
parent2f055e7f0fc16afb4adbda62ae56499debca1500 (diff)
downloadFreeBSD-src-ad0738fce47baa54c0c44140dae71b46c95ed816.zip
FreeBSD-src-ad0738fce47baa54c0c44140dae71b46c95ed816.tar.gz
sleep/wakeup macros was designed to do it on random address in the stack.
This random address can be matched (with some probability) with another sleep addresses from other drivers, which can cause strange sleep/wakeup sequence. Rewrite this ugly code to do the right thing.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/isa/sound/os.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/i386/isa/sound/os.h b/sys/i386/isa/sound/os.h
index ad5b98e..614e5c7 100644
--- a/sys/i386/isa/sound/os.h
+++ b/sys/i386/isa/sound/os.h
@@ -188,16 +188,15 @@ struct snd_wait {
*/
#define DO_SLEEP(q, f, time_limit) \
{ \
- int flag, chn; \
+ int flag; \
f.mode = WK_SLEEP; \
- q = &chn; \
- flag=tsleep((caddr_t) &chn, (PRIBIO-5)|PCATCH, "sndint", time_limit); \
+ flag=tsleep((caddr_t) &q, (PRIBIO-5)|PCATCH, "sndint", time_limit); \
if(flag == ERESTART) f.aborting = 1;\
else f.aborting = 0;\
f.mode &= ~WK_SLEEP; \
}
/* An the following wakes up a process */
-#define WAKE_UP(q, f) {f.mode = WK_WAKEUP;wakeup((caddr_t) q);}
+#define WAKE_UP(q, f) {f.mode = WK_WAKEUP;wakeup((caddr_t) &q);}
/*
* Timing macros. This driver assumes that there is a timer running in the
OpenPOWER on IntegriCloud