Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/jmcneill-audiomp3]: src/sys/dev make audiocs(4) compile. i don't have a...



details:   https://anonhg.NetBSD.org/src/rev/c8d730cdb582
branches:  jmcneill-audiomp3
changeset: 771332:c8d730cdb582
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Nov 20 09:40:19 2011 +0000

description:
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().

diffstat:

 sys/dev/ebus/cs4231_ebus.c |   8 +++++---
 sys/dev/ic/cs4231.c        |  18 +++++++++---------
 sys/dev/ic/cs4231var.h     |   6 +++---
 sys/dev/sbus/cs4231_sbus.c |   5 +++--
 4 files changed, 20 insertions(+), 17 deletions(-)

diffs (154 lines):

diff -r 78d035f4702b -r c8d730cdb582 sys/dev/ebus/cs4231_ebus.c
--- a/sys/dev/ebus/cs4231_ebus.c        Sun Nov 20 09:37:04 2011 +0000
+++ b/sys/dev/ebus/cs4231_ebus.c        Sun Nov 20 09:40:19 2011 +0000
@@ -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 @@
 #include <sys/systm.h>
 #include <sys/errno.h>
 #include <sys/device.h>
+#include <sys/cpu.h>
+#include <sys/kmem.h>
 #include <sys/malloc.h>
-#include <sys/cpu.h>
 
 #include <machine/autoconf.h>
 
@@ -123,6 +124,7 @@
        cs4231_ebus_trigger_input,
        NULL,                   /* dev_ioctl */
        NULL,                   /* powerstate */
+       ad1848_get_locks,
 };
 
 #ifdef AUDIO_DEBUG
diff -r 78d035f4702b -r c8d730cdb582 sys/dev/ic/cs4231.c
--- a/sys/dev/ic/cs4231.c       Sun Nov 20 09:37:04 2011 +0000
+++ b/sys/dev/ic/cs4231.c       Sun Nov 20 09:40:19 2011 +0000
@@ -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 @@
 #include <sys/systm.h>
 #include <sys/errno.h>
 #include <sys/device.h>
+#include <sys/bus.h>
+#include <sys/kmem.h>
 #include <sys/malloc.h>
-#include <sys/bus.h>
 
 #include <machine/autoconf.h>
 #include <sys/cpu.h>
@@ -175,8 +176,7 @@
 }
 
 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 @@
 
        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 @@
 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 @@
                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");
diff -r 78d035f4702b -r c8d730cdb582 sys/dev/ic/cs4231var.h
--- a/sys/dev/ic/cs4231var.h    Sun Nov 20 09:37:04 2011 +0000
+++ b/sys/dev/ic/cs4231var.h    Sun Nov 20 09:40:19 2011 +0000
@@ -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_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_ */
diff -r 78d035f4702b -r c8d730cdb582 sys/dev/sbus/cs4231_sbus.c
--- a/sys/dev/sbus/cs4231_sbus.c        Sun Nov 20 09:37:04 2011 +0000
+++ b/sys/dev/sbus/cs4231_sbus.c        Sun Nov 20 09:40:19 2011 +0000
@@ -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 @@
        cs4231_sbus_trigger_input,
        NULL,                   /* dev_ioctl */
        NULL,                   /* powerstate */
+       ad1848_get_locks,
 };
 
 



Home | Main Index | Thread Index | Old Index