Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/jmcneill-audiomp3]: src/sys/arch/dreamcast/dev/g2 adapt to audiomp api c...
details: https://anonhg.NetBSD.org/src/rev/dbf1df50b1a7
branches: jmcneill-audiomp3
changeset: 771364:dbf1df50b1a7
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Nov 20 15:00:35 2011 +0000
description:
adapt to audiomp api changes
diffstat:
sys/arch/dreamcast/dev/g2/aica.c | 28 ++++++++++++++++++++++++++--
1 files changed, 26 insertions(+), 2 deletions(-)
diffs (88 lines):
diff -r 64891a137fc1 -r dbf1df50b1a7 sys/arch/dreamcast/dev/g2/aica.c
--- a/sys/arch/dreamcast/dev/g2/aica.c Sun Nov 20 14:27:09 2011 +0000
+++ b/sys/arch/dreamcast/dev/g2/aica.c Sun Nov 20 15:00:35 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aica.c,v 1.21 2011/07/19 15:52:29 dyoung Exp $ */
+/* $NetBSD: aica.c,v 1.21.4.1 2011/11/20 15:00:35 jmcneill Exp $ */
/*
* Copyright (c) 2003 SHIMIZU Ryo <ryo%misakimix.org@localhost>
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aica.c,v 1.21 2011/07/19 15:52:29 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aica.c,v 1.21.4.1 2011/11/20 15:00:35 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -57,6 +57,8 @@
struct aica_softc {
device_t sc_dev; /* base device */
+ kmutex_t sc_lock;
+ kmutex_t sc_intr_lock;
bus_space_tag_t sc_memt;
bus_space_handle_t sc_aica_regh;
bus_space_handle_t sc_aica_memh;
@@ -160,6 +162,7 @@
int aica_query_devinfo(void *, mixer_devinfo_t *);
void aica_encode(int, int, int, int, u_char *, u_short **);
int aica_get_props(void *);
+void aica_get_locks(void *, kmutex_t **, kmutex_t **);
const struct audio_hw_if aica_hw_if = {
aica_open,
@@ -191,6 +194,8 @@
aica_trigger_output,
aica_trigger_input,
NULL, /* aica_dev_ioctl */
+ NULL, /* aica_powerstate */
+ aica_get_locks,
};
int
@@ -217,6 +222,9 @@
sc->sc_dev = self;
sc->sc_memt = ga->ga_memt;
+ mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
+ mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
if (bus_space_map(sc->sc_memt, AICA_REG_ADDR, 0x3000, 0,
&sc->sc_aica_regh) != 0) {
aprint_error(": can't map AICA register space\n");
@@ -597,6 +605,9 @@
struct aica_softc *sc;
sc = arg;
+
+ mutex_spin_enter(&sc->sc_intr_lock);
+
aica_fillbuffer(sc);
/* call audio interrupt handler (audio_pint()) */
@@ -606,6 +617,9 @@
/* clear SPU interrupt */
bus_space_write_4(sc->sc_memt, sc->sc_aica_regh, 0x28bc, 0x20);
+
+ mutex_spin_exit(&sc->sc_intr_lock);
+
return 1;
}
@@ -763,3 +777,13 @@
return 0;
}
+
+void
+aica_get_locks(void *addr, kmutex_t **intr, kmutex_t **thread)
+{
+ struct aica_softc *sc;
+
+ sc = addr;
+ *intr = &sc->sc_intr_lock;
+ *thread = &sc->sc_lock;
+}
Home |
Main Index |
Thread Index |
Old Index