Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/dev split up debug flags so i can turn off ...



details:   https://anonhg.NetBSD.org/src/rev/cfc4d0648f9f
branches:  trunk
changeset: 494518:cfc4d0648f9f
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Jul 07 13:10:34 2000 +0000

description:
split up debug flags so i can turn off some of them

diffstat:

 sys/arch/sparc64/dev/iommu.c |  58 ++++++++++++++++++++++---------------------
 1 files changed, 30 insertions(+), 28 deletions(-)

diffs (236 lines):

diff -r 5f2cd1591715 -r cfc4d0648f9f sys/arch/sparc64/dev/iommu.c
--- a/sys/arch/sparc64/dev/iommu.c      Fri Jul 07 12:59:16 2000 +0000
+++ b/sys/arch/sparc64/dev/iommu.c      Fri Jul 07 13:10:34 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iommu.c,v 1.21 2000/07/07 02:50:21 eeh Exp $   */
+/*     $NetBSD: iommu.c,v 1.22 2000/07/07 13:10:34 mrg Exp $   */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -131,7 +131,9 @@
 #include <machine/cpu.h>
 
 #ifdef DEBUG
-#define IDB_DVMA       0x1
+#define IDB_BUSDMA     0x1
+#define IDB_IOMMU      0x2
+#define IDB_INFO       0x4
 int iommudebug = 0x0;
 #define DPRINTF(l, s)   do { if (iommudebug & l) printf s; } while (0)
 #else
@@ -208,7 +210,7 @@
        bzero(is->is_tsb, size);
 
 #ifdef DEBUG
-       if (iommudebug & IDB_DVMA)
+       if (iommudebug & IDB_INFO)
        {
                /* Probe the iommu */
                struct iommureg *regs = is->is_iommu;
@@ -305,12 +307,12 @@
                                  &is->is_sb->strbuf_pgflush, 0, va);
                iommu_strbuf_flush(is);
        }
-       DPRINTF(IDB_DVMA, ("Clearing TSB slot %d for va %p\n", 
+       DPRINTF(IDB_IOMMU, ("Clearing TSB slot %d for va %p\n", 
                       (int)IOTSBSLOT(va,is->is_tsbsize), va));
        is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)] = tte;
        bus_space_write_8(is->is_bustag, (bus_space_handle_t)(u_long)
                          &is->is_iommu->iommu_flush, 0, va);
-       DPRINTF(IDB_DVMA, ("iommu_enter: va %lx pa %lx TSB[%lx]@%p=%lx\n",
+       DPRINTF(IDB_IOMMU, ("iommu_enter: va %lx pa %lx TSB[%lx]@%p=%lx\n",
                       va, (long)pa, IOTSBSLOT(va,is->is_tsbsize), 
                       &is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)],
                       (long)tte));
@@ -341,14 +343,14 @@
 #endif
 
        va = trunc_page(va);
