Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/usermode/usermode Move to dprintf_debug()



details:   https://anonhg.NetBSD.org/src/rev/a0128e9f761c
branches:  trunk
changeset: 769589:a0128e9f761c
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Thu Sep 15 12:25:25 2011 +0000

description:
Move to dprintf_debug()

diffstat:

 sys/arch/usermode/usermode/intr.c |   12 +-
 sys/arch/usermode/usermode/pmap.c |  120 +++++++++++++++++++-------------------
 sys/arch/usermode/usermode/trap.c |    8 +-
 3 files changed, 70 insertions(+), 70 deletions(-)

diffs (truncated from 499 to 300 lines):

diff -r ff50f06e5c26 -r a0128e9f761c sys/arch/usermode/usermode/intr.c
--- a/sys/arch/usermode/usermode/intr.c Thu Sep 15 12:23:51 2011 +0000
+++ b/sys/arch/usermode/usermode/intr.c Thu Sep 15 12:25:25 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.c,v 1.6 2011/09/13 10:38:04 reinoud Exp $ */
+/* $NetBSD: intr.c,v 1.7 2011/09/15 12:25:25 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.6 2011/09/13 10:38:04 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.7 2011/09/15 12:25:25 reinoud Exp $");
 
 #include <sys/types.h>
 
@@ -74,7 +74,7 @@
                return;
        }
 
-       //printf("\nX : %d\n", x);
+       dprintf_debug("spl_intr: queue %d when %d\n", x, usermode_x);
        spli = &spl_intrs[x][spl_intr_wr[x]];
        spli->func = func;
        spli->arg = arg;
@@ -111,17 +111,17 @@
 
        /* `eat' interrupts that came by until we got back to x */
        if (usermode_x > x) {
-restart:
+//restart:
                for (y = usermode_x; y >= x; y--) {
                        while (spl_intr_rd[y] != spl_intr_wr[y]) {
-                               // printf("spl y %d firing\n", y);
+                               dprintf_debug("spl y %d firing\n", y);
                                spli = &spl_intrs[y][spl_intr_rd[y]];
                                if (!spli->func)
                                        panic("%s: spli->func is NULL for ipl %d, rd %d, wr %d\n",
                                                __func__, y, spl_intr_rd[y], spl_intr_wr[y]);
                                spli->func(spli->arg);
                                spl_intr_rd[y] = (spl_intr_rd[y] + 1) % MAX_QUEUED_EVENTS;
-                               goto restart;
+//                             goto restart;
                        }
                }
                usermode_x = x;
diff -r ff50f06e5c26 -r a0128e9f761c sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Thu Sep 15 12:23:51 2011 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Thu Sep 15 12:25:25 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.62 2011/09/14 19:45:27 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.63 2011/09/15 12:25:25 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <reinoud%NetBSD.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.62 2011/09/14 19:45:27 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.63 2011/09/15 12:25:25 reinoud Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -136,13 +136,13 @@
        vm_min_addr = thunk_get_vm_min_address();
        vm_min_addr = vm_min_addr < PAGE_SIZE ? PAGE_SIZE : vm_min_addr;
 
-       aprint_debug("Information retrieved from system and elf image\n");
-       aprint_debug("min VM address      at %p\n", (void *) vm_min_addr);
-       aprint_debug("start kernel        at %p\n", _start);
-       aprint_debug("  end kernel        at %p\n", &etext);
-       aprint_debug("  end of init. data at %p\n", &edata);
-       aprint_debug("1st end of data     at %p\n", &end);
-       aprint_debug("CUR end data        at %p\n", thunk_sbrk(0));
+       dprintf_debug("Information retrieved from system and elf image\n");
+       dprintf_debug("min VM address      at %p\n", (void *) vm_min_addr);
+       dprintf_debug("start kernel        at %p\n", _start);
+       dprintf_debug("  end kernel        at %p\n", &etext);
+       dprintf_debug("  end of init. data at %p\n", &edata);
+       dprintf_debug("1st end of data     at %p\n", &end);
+       dprintf_debug("CUR end data        at %p\n", thunk_sbrk(0));
 
        /* calculate kernel section (R-X) */
        kmem_k_start = (vaddr_t) PAGE_SIZE * (atop(_start)    );
@@ -173,19 +173,19 @@
        kmem_ext_end   = mpos;
 
        /* print summary */
-       aprint_debug("\nMemory summary\n");
-       aprint_debug("\tkmem_k_start\t%p\n",    (void *) kmem_k_start);
-       aprint_debug("\tkmem_k_end\t%p\n",      (void *) kmem_k_end);
-       aprint_debug("\tkmem_ext_start\t%p\n",  (void *) kmem_ext_start);
-       aprint_debug("\tkmem_ext_end\t%p\n",    (void *) kmem_ext_end);
-       aprint_debug("\tkmem_user_start\t%p\n", (void *) kmem_user_start);
-       aprint_debug("\tkmem_user_end\t%p\n",   (void *) kmem_user_end);
+       dprintf_debug("\nMemory summary\n");
+       dprintf_debug("\tkmem_k_start\t%p\n",    (void *) kmem_k_start);
+       dprintf_debug("\tkmem_k_end\t%p\n",      (void *) kmem_k_end);
+       dprintf_debug("\tkmem_ext_start\t%p\n",  (void *) kmem_ext_start);
+       dprintf_debug("\tkmem_ext_end\t%p\n",    (void *) kmem_ext_end);
+       dprintf_debug("\tkmem_user_start\t%p\n", (void *) kmem_user_start);
+       dprintf_debug("\tkmem_user_end\t%p\n",   (void *) kmem_user_end);
 
-       aprint_debug("\ttotmem_len\t%10d\n", (int) totmem_len);
-       aprint_debug("\tkvmsize\t\t%10d\n", (int) KVMSIZE);
-       aprint_debug("\tuser_len\t%10d\n", (int) user_len);
+       dprintf_debug("\ttotmem_len\t%10d\n", (int) totmem_len);
+       dprintf_debug("\tkvmsize\t\t%10d\n", (int) KVMSIZE);
+       dprintf_debug("\tuser_len\t%10d\n", (int) user_len);
 
-       aprint_debug("\n\n");
+       dprintf_debug("\n\n");
 
 #if 1
        /* protect user memory UVM area (---) */
@@ -209,7 +209,7 @@
                        "failed (%p)\n", (void *)addr);
 #endif
 
