Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Split device_t/softc of am7930. No crash on TME and GXe...
details: https://anonhg.NetBSD.org/src/rev/9c9df3cd1cd0
branches: trunk
changeset: 765723:9c9df3cd1cd0
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sat Jun 04 01:27:57 2011 +0000
description:
Split device_t/softc of am7930. No crash on TME and GXemul.
diffstat:
sys/arch/sparc/dev/audioamd.c | 15 +++++++++------
sys/dev/ic/am7930var.h | 4 ++--
sys/dev/tc/bba.c | 17 +++++++++--------
3 files changed, 20 insertions(+), 16 deletions(-)
diffs (165 lines):
diff -r 3746653d35e4 -r 9c9df3cd1cd0 sys/arch/sparc/dev/audioamd.c
--- a/sys/arch/sparc/dev/audioamd.c Fri Jun 03 21:10:42 2011 +0000
+++ b/sys/arch/sparc/dev/audioamd.c Sat Jun 04 01:27:57 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audioamd.c,v 1.25 2009/12/19 10:34:18 tsutsui Exp $ */
+/* $NetBSD: audioamd.c,v 1.26 2011/06/04 01:27:57 tsutsui Exp $ */
/* NetBSD: am7930_sparc.c,v 1.44 1999/03/14 22:29:00 jonathan Exp */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audioamd.c,v 1.25 2009/12/19 10:34:18 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audioamd.c,v 1.26 2011/06/04 01:27:57 tsutsui Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -108,13 +108,13 @@
void audioamd_sbus_attach(device_t, device_t, void *);
void audioamd_attach(struct audioamd_softc *, int);
-CFATTACH_DECL(audioamd_mainbus, sizeof(struct audioamd_softc),
+CFATTACH_DECL_NEW(audioamd_mainbus, sizeof(struct audioamd_softc),
audioamd_mainbus_match, audioamd_mainbus_attach, NULL, NULL);
-CFATTACH_DECL(audioamd_obio, sizeof(struct audioamd_softc),
+CFATTACH_DECL_NEW(audioamd_obio, sizeof(struct audioamd_softc),
audioamd_obio_match, audioamd_obio_attach, NULL, NULL);
-CFATTACH_DECL(audioamd_sbus, sizeof(struct audioamd_softc),
+CFATTACH_DECL_NEW(audioamd_sbus, sizeof(struct audioamd_softc),
audioamd_sbus_match, audioamd_sbus_attach, NULL, NULL);
/*
@@ -227,6 +227,7 @@
ma = aux;
sc = device_private(self);
+ sc->sc_am7930.sc_dev = self;
sc->sc_bt = ma->ma_bustag;
if (bus_space_map(
@@ -253,6 +254,7 @@
uoba = aux;
sa = &uoba->uoba_sbus;
sc = device_private(self);
+ sc->sc_am7930.sc_dev = self;
sc->sc_bt = sa->sa_bustag;
if (sbus_bus_map(sa->sa_bustag,
@@ -275,6 +277,7 @@
sa = aux;
sc = device_private(self);
+ sc->sc_am7930.sc_dev = self;
sc->sc_bt = sa->sa_bustag;
if (sbus_bus_map(sa->sa_bustag,
@@ -296,7 +299,7 @@
/*
* Set up glue for MI code early; we use some of it here.
*/
- self = &sc->sc_am7930.sc_dev;
+ self = sc->sc_am7930.sc_dev;
sc->sc_am7930.sc_glue = &audioamd_glue;
mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_HIGH);
diff -r 3746653d35e4 -r 9c9df3cd1cd0 sys/dev/ic/am7930var.h
--- a/sys/dev/ic/am7930var.h Fri Jun 03 21:10:42 2011 +0000
+++ b/sys/dev/ic/am7930var.h Sat Jun 04 01:27:57 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: am7930var.h,v 1.11 2005/12/11 12:21:25 christos Exp $ */
+/* $NetBSD: am7930var.h,v 1.12 2011/06/04 01:27:57 tsutsui Exp $ */
struct am7930_softc;
@@ -15,7 +15,7 @@
};
struct am7930_softc {
- struct device sc_dev; /* base device */
+ device_t sc_dev; /* base device */
uint8_t sc_rlevel; /* record level */
uint8_t sc_plevel; /* play level */
diff -r 3746653d35e4 -r 9c9df3cd1cd0 sys/dev/tc/bba.c
--- a/sys/dev/tc/bba.c Fri Jun 03 21:10:42 2011 +0000
+++ b/sys/dev/tc/bba.c Sat Jun 04 01:27:57 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bba.c,v 1.37 2009/08/22 17:38:06 tsutsui Exp $ */
+/* $NetBSD: bba.c,v 1.38 2011/06/04 01:27:57 tsutsui Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
/* maxine/alpha baseboard audio (bba) */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bba.c,v 1.37 2009/08/22 17:38:06 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bba.c,v 1.38 2011/06/04 01:27:57 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -95,7 +95,7 @@
static int bba_match(device_t, cfdata_t, void *);
static void bba_attach(device_t, device_t, void *);
-CFATTACH_DECL(bba, sizeof(struct bba_softc),
+CFATTACH_DECL_NEW(bba, sizeof(struct bba_softc),
bba_match, bba_attach, NULL, NULL);
/*
@@ -214,6 +214,7 @@
ia = aux;
sc = device_private(self);
asc = &sc->sc_am7930;
+ asc->sc_dev = self;
sc->sc_bst = iosc->sc_bst;
sc->sc_bsh = iosc->sc_bsh;
sc->sc_dmat = iosc->sc_dmat;
@@ -221,7 +222,7 @@
/* get the bus space handle for codec */
if (bus_space_subregion(sc->sc_bst, sc->sc_bsh,
ia->iada_offset, 0, &sc->sc_codec_bsh)) {
- aprint_error_dev(&asc->sc_dev, "unable to map device\n");
+ aprint_error_dev(self, "unable to map device\n");
return;
}
@@ -242,7 +243,7 @@
ioasic_intr_establish(parent, ia->iada_cookie, TC_IPL_NONE,
bba_intr, sc);
- audio_attach_mi(&sa_hw_if, asc, &asc->sc_dev);
+ audio_attach_mi(&sa_hw_if, asc, self);
}
@@ -307,14 +308,14 @@
if (bus_dmamem_alloc(sc->sc_dmat, size, BBA_DMABUF_ALIGN,
BBA_DMABUF_BOUNDARY, &seg, 1, &rseg, w)) {
- aprint_error_dev(&asc->sc_dev, "can't allocate DMA buffer\n");
+ aprint_error_dev(asc->sc_dev, "can't allocate DMA buffer\n");
goto bad;
}
state |= 1;
if (bus_dmamem_map(sc->sc_dmat, &seg, rseg, size,
&kva, w | BUS_DMA_COHERENT)) {
- aprint_error_dev(&asc->sc_dev, "can't map DMA buffer\n");
+ aprint_error_dev(asc->sc_dev, "can't map DMA buffer\n");
goto bad;
}
state |= 2;
@@ -518,7 +519,7 @@
DPRINTF(("bba_trigger_input: sc=%p start=%p end=%p blksize=%d intr=%p(%p)\n",
addr, start, end, blksize, intr, arg));
- sc = (struct bba_softc *)addr;
+ sc = addr;
d = &sc->sc_rx_dma_state;
state = 0;
Home |
Main Index |
Thread Index |
Old Index