summaryrefslogtreecommitdiff
path: root/sys/dev/audio_if.h
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2013-05-15 08:29:27 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2013-05-15 08:29:27 +0000
commite4d6a0a80573196dfd09b1201d79c9b77536c745 (patch)
treee7cc60514c99640b6483947ee3bfb09d9b2d58bb /sys/dev/audio_if.h
parent2af0efdd18ad07b832c93f5c98d654ace8e0524e (diff)
Introduce a global interrupt-aware mutex protecting data
structures (including sound-card registers) from concurent access by syscall and interrupt code-paths. Since critical sections remain the same, calls to splraise/spllower can be safely replaced by calls to mtx_enter/mtx_leave with two exceptions: (1) mutexes are not reentrant (the inner splraise is thus removed), and (2) we're not allowed to sleep with a mutex (either msleep is used or the mutex is released before sleeping). ok and help from kettenis, a lot of work from armani
Diffstat (limited to 'sys/dev/audio_if.h')
-rw-r--r--sys/dev/audio_if.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/audio_if.h b/sys/dev/audio_if.h
index 5557edd3067..e86e754511a 100644
--- a/sys/dev/audio_if.h
+++ b/sys/dev/audio_if.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio_if.h,v 1.27 2010/07/15 03:43:11 jakemsr Exp $ */
+/* $OpenBSD: audio_if.h,v 1.28 2013/05/15 08:29:24 ratchov Exp $ */
/* $NetBSD: audio_if.h,v 1.24 1998/01/10 14:07:25 tv Exp $ */
/*
@@ -38,6 +38,8 @@
#ifndef _SYS_DEV_AUDIO_IF_H_
#define _SYS_DEV_AUDIO_IF_H_
+#include <sys/mutex.h>
+
#define AUDIO_BPS(bits) (bits) <= 8 ? 1 : ((bits) <= 16 ? 2 : 4)
/*
@@ -169,5 +171,7 @@ int audioprint(void *, const char *);
*/
#define AUDIO_MAX_CHANNELS 12
+extern struct mutex audio_lock;
+
#endif /* _SYS_DEV_AUDIO_IF_H_ */