Module Name: src
Committed By: mrg
Date: Sun Nov 20 09:40:20 UTC 2011
Modified Files:
src/sys/dev/ebus [jmcneill-audiomp3]: cs4231_ebus.c
src/sys/dev/ic [jmcneill-audiomp3]: cs4231.c cs4231var.h
src/sys/dev/sbus [jmcneill-audiomp3]: cs4231_sbus.c
Log Message:
make audiocs(4) compile. i don't have anything handy to actually test
this easily, but this was just updating the alloc/free to kmem and
hooking into ad1848_get_locks().
To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.4.1 src/sys/dev/ebus/cs4231_ebus.c
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/dev/ic/cs4231.c
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/dev/ic/cs4231var.h
cvs rdiff -u -r1.48 -r1.48.4.1 src/sys/dev/sbus/cs4231_sbus.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ebus/cs4231_ebus.c
diff -u src/sys/dev/ebus/cs4231_ebus.c:1.34 src/sys/dev/ebus/cs4231_ebus.c:1.34.4.1
--- src/sys/dev/ebus/cs4231_ebus.c:1.34 Thu Jun 2 00:23:28 2011
+++ src/sys/dev/ebus/cs4231_ebus.c Sun Nov 20 09:40:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231_ebus.c,v 1.34 2011/06/02 00:23:28 christos Exp $ */
+/* $NetBSD: cs4231_ebus.c,v 1.34.4.1 2011/11/20 09:40:19 mrg Exp $ */
/*
* Copyright (c) 2002 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.c,v 1.34 2011/06/02 00:23:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.c,v 1.34.4.1 2011/11/20 09:40:19 mrg Exp $");
#ifdef _KERNEL_OPT
#include "opt_sparc_arch.h"
@@ -38,8 +38,9 @@ __KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/device.h>
-#include <sys/malloc.h>
#include <sys/cpu.h>
+#include <sys/kmem.h>
+#include <sys/malloc.h>
#include <machine/autoconf.h>
@@ -123,6 +124,7 @@ const struct audio_hw_if audiocs_ebus_hw
cs4231_ebus_trigger_input,
NULL, /* dev_ioctl */
NULL, /* powerstate */
+ ad1848_get_locks,
};
#ifdef AUDIO_DEBUG
Index: src/sys/dev/ic/cs4231.c
diff -u src/sys/dev/ic/cs4231.c:1.26 src/sys/dev/ic/cs4231.c:1.26.4.1
--- src/sys/dev/ic/cs4231.c:1.26 Thu Jun 2 00:23:28 2011
+++ src/sys/dev/ic/cs4231.c Sun Nov 20 09:40:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231.c,v 1.26 2011/06/02 00:23:28 christos Exp $ */
+/* $NetBSD: cs4231.c,v 1.26.4.1 2011/11/20 09:40:19 mrg Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.26 2011/06/02 00:23:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.26.4.1 2011/11/20 09:40:19 mrg Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -39,8 +39,9 @@ __KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/device.h>
-#include <sys/malloc.h>
#include <sys/bus.h>
+#include <sys/kmem.h>
+#include <sys/malloc.h>
#include <machine/autoconf.h>
#include <sys/cpu.h>
@@ -175,8 +176,7 @@ cs4231_common_attach(struct cs4231_softc
}
void *
-cs4231_malloc(void *addr, int direction, size_t size,
- struct malloc_type *pool, int flags)
+cs4231_malloc(void *addr, int direction, size_t size)
{
struct cs4231_softc *sc;
bus_dma_tag_t dmatag;
@@ -184,7 +184,7 @@ cs4231_malloc(void *addr, int direction,
sc = addr;
dmatag = sc->sc_dmatag;
- p = malloc(sizeof(*p), pool, flags);
+ p = kmem_alloc(sizeof(*p), KM_SLEEP);
if (p == NULL)
return NULL;
@@ -221,12 +221,12 @@ fail3:
fail2:
bus_dmamap_destroy(dmatag, p->dmamap);
fail1:
- free(p, pool);
+ kmem_free(p, size);
return NULL;
}
void
-cs4231_free(void *addr, void *ptr, struct malloc_type *pool)
+cs4231_free(void *addr, void *ptr, size_t size)
{
struct cs4231_softc *sc;
bus_dma_tag_t dmatag;
@@ -242,7 +242,7 @@ cs4231_free(void *addr, void *ptr, struc
bus_dmamem_free(dmatag, p->segs, p->nsegs);
bus_dmamap_destroy(dmatag, p->dmamap);
*pp = p->next;
- free(p, pool);
+ kmem_free(p, size);
return;
}
printf("cs4231_free: rogue pointer\n");
Index: src/sys/dev/ic/cs4231var.h
diff -u src/sys/dev/ic/cs4231var.h:1.9 src/sys/dev/ic/cs4231var.h:1.9.4.1
--- src/sys/dev/ic/cs4231var.h:1.9 Thu Jun 2 00:23:28 2011
+++ src/sys/dev/ic/cs4231var.h Sun Nov 20 09:40:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231var.h,v 1.9 2011/06/02 00:23:28 christos Exp $ */
+/* $NetBSD: cs4231var.h,v 1.9.4.1 2011/11/20 09:40:19 mrg Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@ int cs4231_get_port(void *, mixer_ctrl_t
int cs4231_query_devinfo(void *, mixer_devinfo_t *);
int cs4231_get_props(void *);
-void *cs4231_malloc(void *, int, size_t, struct malloc_type *, int);
-void cs4231_free(void *, void *, struct malloc_type *);
+void *cs4231_malloc(void *, int, size_t);
+void cs4231_free(void *, void *, size_t);
#endif /* _DEV_IC_CS4231VAR_H_ */
Index: src/sys/dev/sbus/cs4231_sbus.c
diff -u src/sys/dev/sbus/cs4231_sbus.c:1.48 src/sys/dev/sbus/cs4231_sbus.c:1.48.4.1
--- src/sys/dev/sbus/cs4231_sbus.c:1.48 Thu Jun 2 00:23:28 2011
+++ src/sys/dev/sbus/cs4231_sbus.c Sun Nov 20 09:40:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231_sbus.c,v 1.48 2011/06/02 00:23:28 christos Exp $ */
+/* $NetBSD: cs4231_sbus.c,v 1.48.4.1 2011/11/20 09:40:19 mrg Exp $ */
/*-
* Copyright (c) 1998, 1999, 2002, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4231_sbus.c,v 1.48 2011/06/02 00:23:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4231_sbus.c,v 1.48.4.1 2011/11/20 09:40:19 mrg Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -125,6 +125,7 @@ const struct audio_hw_if audiocs_sbus_hw
cs4231_sbus_trigger_input,
NULL, /* dev_ioctl */
NULL, /* powerstate */
+ ad1848_get_locks,
};