Changeset cf85e24c in mainline


Ignore:
Timestamp:
2006-04-22T23:00:26Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
12c7f27
Parents:
e692a27
Message:

printf-related and other code cleanup

Files:
21 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/debugger.c

    re692a27 rcf85e24c  
    232232                        if (*((__native *) breakpoints[slot].address) != 0)
    233233                                return;
    234                         printf("**** Found ZERO on address %P ****\n",
     234                        printf("**** Found ZERO on address %p ****\n",
    235235                               slot, breakpoints[slot].address);
    236236                } else {
    237                         printf("Data watchpoint - new data: %P\n",
     237                        printf("Data watchpoint - new data: %p\n",
    238238                               *((__native *) breakpoints[slot].address));
    239239                }
    240240        }
    241         printf("Reached breakpoint %d:%P(%s)\n", slot, getip(istate),
     241        printf("Reached breakpoint %d:%p(%s)\n", slot, getip(istate),
    242242               get_symtab_entry(getip(istate)));
    243243        printf("***Type 'exit' to exit kconsole.\n");
  • arch/ia32/src/interrupt.c

    re692a27 rcf85e24c  
    6262                printf("----------------EXCEPTION OCCURED----------------\n");
    6363               
    64         printf("%%eip: %#X (%s)\n",istate->eip,symbol);
    65         printf("ERROR_WORD=%#X\n", istate->error_word);
    66         printf("%%cs=%#X,flags=%#X\n", istate->cs, istate->eflags);
    67         printf("%%eax=%#X, %%ecx=%#X, %%edx=%#X, %%esp=%#X\n",  istate->eax,istate->ecx,istate->edx,&istate->stack[0]);
     64        printf("%%eip: %#x (%s)\n",istate->eip,symbol);
     65        printf("ERROR_WORD=%#x\n", istate->error_word);
     66        printf("%%cs=%#x,flags=%#x\n", istate->cs, istate->eflags);
     67        printf("%%eax=%#x, %%ecx=%#x, %%edx=%#x, %%esp=%#x\n",  istate->eax,istate->ecx,istate->edx,&istate->stack[0]);
    6868#ifdef CONFIG_DEBUG_ALLREGS
    69         printf("%%esi=%#X, %%edi=%#X, %%ebp=%#X, %%ebx=%#X\n",  istate->esi,istate->edi,istate->ebp,istate->ebx);
     69        printf("%%esi=%#x, %%edi=%#x, %%ebp=%#x, %%ebx=%#x\n",  istate->esi,istate->edi,istate->ebp,istate->ebx);
    7070#endif
    71         printf("stack: %#X, %#X, %#X, %#X\n", istate->stack[0], istate->stack[1], istate->stack[2], istate->stack[3]);
    72         printf("       %#X, %#X, %#X, %#X\n", istate->stack[4], istate->stack[5], istate->stack[6], istate->stack[7]);
     71        printf("stack: %#x, %#x, %#x, %#x\n", istate->stack[0], istate->stack[1], istate->stack[2], istate->stack[3]);
     72        printf("       %#x, %#x, %#x, %#x\n", istate->stack[4], istate->stack[5], istate->stack[6], istate->stack[7]);
    7373}
    7474
     
    121121        if (!as_page_fault(page)) {
    122122                PRINT_INFO_ERRCODE(istate);
    123                 printf("page fault address: %#X\n", page);
     123                printf("page fault address: %#x\n", page);
    124124                panic("page fault\n");
    125125        }
  • arch/ia32/src/mm/frame.c

    re692a27 rcf85e24c  
    9292                else
    9393                        name = "invalid";
    94                 printf("%P %#llXB %s\n",
     94                printf("%p %#llXB %s\n",
    9595                       (__native) e820table[i].base_address,
    9696                       (__u64) e820table[i].size,
  • arch/ia32/src/smp/mps.c

    re692a27 rcf85e24c  
    188188       
    189189fs_found:
    190         printf("%P: MPS Floating Pointer Structure\n", fs);
     190        printf("%p: MPS Floating Pointer Structure\n", fs);
    191191
    192192        if (fs->config_type == 0 && fs->configuration_table) {
     
    407407                switch (cur[CT_EXT_ENTRY_TYPE]) {
    408408                        default:
    409                                 printf("%P: skipping MP Configuration Table extended entry type %d\n", cur, cur[CT_EXT_ENTRY_TYPE]);
     409                                printf("%p: skipping MP Configuration Table extended entry type %d\n", cur, cur[CT_EXT_ENTRY_TYPE]);
    410410                                break;
    411411                }
  • arch/ia64/src/interrupt.c

    re692a27 rcf85e24c  
    132132        putchar('\n');
    133133        printf("Interrupted context dump:\n");
    134         printf("ar.bsp=%P\tar.bspstore=%P\n", istate->ar_bsp, istate->ar_bspstore);
    135         printf("ar.rnat=%#llX\tar.rsc=%$llX\n", istate->ar_rnat, istate->ar_rsc);
    136         printf("ar.ifs=%#llX\tar.pfs=%#llX\n", istate->ar_ifs, istate->ar_pfs);
    137         printf("cr.isr=%#llX\tcr.ipsr=%#llX\t\n", istate->cr_isr.value, istate->cr_ipsr);
     134        printf("ar.bsp=%p\tar.bspstore=%p\n", istate->ar_bsp, istate->ar_bspstore);
     135        printf("ar.rnat=%#llx\tar.rsc=%$llx\n", istate->ar_rnat, istate->ar_rsc);
     136        printf("ar.ifs=%#llx\tar.pfs=%#llx\n", istate->ar_ifs, istate->ar_pfs);
     137        printf("cr.isr=%#llx\tcr.ipsr=%#llx\t\n", istate->cr_isr.value, istate->cr_ipsr);
    138138       
    139         printf("cr.iip=%#llX, #%d\t(%s)\n", istate->cr_iip, istate->cr_isr.ei ,iip ? iip : "?");
    140         printf("cr.iipa=%#llX\t(%s)\n", istate->cr_iipa, iipa ? iipa : "?");
    141         printf("cr.ifa=%#llX\t(%s)\n", istate->cr_ifa, ifa ? ifa : "?");
     139        printf("cr.iip=%#llx, #%d\t(%s)\n", istate->cr_iip, istate->cr_isr.ei, iip ? iip : "?");
     140        printf("cr.iipa=%#llx\t(%s)\n", istate->cr_iipa, iipa ? iipa : "?");
     141        printf("cr.ifa=%#llx\t(%s)\n", istate->cr_ifa, ifa ? ifa : "?");
    142142}
    143143
     
    183183#else
    184184        dump_interrupted_context(istate);
    185         panic("Interruption: %#hX (%s)\n", (__u16) vector, vector_to_string(vector));
     185        panic("Interruption: %#hx (%s)\n", (__u16) vector, vector_to_string(vector));
    186186#endif
    187187}
     
    218218{
    219219        dump_interrupted_context(istate);
    220         panic("Interruption: %#hX (%s)\n", (__u16) vector, vector_to_string(vector));
     220        panic("Interruption: %#hx (%s)\n", (__u16) vector, vector_to_string(vector));
    221221}
    222222
  • arch/ia64/src/mm/tlb.c

    re692a27 rcf85e24c  
    449449                page_table_unlock(AS, true);
    450450                if (!as_page_fault(va)) {
    451                         panic("%s: va=%P, rid=%d, iip=%P\n", __FUNCTION__, istate->cr_ifa, rr.map.rid, istate->cr_iip);
     451                        panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, istate->cr_ifa, rr.map.rid, istate->cr_iip);
    452452                }
    453453        }
     
    495495                page_table_unlock(AS, true);
    496496                if (!as_page_fault(va)) {
    497                         panic("%s: va=%P, rid=%d, iip=%P\n", __FUNCTION__, va, rid, istate->cr_iip);
     497                        panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
    498498                }
    499499        }
     
    610610                page_table_unlock(AS, true);
    611611                if (!as_page_fault(va)) {
    612                         panic("%s: va=%P, rid=%d\n", __FUNCTION__, va, rr.map.rid);
     612                        panic("%s: va=%p, rid=%d\n", __FUNCTION__, va, rr.map.rid);
    613613                }
    614614        }
  • arch/mips32/src/drivers/arc.c

    re692a27 rcf85e24c  
    136136                switch (configdata->descr[i].type) {
    137137                case CmResourceTypePort:
    138                         printf("Port: %P-size:%d ",
     138                        printf("Port: %p-size:%d ",
    139139                               (__address)configdata->descr[i].u.port.start,
    140140                               configdata->descr[i].u.port.length);
     
    146146                        break;
    147147                case CmResourceTypeMemory:
    148                         printf("Memory: %P-size:%d ",
     148                        printf("Memory: %p-size:%d ",
    149149                               (__address)configdata->descr[i].u.port.start,
    150150                               configdata->descr[i].u.port.length);
     
    213213        desc = arc_entry->getmemorydescriptor(NULL);
    214214        while (desc) {
    215                 printf("%s: %d(%P) (size: %dKB)\n",basetypes[desc->type],
     215                printf("%s: %d(%p) (size: %dKB)\n",basetypes[desc->type],
    216216                       desc->basepage * ARC_FRAME,
    217217                       desc->basepage * ARC_FRAME,
  • arch/mips32/src/exception.c

    re692a27 rcf85e24c  
    7474                rasymbol = s;
    7575       
    76         printf("PC: %#X(%s) RA: %#X(%s), SP(%P)\n",istate->epc,pcsymbol,
    77                istate->ra,rasymbol, istate->sp);
     76        printf("PC: %#x(%s) RA: %#x(%s), SP(%p)\n", istate->epc, pcsymbol, istate->ra, rasymbol, istate->sp);
    7877}
    7978
  • arch/ppc32/src/mm/memory_init.c

    re692a27 rcf85e24c  
    4444       
    4545        for (i = 0; i < bootinfo.memmap.count; i++)
    46                 printf("base: %#X size: %#X\n", bootinfo.memmap.zones[i].start, bootinfo.memmap.zones[i].size);
     46                printf("base: %#x size: %#x\n", bootinfo.memmap.zones[i].start, bootinfo.memmap.zones[i].size);
    4747}
  • arch/ppc64/src/mm/memory_init.c

    re692a27 rcf85e24c  
    4444       
    4545        for (i = 0; i < bootinfo.memmap.count; i++)
    46                 printf("base: %P size: %#X\n", bootinfo.memmap.zones[i].start, bootinfo.memmap.zones[i].size);
     46                printf("base: %p size: %#x\n", bootinfo.memmap.zones[i].start, bootinfo.memmap.zones[i].size);
    4747}
  • arch/sparc64/src/mm/tlb.c

    re692a27 rcf85e24c  
    173173                tpc_str = get_symtab_entry(tpc);
    174174
    175                 printf("Faulting page: %P, ASID=%d\n", tag.vpn * PAGE_SIZE, tag.context);
    176                 printf("TPC=%P, (%s)\n", tpc, tpc_str ? tpc_str : "?");
     175                printf("Faulting page: %p, ASID=%d\n", tag.vpn * PAGE_SIZE, tag.context);
     176                printf("TPC=%p, (%s)\n", tpc, tpc_str ? tpc_str : "?");
    177177                panic("%s\n", __FUNCTION__);
    178178        }
  • generic/include/debug.h

    re692a27 rcf85e24c  
    5050 */
    5151#ifdef CONFIG_DEBUG
    52 #       define ASSERT(expr) if (!(expr)) { panic("assertion failed (%s), caller=%P\n", #expr, CALLER); }
     52#       define ASSERT(expr) if (!(expr)) { panic("assertion failed (%s), caller=%p\n", #expr, CALLER); }
    5353#else
    5454#       define ASSERT(expr)
  • generic/src/adt/btree.c

    re692a27 rcf85e24c  
    118118        if (!lnode) {
    119119                if (btree_search(t, key, &lnode)) {
    120                         panic("B-tree %P already contains key %d\n", t, key);
     120                        panic("B-tree %p already contains key %d\n", t, key);
    121121                }
    122122        }
     
    201201        if (!lnode) {
    202202                if (!btree_search(t, key, &lnode)) {
    203                         panic("B-tree %P does not contain key %d\n", t, key);
     203                        panic("B-tree %p does not contain key %d\n", t, key);
    204204                }
    205205        }
     
    501501                }
    502502        }
    503         panic("node %P does not contain key %d\n", node, key);
     503        panic("node %p does not contain key %d\n", node, key);
    504504}
    505505
     
    528528                }
    529529        }
    530         panic("node %P does not contain key %d\n", node, key);
     530        panic("node %p does not contain key %d\n", node, key);
    531531}
    532532
     
    670670                        return i - (int) (right != false);
    671671        }
    672         panic("node %P does not contain subtree %P\n", node, subtree);
     672        panic("node %p does not contain subtree %p\n", node, subtree);
    673673}
    674674
  • generic/src/main/main.c

    re692a27 rcf85e24c  
    177177
    178178        version_print();
    179         printf("%#zX: hardcoded_ktext_size=%zdK, hardcoded_kdata_size=%zdK\n",
    180                 config.base, hardcoded_ktext_size/1024, hardcoded_kdata_size/1024);
     179        printf("%#zx: hardcoded_ktext_size=%zdK, hardcoded_kdata_size=%zdK\n", config.base, hardcoded_ktext_size / 1024, hardcoded_kdata_size / 1024);
    181180
    182181        arch_pre_smp_init();
     
    197196       
    198197        for (i = 0; i < init.cnt; i++)
    199                 printf("init[%zd].addr=%P, init[%zd].size=%zd\n", i, init.tasks[i].addr, i, init.tasks[i].size);
     198                printf("init[%zd].addr=%p, init[%zd].size=%zd\n", i, init.tasks[i].addr, i, init.tasks[i].size);
    200199       
    201200        ipc_init();
  • generic/src/mm/frame.c

    re692a27 rcf85e24c  
    10291029                zone = zones.info[i];
    10301030                spinlock_lock(&zone->lock);
    1031                 printf("%d: %#X \t%zd\t\t%zd\n",i,PFN2ADDR(zone->base),
    1032                        zone->free_count, zone->busy_count);
     1031                printf("%d: %#x \t%zd\t\t%zd\n", i, PFN2ADDR(zone->base), zone->free_count, zone->busy_count);
    10331032                spinlock_unlock(&zone->lock);
    10341033        }
  • generic/src/mm/page.c

    re692a27 rcf85e24c  
    6464        int i, cnt, length;
    6565
    66         length = size + (s - (s & ~(PAGE_SIZE-1)));
    67         cnt = length/PAGE_SIZE + (length%PAGE_SIZE>0);
     66        length = size + (s - (s & ~(PAGE_SIZE - 1)));
     67        cnt = length / PAGE_SIZE + (length % PAGE_SIZE > 0);
    6868
    6969        for (i = 0; i < cnt; i++)
    70                 page_mapping_insert(AS_KERNEL, s + i*PAGE_SIZE, s + i*PAGE_SIZE, PAGE_NOT_CACHEABLE);
     70                page_mapping_insert(AS_KERNEL, s + i * PAGE_SIZE, s + i * PAGE_SIZE, PAGE_NOT_CACHEABLE);
    7171
    7272}
  • generic/src/proc/scheduler.c

    re692a27 rcf85e24c  
    634634
    635635                spinlock_lock(&cpus[cpu].lock);
    636                 printf("cpu%d: address=%P, nrdy=%ld, needs_relink=%ld\n",
     636                printf("cpu%d: address=%p, nrdy=%ld, needs_relink=%ld\n",
    637637                       cpus[cpu].id, &cpus[cpu], atomic_get(&cpus[cpu].nrdy), cpus[cpu].needs_relink);
    638638               
  • test/mm/falloc1/test.c

    re692a27 rcf85e24c  
    4141
    4242void test(void) {
    43         __address * frames = (__address *) malloc(MAX_FRAMES*sizeof(__address),
    44                                                   0);
     43        __address * frames = (__address *) malloc(MAX_FRAMES*sizeof(__address), 0);
    4544        int results[MAX_ORDER+1];
    4645       
     
    6059                               
    6160                                if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
    62                                         panic("Test failed. Block at address %P (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
     61                                        panic("Test failed. Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
    6362                                }
    6463                               
  • test/mm/falloc2/test.c

    re692a27 rcf85e24c  
    7878                                for (k = 0; k <= ((FRAME_SIZE << order) - 1); k++) {
    7979                                        if (((__u8 *) frames[i])[k] != val) {
    80                                                 printf("Thread #%d (cpu%d): Unexpected data (%d) in block %P offset %#zX\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
     80                                                printf("Thread #%d (cpu%d): Unexpected data (%d) in block %p offset %#zx\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
    8181                                                failed();
    8282                                        }
  • test/mm/mapping1/test.c

    re692a27 rcf85e24c  
    5151        frame1 = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
    5252
    53         printf("Writing %#X to physical address %P.\n", VALUE0, KA2PA(frame0));
     53        printf("Writing %#x to physical address %p.\n", VALUE0, KA2PA(frame0));
    5454        *((__u32 *) frame0) = VALUE0;
    55         printf("Writing %#X to physical address %P.\n", VALUE1, KA2PA(frame1));
     55        printf("Writing %#x to physical address %p.\n", VALUE1, KA2PA(frame1));
    5656        *((__u32 *) frame1) = VALUE1;
    5757       
    58         printf("Mapping virtual address %P to physical address %P.\n", PAGE0, KA2PA(frame0));
     58        printf("Mapping virtual address %p to physical address %p.\n", PAGE0, KA2PA(frame0));
    5959        page_mapping_insert(AS_KERNEL, PAGE0, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE);
    60         printf("Mapping virtual address %P to physical address %P.\n", PAGE1, KA2PA(frame1));   
     60        printf("Mapping virtual address %p to physical address %p.\n", PAGE1, KA2PA(frame1));   
    6161        page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE);
    6262       
    63         printf("Value at virtual address %P is %#X.\n", PAGE0, v0 = *((__u32 *) PAGE0));
    64         printf("Value at virtual address %P is %#X.\n", PAGE1, v1 = *((__u32 *) PAGE1));
     63        printf("Value at virtual address %p is %#x.\n", PAGE0, v0 = *((__u32 *) PAGE0));
     64        printf("Value at virtual address %p is %#x.\n", PAGE1, v1 = *((__u32 *) PAGE1));
    6565       
    6666        ASSERT(v0 == VALUE0);
    6767        ASSERT(v1 == VALUE1);
    6868
    69         printf("Writing %#X to virtual address %P.\n", 0, PAGE0);
     69        printf("Writing %#x to virtual address %p.\n", 0, PAGE0);
    7070        *((__u32 *) PAGE0) = 0;
    71         printf("Writing %#X to virtual address %P.\n", 0, PAGE1);
     71        printf("Writing %#x to virtual address %p.\n", 0, PAGE1);
    7272        *((__u32 *) PAGE1) = 0;
    7373
     
    7575        v1 = *((__u32 *) PAGE1);
    7676       
    77         printf("Value at virtual address %P is %#X.\n", PAGE0, *((__u32 *) PAGE0));     
    78         printf("Value at virtual address %P is %#X.\n", PAGE1, *((__u32 *) PAGE1));
     77        printf("Value at virtual address %p is %#x.\n", PAGE0, *((__u32 *) PAGE0));     
     78        printf("Value at virtual address %p is %#x.\n", PAGE1, *((__u32 *) PAGE1));
    7979
    8080        ASSERT(v0 == 0);
  • test/synch/rwlock4/test.c

    re692a27 rcf85e24c  
    133133               
    134134                context_save(&ctx);
    135                 printf("sp=%#X, readers_in=%d\n", ctx.sp, rwlock.readers_in);
     135                printf("sp=%#x, readers_in=%d\n", ctx.sp, rwlock.readers_in);
    136136               
    137137                k = random(7) + 1;
Note: See TracChangeset for help on using the changeset viewer.