-       aprint_debug("Creating memory mapped backend\n");
+       dprintf_debug("Creating memory mapped backend\n");
 
        /* create memory file since mmap/maccess only can be on files */
        strlcpy(mem_name, "/tmp/netbsd.XXXXXX", sizeof(mem_name));
@@ -265,7 +265,7 @@
        phys_npages = (free_end - free_start) / PAGE_SIZE;
        pv_table_size = round_page(phys_npages * sizeof(struct pv_entry));
 
-       aprint_debug("claiming %"PRIu64" KB of pv_table for "
+       dprintf_debug("claiming %"PRIu64" KB of pv_table for "
                "%"PRIdPTR" pages of physical memory\n",
                (uint64_t) pv_table_size/1024, (uintptr_t) phys_npages);
 
@@ -281,7 +281,7 @@
 
        memset(pv_table, 0, pv_table_size);     /* test and clear */
 
-       aprint_debug("pv_table initialiased correctly, mmap works\n");
+       dprintf_debug("pv_table initialiased correctly, mmap works\n");
 
        /* advance */
        kmem_ext_cur_start += pv_table_size;
@@ -290,7 +290,7 @@
        /* set up kernel pmap */
        pm_nentries = (VM_MAX_ADDRESS - VM_MIN_ADDRESS) / PAGE_SIZE;
        pm_entries_size = round_page(pm_nentries * sizeof(struct pv_entry *));
-       aprint_debug("pmap va->pa lookup table is %"PRIu64" KB for %d logical pages\n",
+       dprintf_debug("pmap va->pa lookup table is %"PRIu64" KB for %d logical pages\n",
                pm_entries_size/1024, pm_nentries);
 
         pmap = pmap_kernel(); 
@@ -309,7 +309,7 @@
 
        memset(pmap->pm_entries, 0, pm_entries_size);   /* test and clear */
 
-       aprint_debug("kernel pmap entries initialiased correctly\n");
+       dprintf_debug("kernel pmap entries initialiased correctly\n");
 
        /* advance */
        kmem_ext_cur_start += pm_entries_size;
@@ -324,13 +324,13 @@
                va = (vaddr_t) pv_table + pg;
                pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE, 0);
        }
-       aprint_debug("pv_table mem added to the kernel pmap\n");
+       dprintf_debug("pv_table mem added to the kernel pmap\n");
        for (pg = 0; pg < pm_entries_size; pg += PAGE_SIZE) {
                pa = pm_fpos + pg;
                va = (vaddr_t) pmap->pm_entries + pg;
                pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE, 0);
        }
-       aprint_debug("kernel pmap entries mem added to the kernel pmap\n");
+       dprintf_debug("kernel pmap entries mem added to the kernel pmap\n");
 
        /* add file space to uvm's FREELIST */
        /* XXX really from 0? or from fpos to have better stats */
@@ -340,10 +340,10 @@
            atop(free_end), 
            VM_FREELIST_DEFAULT);
 
-       aprint_debug("leaving pmap_bootstrap:\n");
-       aprint_debug("\t%"PRIu64" MB of physical pages left\n",
+       dprintf_debug("leaving pmap_bootstrap:\n");
+       dprintf_debug("\t%"PRIu64" MB of physical pages left\n",
                (uint64_t) (free_end - (free_start + fpos))/1024/1024);
-       aprint_debug("\t%"PRIu64" MB of kmem left\n",
+       dprintf_debug("\t%"PRIu64" MB of kmem left\n",
                (uint64_t) (kmem_ext_end - kmem_ext_cur_end)/1024/1024);
 
        setup_signal_handlers();
@@ -384,7 +384,7 @@
                pmap_initialised = 1;
        }
 
-       aprint_debug("pmap_create\n");
+       dprintf_debug("pmap_create\n");
        pmap = pool_get(&pmap_pool, PR_WAITOK);
        memset(pmap, 0, sizeof(*pmap));
                
@@ -393,7 +393,7 @@
        pmap->pm_entries = (struct pv_entry **) malloc(
                pm_entries_size, M_VMPMAP,
                M_WAITOK | M_ZERO);
-       aprint_debug("\tpmap %p\n", pmap);
+       dprintf_debug("\tpmap %p\n", pmap);
 
        return pmap;
 }