-       DPRINTF(IDB_DVMA, ("iommu_remove: va %lx TSB[%lx]@%p\n",
+       DPRINTF(IDB_IOMMU, ("iommu_remove: va %lx TSB[%lx]@%p\n",
            va, IOTSBSLOT(va,is->is_tsbsize), 
            &is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)]));
        while (len > 0) {
-               DPRINTF(IDB_DVMA, ("iommu_remove: clearing TSB slot %d for va %p size %lx\n", 
+               DPRINTF(IDB_IOMMU, ("iommu_remove: clearing TSB slot %d for va %p size %lx\n", 
                    (int)IOTSBSLOT(va,is->is_tsbsize), va, (u_long)len));
                if (is->is_sb) {
-                       DPRINTF(IDB_DVMA, ("iommu_remove: flushing va %p TSB[%lx]@%p=%lx, %lu bytes left\n",           
+                       DPRINTF(IDB_IOMMU, ("iommu_remove: flushing va %p TSB[%lx]@%p=%lx, %lu bytes left\n",          
                               (long)va, (long)IOTSBSLOT(va,is->is_tsbsize), 
                               (long)&is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)],
                               (long)(is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)]), 
@@ -357,7 +359,7 @@
                                          &is->is_sb->strbuf_pgflush, 0, va);
                        if (len <= NBPG)
                                iommu_strbuf_flush(is);
-                       DPRINTF(IDB_DVMA, ("iommu_remove: flushed va %p TSB[%lx]@%p=%lx, %lu bytes left\n",            
+                       DPRINTF(IDB_IOMMU, ("iommu_remove: flushed va %p TSB[%lx]@%p=%lx, %lu bytes left\n",           
                               (long)va, (long)IOTSBSLOT(va,is->is_tsbsize), 
                               (long)&is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)],
                               (long)(is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)]), 
@@ -420,7 +422,7 @@
        cur = flushtimeout;
        BUMPTIME(&flushtimeout, 500000); /* 1/2 sec */
        
-       DPRINTF(IDB_DVMA, ("iommu_strbuf_flush: flush = %lx at va = %lx pa = %lx now=%lx:%lx until = %lx:%lx\n", 
+       DPRINTF(IDB_IOMMU, ("iommu_strbuf_flush: flush = %lx at va = %lx pa = %lx now=%lx:%lx until = %lx:%lx\n", 
                       (long)is->is_flush, (long)&is->is_flush, 
                       (long)is->is_flushpa, cur.tv_sec, cur.tv_usec, 
                       flushtimeout.tv_sec, flushtimeout.tv_usec));
@@ -439,7 +441,7 @@
 #endif
        }
 #endif
-       DPRINTF(IDB_DVMA, ("iommu_strbuf_flush: flushed\n"));
+       DPRINTF(IDB_IOMMU, ("iommu_strbuf_flush: flushed\n"));
        return (is->is_flush);
 }
 
@@ -478,7 +480,7 @@
        map->dm_nsegs = 0;
 
        if (buflen > map->_dm_size) {
-               DPRINTF(IDB_DVMA,
+               DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_load(): error %d > %d -- "
                     "map size exceeded!\n", buflen, map->_dm_size));
                return (EINVAL);
@@ -542,7 +544,7 @@
                if (buflen < sgsize)
                        sgsize = buflen;
 
-               DPRINTF(IDB_DVMA,
+               DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_load: map %p loading va %p dva %lx at pa %lx\n",
                    map, (void *)vaddr, (long)dvmaddr, (long)(curaddr&~(NBPG-1))));
                iommu_enter(is, trunc_page(dvmaddr), trunc_page(curaddr),
@@ -574,7 +576,7 @@
        addr = trunc_page(map->dm_segs[0].ds_addr);
        len = map->dm_segs[0].ds_len;
 
-       DPRINTF(IDB_DVMA,
+       DPRINTF(IDB_BUSDMA,
            ("iommu_dvmamap_unload: map %p removing va %lx size %lx\n",
            map, (long)addr, (long)len));
        iommu_remove(is, addr, len);
@@ -596,14 +598,14 @@
 
 
 int
-iommu_dvmamap_load_raw(t, is, map, segs, nsegs, size, flags)
+iommu_dvmamap_load_raw(t, is, map, segs, nsegs, flags, size)
        bus_dma_tag_t t;
        struct iommu_state *is;
        bus_dmamap_t map;
        bus_dma_segment_t *segs;
        int nsegs;
+       int flags;
        bus_size_t size;
-       int flags;
 {
        vm_page_t m;
        int s;
@@ -644,7 +646,7 @@
         */
        if ((boundary = segs[0]._ds_boundary) == 0)
                boundary = map->_dm_boundary;
-       
+
        align = max(segs[0]._ds_align, NBPG);
        s = splhigh();
        err = extent_alloc(is->is_dvmamap, sgsize, align, boundary, 
@@ -680,7 +682,7 @@
                        panic("iommu_dmamap_load_raw: size botch");
                pa = VM_PAGE_TO_PHYS(m);
 
-               DPRINTF(IDB_DVMA,
+               DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_load_raw: map %p loading va %lx at pa %lx\n",
                    map, (long)dvmaddr, (long)(pa)));
                iommu_enter(is, dvmaddr, pa, flags);
@@ -708,20 +710,20 @@
         */
 
        if (ops & BUS_DMASYNC_PREREAD) {
-               DPRINTF(IDB_DVMA,
+               DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_sync: syncing va %p len %lu "
                     "BUS_DMASYNC_PREREAD\n", (long)va, (u_long)len));
 
                /* Nothing to do */;
        }
        if (ops & BUS_DMASYNC_POSTREAD) {
-               DPRINTF(IDB_DVMA,
+               DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_sync: syncing va %p len %lu "
                     "BUS_DMASYNC_POSTREAD\n", (long)va, (u_long)len));
                /* if we have a streaming buffer, flush it here first */
                if (is->is_sb)
                        while (len > 0) {
-                               DPRINTF(IDB_DVMA,
+                               DPRINTF(IDB_BUSDMA,
                                    ("iommu_dvmamap_sync: flushing va %p, %lu "
                                     "bytes left\n", (long)va, (u_long)len));
                                bus_space_write_8(is->is_bustag, 
@@ -736,13 +738,13 @@
                        }
        }
        if (ops & BUS_DMASYNC_PREWRITE) {
-               DPRINTF(IDB_DVMA,
+               DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_sync: syncing va %p len %lu "
                     "BUS_DMASYNC_PREWRITE\n", (long)va, (u_long)len));
                /* Nothing to do */;
        }
        if (ops & BUS_DMASYNC_POSTWRITE) {
-               DPRINTF(IDB_DVMA,
+               DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_sync: syncing va %p len %lu "
                     "BUS_DMASYNC_POSTWRITE\n", (long)va, (u_long)len));
                /* Nothing to do */;
@@ -760,7 +762,7 @@
        int flags;
 {
 
-       DPRINTF(IDB_DVMA, ("iommu_dvmamem_alloc: sz %qx align %qx bound %qx "
+       DPRINTF(IDB_BUSDMA, ("iommu_dvmamem_alloc: sz %qx align %qx bound %qx "
           "segp %p flags %d\n", size, alignment, boundary, segs, flags));
        return (bus_dmamem_alloc(t->_parent, size, alignment, boundary,
            segs, nsegs, rsegs, flags|BUS_DMA_DVMA));
@@ -774,7 +776,7 @@
        int nsegs;
 {
 
-       DPRINTF(IDB_DVMA, ("iommu_dvmamem_free: segp %p nsegs %d\n",
+       DPRINTF(IDB_BUSDMA, ("iommu_dvmamem_free: segp %p nsegs %d\n",
            segs, nsegs));
        bus_dmamem_free(t->_parent, segs, nsegs);
 }
@@ -799,7 +801,7 @@
        struct pglist *mlist;
        int cbit;
 
-       DPRINTF(IDB_DVMA, ("iommu_dvmamem_map: segp %p nsegs %d size %lx\n",
+       DPRINTF(IDB_BUSDMA, ("iommu_dvmamem_map: segp %p nsegs %d size %lx\n",
            segs, nsegs, size));
 
        /*
@@ -832,7 +834,7 @@
                        panic("iommu_dvmamem_map: size botch");
 #endif
                addr = VM_PAGE_TO_PHYS(m);
-               DPRINTF(IDB_DVMA, ("iommu_dvmamem_map: "
+               DPRINTF(IDB_BUSDMA, ("iommu_dvmamem_map: "
                    "mapping va %lx at %qx\n", va, addr | cbit));
                pmap_enter(pmap_kernel(), va, addr | cbit,
                    VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED);
@@ -854,7 +856,7 @@
        size_t size;
 {
        
-       DPRINTF(IDB_DVMA, ("iommu_dvmamem_unmap: kvm %p size %lx\n",
+       DPRINTF(IDB_BUSDMA, ("iommu_dvmamem_unmap: kvm %p size %lx\n",
            kva, size));
            
 #ifdef DIAGNOSTIC



Home | Main Index | Thread Index | Old Index