Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm Use %p, %#xl etc. for pointers and addresses.



details:   https://anonhg.NetBSD.org/src/rev/b007c49fe4aa
branches:  trunk
changeset: 809153:b007c49fe4aa
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Jun 22 06:24:17 2015 +0000

description:
Use %p, %#xl etc. for pointers and addresses.

diffstat:

 sys/uvm/uvm_fault.c |  22 ++++++------
 sys/uvm/uvm_map.c   |  88 +++++++++++++++++++++++++++-------------------------
 2 files changed, 57 insertions(+), 53 deletions(-)

diffs (truncated from 444 to 300 lines):

diff -r e8d7d9aca222 -r b007c49fe4aa sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c       Mon Jun 22 06:06:02 2015 +0000
+++ b/sys/uvm/uvm_fault.c       Mon Jun 22 06:24:17 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_fault.c,v 1.196 2014/08/10 16:44:37 tls Exp $      */
+/*     $NetBSD: uvm_fault.c,v 1.197 2015/06/22 06:24:17 matt Exp $     */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.196 2014/08/10 16:44:37 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.197 2015/06/22 06:24:17 matt Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -806,7 +806,7 @@
 
        UVMHIST_FUNC("uvm_fault"); UVMHIST_CALLED(maphist);
 
-       UVMHIST_LOG(maphist, "(map=0x%x, vaddr=0x%x, at=%d, ff=%d)",
+       UVMHIST_LOG(maphist, "(map=%p, vaddr=%#lx, at=%d, ff=%d)",
              orig_map, vaddr, access_type, fault_flag);
 
        cd = &(curcpu()->ci_data);
@@ -947,7 +947,7 @@
            ufi->entry->max_protection : ufi->entry->protection;
        if ((check_prot & flt->access_type) != flt->access_type) {
                UVMHIST_LOG(maphist,
-                   "<- protection failure (prot=0x%x, access=0x%x)",
+                   "<- protection failure (prot=%#x, access=%#x)",
                    ufi->entry->protection, flt->access_type, 0, 0);
                uvmfault_unlockmaps(ufi, false);
                return EACCES;
@@ -1060,9 +1060,9 @@
        const voff_t eoff = flt->startva - ufi->entry->start;
 
        /* locked: maps(read) */
-       UVMHIST_LOG(maphist, "  narrow=%d, back=%d, forw=%d, startva=0x%x",
+       UVMHIST_LOG(maphist, "  narrow=%d, back=%d, forw=%d, startva=%#lx",
                    flt->narrow, nback, nforw, flt->startva);
-       UVMHIST_LOG(maphist, "  entry=0x%x, amap=0x%x, obj=0x%x", ufi->entry,
+       UVMHIST_LOG(maphist, "  entry=%p, amap=%p, obj=%p", ufi->entry,
                    amap, uobj, 0);
 
        /*
@@ -1229,7 +1229,7 @@
        uvm_pageenqueue(pg);
        mutex_exit(&uvm_pageqlock);
        UVMHIST_LOG(maphist,
-           "  MAPPING: n anon: pm=0x%x, va=0x%x, pg=0x%x",
+           "  MAPPING: n anon: pm=%p, va=%#lx, pg=%p",
            ufi->orig_map->pmap, currva, pg, 0);
        uvmexp.fltnamap++;
 
@@ -1276,7 +1276,7 @@
         * handle case 1: fault on an anon in our amap
         */
 
-       UVMHIST_LOG(maphist, "  case 1 fault: anon=0x%x", anon, 0,0,0);
+       UVMHIST_LOG(maphist, "  case 1 fault: anon=%p", anon, 0,0,0);
 
        /*
         * no matter if we have case 1A or case 1B we are going to need to
@@ -1506,7 +1506,7 @@
         */
 
        UVMHIST_LOG(maphist,
-           "  MAPPING: anon: pm=0x%x, va=0x%x, pg=0x%x, promote=%d",
+           "  MAPPING: anon: pm=%p, va=%#lx, pg=%p, promote=%d",
            ufi->orig_map->pmap, ufi->orig_rvaddr, pg, flt->promote);
        if (pmap_enter(ufi->orig_map->pmap, ufi->orig_rvaddr,
            VM_PAGE_TO_PHYS(pg),
@@ -1803,7 +1803,7 @@
        uvm_pageenqueue(pg);
        mutex_exit(&uvm_pageqlock);
        UVMHIST_LOG(maphist,
-           "  MAPPING: n obj: pm=0x%x, va=0x%x, pg=0x%x",
+           "  MAPPING: n obj: pm=%p, va=%#lx, pg=%p",
            ufi->orig_map->pmap, currva, pg, 0);
        uvmexp.fltnomap++;
 
@@ -2186,7 +2186,7 @@
         */
 
        UVMHIST_LOG(maphist,
-           "  MAPPING: case2: pm=0x%x, va=0x%x, pg=0x%x, promote=%d",
+           "  MAPPING: case2: pm=%p, va=%#lx, pg=%#x, promote=%d",
            ufi->orig_map->pmap, ufi->orig_rvaddr, pg, flt->promote);
        KASSERT((flt->access_type & VM_PROT_WRITE) == 0 ||
                (pg->flags & PG_RDONLY) == 0);
diff -r e8d7d9aca222 -r b007c49fe4aa sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Mon Jun 22 06:06:02 2015 +0000
+++ b/sys/uvm/uvm_map.c Mon Jun 22 06:24:17 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_map.c,v 1.333 2015/02/01 16:26:00 christos Exp $   */
+/*     $NetBSD: uvm_map.c,v 1.334 2015/06/22 06:24:17 matt Exp $       */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.333 2015/02/01 16:26:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.334 2015/06/22 06:24:17 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -538,7 +538,7 @@
 
        for (tmp = map->header.next; tmp != &map->header; tmp = tmp->next) {
                if (tmp->gap != uvm_rb_gap(tmp)) {
-                       printf("%d/%d gap %lx != %lx %s\n",
+                       printf("%d/%d gap %#lx != %#lx %s\n",
                            n + 1, map->nentries,
                            (ulong)tmp->gap, (ulong)uvm_rb_gap(tmp),
                            tmp->next == &map->header ? "(last)" : "");
@@ -563,7 +563,7 @@
        trtmp = NULL;
        for (tmp = map->header.next; tmp != &map->header; tmp = tmp->next) {
                if (tmp->maxgap != uvm_rb_maxgap(tmp)) {
-                       printf("maxgap %lx != %lx\n",
+                       printf("maxgap %#lx != %#lx\n",
                            (ulong)tmp->maxgap,
                            (ulong)uvm_rb_maxgap(tmp));
                        goto error;
@@ -763,7 +763,7 @@
        }
        me->flags = 0;
 
-       UVMHIST_LOG(maphist, "<- new entry=0x%x [kentry=%d]", me,
+       UVMHIST_LOG(maphist, "<- new entry=%p [kentry=%d]", me,
            (map == kernel_map), 0, 0);
        return me;
 }
@@ -777,7 +777,7 @@
 {
        UVMHIST_FUNC("uvm_mapent_free"); UVMHIST_CALLED(maphist);
 
-       UVMHIST_LOG(maphist,"<- freeing map entry=0x%x [flags=%d]",
+       UVMHIST_LOG(maphist,"<- freeing map entry=%p [flags=%d]",
                me, me->flags, 0, 0);
        pool_cache_put(&uvm_map_entry_cache, me);
 }
@@ -1105,9 +1105,9 @@
        UVMHIST_FUNC("uvm_map_prepare");
        UVMHIST_CALLED(maphist);
 
-       UVMHIST_LOG(maphist, "(map=0x%x, start=0x%x, size=%d, flags=0x%x)",
+       UVMHIST_LOG(maphist, "(map=%p, start=%#lx, size=%lu, flags=%#x)",
            map, start, size, flags);
-       UVMHIST_LOG(maphist, "  uobj/offset 0x%x/%d", uobj, uoffset,0,0);
+       UVMHIST_LOG(maphist, "  uobj/offset %p/%ld", uobj, uoffset,0,0);
 
        /*
         * detect a popular device driver bug.
@@ -1129,7 +1129,7 @@
         */
 
        if ((prot & maxprot) != prot) {
-               UVMHIST_LOG(maphist, "<- prot. failure:  prot=0x%x, max=0x%x",
+               UVMHIST_LOG(maphist, "<- prot. failure:  prot=%#x, max=%#x",
                prot, maxprot,0,0);
                return EACCES;
        }
@@ -1150,7 +1150,7 @@
                unsigned int timestamp;
 
                timestamp = map->timestamp;
-               UVMHIST_LOG(maphist,"waiting va timestamp=0x%x",
+               UVMHIST_LOG(maphist,"waiting va timestamp=%#x",
                            timestamp,0,0,0);
                map->flags |= VM_MAP_WANTVA;
                vm_map_unlock(map);
@@ -1259,9 +1259,9 @@
        UVMHIST_FUNC("uvm_map_enter");
        UVMHIST_CALLED(maphist);
 
-       UVMHIST_LOG(maphist, "(map=0x%x, start=0x%x, size=%d, flags=0x%x)",
+       UVMHIST_LOG(maphist, "(map=%p, start=%#lx, size=%lu, flags=%#x)",
            map, start, size, flags);
-       UVMHIST_LOG(maphist, "  uobj/offset 0x%x/%d", uobj, uoffset,0,0);
+       UVMHIST_LOG(maphist, "  uobj/offset %p/%ld", uobj, uoffset,0,0);
 
        KASSERT(map->hint == prev_entry); /* bimerge case assumes this */
        KASSERT(vm_map_locked_p(map));
@@ -1609,7 +1609,7 @@
        UVMHIST_FUNC("uvm_map_lookup_entry");
        UVMHIST_CALLED(maphist);
 
-       UVMHIST_LOG(maphist,"(map=0x%x,addr=0x%x,ent=0x%x)",
+       UVMHIST_LOG(maphist,"(map=%p,addr=%#lx,ent=%p)",
            map, address, entry, 0);
 
        /*
@@ -1640,7 +1640,7 @@
                if (cur != &map->header && cur->end > address) {
                        UVMMAP_EVCNT_INCR(mlk_hint);
                        *entry = cur;
-                       UVMHIST_LOG(maphist,"<- got it via hint (0x%x)",
+                       UVMHIST_LOG(maphist,"<- got it via hint (%p)",
                            cur, 0, 0, 0);
                        uvm_mapent_check(*entry);
                        return (true);
@@ -1688,7 +1688,7 @@
                                *entry = cur;
 got:
                                SAVE_HINT(map, map->hint, *entry);
-                               UVMHIST_LOG(maphist,"<- search got it (0x%x)",
+                               UVMHIST_LOG(maphist,"<- search got it (%p)",
                                        cur, 0, 0, 0);
                                KDASSERT((*entry)->start <= address);
                                KDASSERT(address < (*entry)->end);
@@ -1803,7 +1803,7 @@
        UVMHIST_FUNC("uvm_map_findspace");
        UVMHIST_CALLED(maphist);
 
-       UVMHIST_LOG(maphist, "(map=0x%x, hint=0x%x, len=%d, flags=0x%x)",
+       UVMHIST_LOG(maphist, "(map=%p, hint=%l#x, len=%lu, flags=%#x)",
            map, hint, length, flags);
        KASSERT((flags & UVM_FLAG_COLORMATCH) != 0 || (align & (align - 1)) == 0);
        KASSERT((flags & UVM_FLAG_COLORMATCH) == 0 || align < uvmexp.ncolors);
@@ -1826,7 +1826,7 @@
                hint = vm_map_min(map);
        }
        if (hint > vm_map_max(map)) {
-               UVMHIST_LOG(maphist,"<- VA 0x%x > range [0x%x->0x%x]",
+               UVMHIST_LOG(maphist,"<- VA %#lx > range [%#lx->%#lx]",
                    hint, vm_map_min(map), vm_map_max(map), 0);
                return (NULL);
        }
@@ -2101,7 +2101,7 @@
  found:
        SAVE_HINT(map, map->hint, entry);
        *result = hint;
-       UVMHIST_LOG(maphist,"<- got it!  (result=0x%x)", hint, 0,0,0);
+       UVMHIST_LOG(maphist,"<- got it!  (result=%#lx)", hint, 0,0,0);
        KASSERT( topdown || hint >= orig_hint);
        KASSERT(!topdown || hint <= orig_hint);
        KASSERT(entry->end <= hint);
@@ -2140,7 +2140,7 @@
        vaddr_t len;
        UVMHIST_FUNC("uvm_unmap_remove"); UVMHIST_CALLED(maphist);
 
-       UVMHIST_LOG(maphist,"(map=0x%x, start=0x%x, end=0x%x)",
+       UVMHIST_LOG(maphist,"(map=%p, start=%#lx, end=%#lx)",
            map, start, end, 0);
        VM_MAP_RANGE_CHECK(map, start, end);
 
@@ -2264,7 +2264,7 @@
                 * that we've nuked.  then go to next entry.
                 */
 
-               UVMHIST_LOG(maphist, "  removed map entry 0x%x", entry, 0, 0,0);
+               UVMHIST_LOG(maphist, "  removed map entry %p", entry, 0, 0,0);
 
                /* critical!  prevents stale hint */
                SAVE_HINT(map, entry, entry->prev);
@@ -2321,7 +2321,7 @@
        while (first_entry) {
                KASSERT(!VM_MAPENT_ISWIRED(first_entry));
                UVMHIST_LOG(maphist,
-                   "  detach 0x%x: amap=0x%x, obj=0x%x, submap?=%d",
+                   "  detach %p: amap=%p, obj=%p, submap?=%d",
                    first_entry, first_entry->aref.ar_amap,
                    first_entry->object.uvm_obj,
                    UVM_ET_ISSUBMAP(first_entry));
@@ -2373,7 +2373,7 @@
 {
        UVMHIST_FUNC("uvm_map_reserve"); UVMHIST_CALLED(maphist);
 
-       UVMHIST_LOG(maphist, "(map=0x%x, size=0x%x, offset=0x%x,addr=0x%x)",
+       UVMHIST_LOG(maphist, "(map=%p, size=%#lx, offset=%#lx, addr=%p)",
            map,size,offset,raddr);
 
        size = round_page(size);
@@ -2389,7 +2389,7 @@
                return (false);
        }
 
-       UVMHIST_LOG(maphist, "<- done (*raddr=0x%x)", *raddr,0,0,0);
+       UVMHIST_LOG(maphist, "<- done (*raddr=%#lx)", *raddr,0,0,0);
        return (true);
 }
 
@@ -2452,9 +2452,9 @@
                                panic("uvm_map_replace1");
                        if (tmpent->start >= tmpent->end || tmpent->end > end) {
                                panic("uvm_map_replace2: "
-                                   "tmpent->start=0x%"PRIxVADDR
-                                   ", tmpent->end=0x%"PRIxVADDR
-                                   ", end=0x%"PRIxVADDR,
+                                   "tmpent->start=%#"PRIxVADDR
+                                   ", tmpent->end=%#"PRIxVADDR
+                                   ", end=%#"PRIxVADDR,
                                    tmpent->start, tmpent->end, end);
                        }



Home | Main Index | Thread Index | Old Index