Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/dev Ensure i/o commands are allocated on 16-...



details:   https://anonhg.NetBSD.org/src/rev/cbc4f187d645
branches:  trunk
changeset: 573404:cbc4f187d645
user:      briggs <briggs%NetBSD.org@localhost>
date:      Tue Jan 25 19:05:22 2005 +0000

description:
Ensure i/o commands are allocated on 16-byte boundary by allocating 15
extra bytes and adjusting array starts.
Issue pointed out on port-macppc by Michael Lorenz.

Also remove extra print of the device name on attach().

diffstat:

 sys/arch/macppc/dev/snapper.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (48 lines):

diff -r fdaf8177763c -r cbc4f187d645 sys/arch/macppc/dev/snapper.c
--- a/sys/arch/macppc/dev/snapper.c     Tue Jan 25 17:22:08 2005 +0000
+++ b/sys/arch/macppc/dev/snapper.c     Tue Jan 25 19:05:22 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: snapper.c,v 1.4 2005/01/15 15:19:51 kent Exp $ */
+/*     $NetBSD: snapper.c,v 1.5 2005/01/25 19:05:22 briggs Exp $       */
 /*     Id: snapper.c,v 1.11 2002/10/31 17:42:13 tsubai Exp     */
 
 /*-
@@ -77,8 +77,9 @@
 
        dbdma_regmap_t *sc_odma;
        dbdma_regmap_t *sc_idma;
-       struct dbdma_command sc_odmacmd[20];
-       struct dbdma_command sc_idmacmd[20];
+       unsigned char   dbdma_cmdspace[sizeof(struct dbdma_command) * 40 + 15];
+       struct dbdma_command *sc_odmacmd;
+       struct dbdma_command *sc_idmacmd;
 };
 
 int snapper_match(struct device *, struct cfdata *, void *);
@@ -315,11 +316,17 @@
 {
        struct snapper_softc *sc;
        struct confargs *ca;
+       unsigned long v;
        int cirq, oirq, iirq, cirq_type, oirq_type, iirq_type;
        int soundbus, intr[6];
 
        sc = (struct snapper_softc *)self;
        ca = aux;
+
+       v = (((unsigned long) &sc->dbdma_cmdspace[0]) + 0xf) & ~0xf;
+       sc->sc_odmacmd = (struct dbdma_command *) v;
+       sc->sc_idmacmd = sc->sc_odmacmd + 20;
+
 #ifdef DIAGNOSTIC
        if ((vaddr_t)sc->sc_odmacmd & 0x0f) {
                printf(": bad dbdma alignment\n");
@@ -349,7 +356,7 @@
        intr_establish(oirq, oirq_type, IPL_AUDIO, snapper_intr, sc);
        /* intr_establish(iirq, iirq_type, IPL_AUDIO, snapper_intr, sc); */
 
-       printf("%s: irq %d,%d,%d\n", sc->sc_dev.dv_xname, cirq, oirq, iirq);
+       printf(": irq %d,%d,%d\n", cirq, oirq, iirq);
 
        config_interrupts(self, snapper_defer);
 }



Home | Main Index | Thread Index | Old Index