Source-Changes-HG archive

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

[src/trunk]: src/sys/arch fix warnings in DEBUG & DIAGNSTIC code.



details:   https://anonhg.NetBSD.org/src/rev/7043e33b9e9c
branches:  trunk
changeset: 500125:7043e33b9e9c
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Dec 06 01:47:49 2000 +0000

description:
fix warnings in DEBUG & DIAGNSTIC code.

diffstat:

 sys/arch/sparc/fpu/fpu.c                 |    4 +-
 sys/arch/sparc64/dev/iommu.c             |   72 ++++++-----
 sys/arch/sparc64/dev/sbus.c              |    4 +-
 sys/arch/sparc64/sparc64/cache.c         |    8 +-
 sys/arch/sparc64/sparc64/machdep.c       |   26 ++-
 sys/arch/sparc64/sparc64/pmap.c          |  103 +++++++++--------
 sys/arch/sparc64/sparc64/sunos_machdep.c |    8 +-
 sys/arch/sparc64/sparc64/svr4_machdep.c  |    8 +-
 sys/arch/sparc64/sparc64/trap.c          |  182 +++++++++++++++++-------------
 9 files changed, 228 insertions(+), 187 deletions(-)

diffs (truncated from 1318 to 300 lines):

diff -r a9273afddc28 -r 7043e33b9e9c sys/arch/sparc/fpu/fpu.c
--- a/sys/arch/sparc/fpu/fpu.c  Tue Dec 05 22:18:30 2000 +0000
+++ b/sys/arch/sparc/fpu/fpu.c  Wed Dec 06 01:47:49 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.c,v 1.10 2000/08/16 11:36:36 pk Exp $ */
+/*     $NetBSD: fpu.c,v 1.11 2000/12/06 01:47:50 mrg Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -195,7 +195,7 @@
                case NOTFPU:
 #ifdef SUN4U
 #ifdef DEBUG
-                       printf("fpu_cleanup: not an FPU error -- sending SIGILL\n", p);
+                       printf("fpu_cleanup: not an FPU error -- sending SIGILL\n");
                        Debugger();
 #endif
 #endif /* SUN4U */
diff -r a9273afddc28 -r 7043e33b9e9c sys/arch/sparc64/dev/iommu.c
--- a/sys/arch/sparc64/dev/iommu.c      Tue Dec 05 22:18:30 2000 +0000
+++ b/sys/arch/sparc64/dev/iommu.c      Wed Dec 06 01:47:49 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iommu.c,v 1.24 2000/09/28 15:28:43 eeh Exp $   */
+/*     $NetBSD: iommu.c,v 1.25 2000/12/06 01:47:49 mrg Exp $   */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -215,10 +215,12 @@
                /* Probe the iommu */
                struct iommureg *regs = is->is_iommu;
 
-               printf("iommu regs at: cr=%lx tsb=%lx flush=%lx\n", &regs->iommu_cr,
-                      &regs->iommu_tsb, &regs->iommu_flush);
-               printf("iommu cr=%qx tsb=%qx\n", regs->iommu_cr, regs->iommu_tsb);
-               printf("TSB base %p phys %qx\n", (void *)is->is_tsb, (u_int64_t)is->is_ptsb);
+               printf("iommu regs at: cr=%lx tsb=%lx flush=%lx\n",
+                   (u_long)&regs->iommu_cr,
+                   (u_long)&regs->iommu_tsb,
+                   (u_long)&regs->iommu_flush);
+               printf("iommu cr=%llx tsb=%llx\n", (unsigned long long)regs->iommu_cr, (unsigned long long)regs->iommu_tsb);
+               printf("TSB base %p phys %llx\n", (void *)is->is_tsb, (unsigned long long)is->is_ptsb);
                delay(1000000); /* 1 s */
        }
 #endif