@@ -404,7 +404,7 @@
        int i;
 
        /* if multiple references exist just remove a reference */
-       aprint_debug("pmap_destroy %p\n", pmap);
+       dprintf_debug("pmap_destroy %p\n", pmap);
        if (--pmap->pm_count > 0)
                return;
 
@@ -424,7 +424,7 @@
 void
 pmap_reference(pmap_t pmap)
 {
-       aprint_debug("pmap_reference %p\n", (void *) pmap);
+       dprintf_debug("pmap_reference %p\n", (void *) pmap);
        pmap->pm_count++;
 }
 
@@ -470,7 +470,7 @@
                }
        }
        /* Otherwise, allocate a new entry and link it in after the head. */
-       aprint_debug("pv_get: multiple mapped page ppn %"PRIdPTR", "
+       dprintf_debug("pv_get: multiple mapped page ppn %"PRIdPTR", "
                "lpn %"PRIdPTR"\n", ppn, lpn);
 
        /* extra sanity */
@@ -499,7 +499,7 @@
        uintptr_t lpn, ppn;
        int prot, cur_prot, diff;
 
-       aprint_debug("pmap_fault pmap %p, va %p\n", pmap, (void *) va);
+       dprintf_debug("pmap_fault pmap %p, va %p\n", pmap, (void *) va);
 
        /* get logical page from vaddr */
        lpn = atop(va - VM_MIN_ADDRESS);        /* V->L */
@@ -507,7 +507,7 @@
 
        /* not known! then it must be UVM's work */
        if (pv == NULL) {
-               aprint_debug("%s: no mapping yet\n", __func__);
+               dprintf_debug("%s: no mapping yet\n", __func__);
                *atype = VM_PROT_READ;          /* assume it was a read */
                return false;
        }
@@ -528,7 +528,7 @@
        /* if its not mapped in, we have a TBL fault */
        if ((pv->pv_vflags & PV_MAPPEDIN) == 0) {
                if (pv->pv_mmap_ppl != THUNK_PROT_NONE) {
-                       aprint_debug("%s: tlb fault page lpn %"PRIiPTR"\n",
+                       dprintf_debug("%s: tlb fault page lpn %"PRIiPTR"\n",
                                __func__, pv->pv_lpn);
                        pmap_page_activate(pv);
                        return true;
@@ -547,7 +547,7 @@
 
        diff = prot & (prot ^ cur_prot);
 
-       aprint_debug("%s: prot = %d, cur_prot = %d, diff = %d\n",
+       dprintf_debug("%s: prot = %d, cur_prot = %d, diff = %d\n",
                __func__, prot, cur_prot, diff);
        *atype = VM_PROT_READ;  /* assume its a read error */
        if (diff & VM_PROT_READ) {
@@ -603,7 +603,7 @@
        addr = thunk_mmap((void *) va, PAGE_SIZE, pv->pv_mmap_ppl,
                THUNK_MAP_FILE | THUNK_MAP_FIXED | THUNK_MAP_SHARED,
                mem_fh, pa);
-       aprint_debug("page_activate: (va %p, pa %p, ppl %d) -> %p\n",
+       dprintf_debug("page_activate: (va %p, pa %p, ppl %d) -> %p\n",
                (void *) va, (void *) pa, pv->pv_mmap_ppl, (void *) addr);
        if (addr != (void *) va)
                panic("pmap_page_activate: mmap failed (expected %p got %p): %d",
@@ -624,7 +624,7 @@
        addr = thunk_mmap((void *) va, PAGE_SIZE, THUNK_PROT_NONE,
                THUNK_MAP_FILE | THUNK_MAP_FIXED | THUNK_MAP_SHARED,
                mem_fh, pa);
-       aprint_debug("page_deactivate: (va %p, pa %p, ppl %d) -> %p\n",
+       dprintf_debug("page_deactivate: (va %p, pa %p, ppl %d) -> %p\n",
                (void *) va, (void *) pa, pv->pv_mmap_ppl, (void *) addr);
        if (addr != (void *) va)
                panic("pmap_page_deactivate: mmap failed");
@@ -672,7 +672,7 @@
        struct pv_entry *pv;
 
        for (pv = &pv_table[ppn]; pv != NULL; pv = pv->pv_next) {
-               aprint_debug("pmap_update_page: ppn %"PRIdPTR", pv->pv_map = %p\n",
+               dprintf_debug("pmap_update_page: ppn %"PRIdPTR", pv->pv_map = %p\n",
                        ppn, pv->pv_pmap);
                if (pv->pv_pmap != NULL) {



Home | Main Index | Thread Index | Old Index