@@ -308,14 +310,14 @@
                iommu_strbuf_flush(is);
        }
        DPRINTF(IDB_IOMMU, ("Clearing TSB slot %d for va %p\n", 
-                      (int)IOTSBSLOT(va,is->is_tsbsize), va));
+                      (int)IOTSBSLOT(va,is->is_tsbsize), (void *)(u_long)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_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));
+                      va, (long)pa, (u_long)IOTSBSLOT(va,is->is_tsbsize), 
+                      (void *)(u_long)&is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)],
+                      (u_long)tte));
 }
 
 /*
@@ -334,25 +336,25 @@
 
 #ifdef DIAGNOSTIC
        if (va < is->is_dvmabase)
-               panic("iommu_remove: va 0x%lx not in DVMA space", (long)va);
+               panic("iommu_remove: va 0x%lx not in DVMA space", (u_long)va);
        if ((long)(va + len) < (long)va)
                panic("iommu_remove: va 0x%lx + len 0x%lx wraps", 
                      (long) va, (long) len);
        if (len & ~0xfffffff) 
-               panic("iommu_remove: rediculous len 0x%lx", (long)len);
+               panic("iommu_remove: rediculous len 0x%lx", (u_long)len);
 #endif
 
        va = trunc_page(va);
        DPRINTF(IDB_IOMMU, ("iommu_remove: va %lx TSB[%lx]@%p\n",
-           va, IOTSBSLOT(va,is->is_tsbsize), 
+           va, (u_long)IOTSBSLOT(va,is->is_tsbsize), 
            &is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)]));
        while (len > 0) {
                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));
+                   (int)IOTSBSLOT(va,is->is_tsbsize), (void *)(u_long)va, (u_long)len));
                if (is->is_sb) {
                        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)],
+                              (void *)(u_long)va, (long)IOTSBSLOT(va,is->is_tsbsize), 
+                              (void *)(u_long)&is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)],
                               (long)(is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)]), 
                               (u_long)len));
                        bus_space_write_8(is->is_bustag, (bus_space_handle_t)(u_long)
@@ -360,8 +362,8 @@
                        if (len <= NBPG)
                                iommu_strbuf_flush(is);
                        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)],
+                              (void *)(u_long)va, (long)IOTSBSLOT(va,is->is_tsbsize), 
+                              (void *)(u_long)&is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)],
                               (long)(is->is_tsb[IOTSBSLOT(va,is->is_tsbsize)]), 
                               (u_long)len));
                } else
@@ -434,8 +436,9 @@
 
 #ifdef DIAGNOSTIC
        if (!is->is_flush) {
-               printf("iommu_strbuf_flush: flush timeout %p at %p\n", (long)is->is_flush, 
-                      (long)is->is_flushpa); /* panic? */
+               printf("iommu_strbuf_flush: flush timeout %p at %p\n",
+                   (void *)(u_long)is->is_flush, 
+                   (void *)(u_long)is->is_flushpa); /* panic? */
 #ifdef DDB
                Debugger();
 #endif
@@ -482,7 +485,7 @@
        if (buflen > map->_dm_size) {
                DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_load(): error %d > %d -- "
-                    "map size exceeded!\n", buflen, map->_dm_size));
+                    "map size exceeded!\n", (int)buflen, (int)map->_dm_size));
                return (EINVAL);
        }
 
@@ -504,7 +507,7 @@
        if (err || (dvmaddr == (bus_addr_t)-1)) 
        { 
                printf("iommu_dvmamap_load(): extent_alloc(%d, %x) failed!\n",
-                   sgsize, flags);
+                   (int)sgsize, flags);
                Debugger();
        }               
 #endif 
@@ -635,10 +638,13 @@
        if (segs[0].ds_addr != 0)
                panic("iommu_dvmamap_load_raw: segment already loaded: "
                        "addr %#llx, size %#llx",
-                       (u_int64_t)segs[0].ds_addr, (u_int64_t)segs[0].ds_len);
+                       (unsigned long long)segs[0].ds_addr,
+                       (unsigned long long)segs[0].ds_len);
        if (segs[0].ds_len != size)
                panic("iommu_dvmamap_load_raw: segment size changed: "
-                       "ds_len %#llx size %#llx", segs[0].ds_len, size);
+                       "ds_len %#llx size %#llx",
+                       (unsigned long long)segs[0].ds_len,
+                       (unsigned long long)size);
 #endif
        sgsize = round_page(size);
 
@@ -663,7 +669,7 @@
        if (dvmaddr == (bus_addr_t)-1)  
        { 
                printf("iommu_dvmamap_load_raw(): extent_alloc(%d, %x) failed!\n",
-                   sgsize, flags);
+                   (int)sgsize, flags);
                Debugger();
        }               
 #endif 
@@ -714,20 +720,20 @@
        if (ops & BUS_DMASYNC_PREREAD) {
                DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_sync: syncing va %p len %lu "
-                    "BUS_DMASYNC_PREREAD\n", (long)va, (u_long)len));
+                    "BUS_DMASYNC_PREREAD\n", (void *)(u_long)va, (u_long)len));
 
                /* Nothing to do */;
        }
        if (ops & BUS_DMASYNC_POSTREAD) {
                DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_sync: syncing va %p len %lu "
-                    "BUS_DMASYNC_POSTREAD\n", (long)va, (u_long)len));
+                    "BUS_DMASYNC_POSTREAD\n", (void *)(u_long)va, (u_long)len));
                /* if we have a streaming buffer, flush it here first */
                if (is->is_sb)
                        while (len > 0) {
                                DPRINTF(IDB_BUSDMA,
                                    ("iommu_dvmamap_sync: flushing va %p, %lu "
-                                    "bytes left\n", (long)va, (u_long)len));
+                                    "bytes left\n", (void *)(u_long)va, (u_long)len));
                                bus_space_write_8(is->is_bustag, 
                                                  (bus_space_handle_t)(u_long)
                                                  &is->is_sb->strbuf_pgflush, 0, va);
@@ -742,13 +748,13 @@
        if (ops & BUS_DMASYNC_PREWRITE) {
                DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_sync: syncing va %p len %lu "
-                    "BUS_DMASYNC_PREWRITE\n", (long)va, (u_long)len));
+                    "BUS_DMASYNC_PREWRITE\n", (void *)(u_long)va, (u_long)len));
                /* Nothing to do */;
        }
        if (ops & BUS_DMASYNC_POSTWRITE) {
                DPRINTF(IDB_BUSDMA,
                    ("iommu_dvmamap_sync: syncing va %p len %lu "
-                    "BUS_DMASYNC_POSTWRITE\n", (long)va, (u_long)len));
+                    "BUS_DMASYNC_POSTWRITE\n", (void *)(u_long)va, (u_long)len));
                /* Nothing to do */;
        }
 }
@@ -764,8 +770,10 @@
        int flags;
 {
 
-       DPRINTF(IDB_BUSDMA, ("iommu_dvmamem_alloc: sz %qx align %qx bound %qx "
-          "segp %p flags %d\n", size, alignment, boundary, segs, flags));
+       DPRINTF(IDB_BUSDMA, ("iommu_dvmamem_alloc: sz %llx align %llx bound %llx "
+          "segp %p flags %d\n", (unsigned long long)size,
+          (unsigned long long)alignment, (unsigned long long)boundary,
+          segs, flags));
        return (bus_dmamem_alloc(t->_parent, size, alignment, boundary,
            segs, nsegs, rsegs, flags|BUS_DMA_DVMA));
 }
@@ -837,7 +845,7 @@
 #endif
                addr = VM_PAGE_TO_PHYS(m);
                DPRINTF(IDB_BUSDMA, ("iommu_dvmamem_map: "
-                   "mapping va %lx at %qx\n", va, addr | cbit));
+                   "mapping va %lx at %llx\n", va, (unsigned long long)addr | cbit));
                pmap_enter(pmap_kernel(), va, addr | cbit,
                    VM_PROT_READ | VM_PROT_WRITE,
                    VM_PROT_READ | VM_PROT_WRITE | PMAP_WIRED);
diff -r a9273afddc28 -r 7043e33b9e9c sys/arch/sparc64/dev/sbus.c
--- a/sys/arch/sparc64/dev/sbus.c       Tue Dec 05 22:18:30 2000 +0000
+++ b/sys/arch/sparc64/dev/sbus.c       Wed Dec 06 01:47:49 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbus.c,v 1.38 2000/12/04 20:19:49 fvdl Exp $ */
+/*     $NetBSD: sbus.c,v 1.39 2000/12/06 01:47:49 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -646,7 +646,7 @@
                vec = INTVEC(vec);
                DPRINTF(SDB_INTR,
                    ("\nsbus: intr[%ld]%lx: %lx\nHunting for IRQ...\n",
-                   (long)ipl, (long)vec, intrlev[vec]));
+                   (long)ipl, (long)vec, (u_long)intrlev[vec]));
                if ((vec & INTMAP_OBIO) == 0) {
                        /* We're in an SBUS slot */
                        /* Register the map and clear intr registers */
diff -r a9273afddc28 -r 7043e33b9e9c sys/arch/sparc64/sparc64/cache.c
--- a/sys/arch/sparc64/sparc64/cache.c  Tue Dec 05 22:18:30 2000 +0000
+++ b/sys/arch/sparc64/sparc64/cache.c  Wed Dec 06 01:47:49 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cache.c,v 1.4 2000/12/04 20:40:07 fvdl Exp $ */
+/*     $NetBSD: cache.c,v 1.5 2000/12/06 01:47:50 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -102,9 +102,9 @@
 
 #ifdef DEBUG
        if (cachedebug)
-               printf("cache_flush_page %llx\n", pa);
+               printf("cache_flush_page %llx\n", (unsigned long long)pa);
        if (pa & PGOFSET)
-               panic("cache_flush_page: asked to flush misaligned pa %llx", pa);
+               panic("cache_flush_page: asked to flush misaligned pa %llx", (unsigned long long)pa);
 #endif
 
        /* Don't flush if not enabled or not probed. */
@@ -148,7 +148,7 @@
 
 #ifdef DEBUG
        if (cachedebug)
-               printf("cache_flush %p %x\n", base, len);
+               printf("cache_flush %p %x\n", (void *)(u_long)base, (u_int)len);
 #endif
 
        /* Don't flush if not enabled or not probed. */
diff -r a9273afddc28 -r 7043e33b9e9c sys/arch/sparc64/sparc64/machdep.c
--- a/sys/arch/sparc64/sparc64/machdep.c        Tue Dec 05 22:18:30 2000 +0000
+++ b/sys/arch/sparc64/sparc64/machdep.c        Wed Dec 06 01:47:49 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.93 2000/12/04 20:12:10 fvdl Exp $ */
+/*     $NetBSD: machdep.c,v 1.94 2000/12/06 01:47:50 mrg Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -595,7 +595,8 @@
 #ifdef DEBUG
        if ((sigdebug & SDB_KSTACK))
            printf("sendsig: saving sf to %p, setting stack pointer %p to %p\n",
-                  fp, &(((struct rwindow *)newsp)->rw_in[6]), (vaddr_t)tf->tf_out[6]);
+                  fp, &(((struct rwindow *)newsp)->rw_in[6]),
+                  (void *)(unsigned long)tf->tf_out[6]);
 #endif
        if (rwindow_save(p) || copyout((caddr_t)&sf, (caddr_t)fp, sizeof sf) || 
 #ifdef NOT_DEBUG
@@ -642,7 +643,7 @@
 #ifdef DEBUG
        if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) {
                printf("sendsig: about to return to catcher %p thru %p\n", 
-                      catcher, addr);
+                      catcher, (void *)(unsigned long)addr);
 #ifdef DDB
                if (sigdebug & SDB_DDB) Debugger();
 #endif
@@ -720,7 +721,9 @@



Home | Main Index | Thread Index | Old Index