Changeset 7e752b2 in mainline for kernel


Ignore:
Timestamp:
2010-11-26T01:33:20Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bf61d3a
Parents:
202f57b
Message:
  • correct printf() formatting strings and corresponding arguments
  • minor cstyle changes and other small fixes
Location:
kernel
Files:
53 edited

Legend:

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

    r202f57b r7e752b2  
    230230                                return;
    231231                       
    232                         printf("*** Found ZERO on address %" PRIp " (slot %d) ***\n",
    233                             breakpoints[slot].address, slot);
     232                        printf("*** Found ZERO on address %p (slot %d) ***\n",
     233                            (void *) breakpoints[slot].address, slot);
    234234                } else {
    235                         printf("Data watchpoint - new data: %" PRIp "\n",
     235                        printf("Data watchpoint - new data: %#" PRIxn "\n",
    236236                            *((unative_t *) breakpoints[slot].address));
    237237                }
    238238        }
    239239       
    240         printf("Reached breakpoint %d:%" PRIp " (%s)\n", slot, getip(istate),
    241             symtab_fmt_name_lookup(getip(istate)));
     240        printf("Reached breakpoint %d:%p (%s)\n", slot,
     241            (void *) getip(istate), symtab_fmt_name_lookup(getip(istate)));
    242242       
    243243#ifdef CONFIG_KCONSOLE
     
    363363                       
    364364#ifdef __32_BITS__
    365                         printf("%-4u %7" PRIs " %p %s\n", i,
    366                             breakpoints[i].counter, breakpoints[i].address,
     365                        printf("%-4u %7zu %p %s\n", i,
     366                            breakpoints[i].counter, (void *) breakpoints[i].address,
    367367                            symbol);
    368368#endif
    369369                       
    370370#ifdef __64_BITS__
    371                         printf("%-4u %7" PRIs " %p %s\n", i,
    372                             breakpoints[i].counter, breakpoints[i].address,
     371                        printf("%-4u %7zu %p %s\n", i,
     372                            breakpoints[i].counter, (void *) breakpoints[i].address,
    373373                            symbol);
    374374#endif
     
    405405                flags = BKPOINT_WRITE;
    406406       
    407         printf("Adding breakpoint on address: %p\n", argv->intval);
    408        
    409         int id = breakpoint_add((void *)argv->intval, flags, -1);
     407        printf("Adding breakpoint on address: %p\n",
     408            (void *) argv->intval);
     409       
     410        int id = breakpoint_add((void *) argv->intval, flags, -1);
    410411        if (id < 0)
    411412                printf("Add breakpoint failed.\n");
  • kernel/arch/amd64/src/interrupt.c

    r202f57b r7e752b2  
    6565void istate_decode(istate_t *istate)
    6666{
    67         printf("cs =%p\trip=%p\trfl=%p\terr=%p\n",
    68             istate->cs, istate->rip, istate->rflags, istate->error_word);
    69 
     67        printf("cs =%#0" PRIx64 "\trip=%p\t"
     68            "rfl=%#0" PRIx64 "\terr=%#0" PRIx64 "\n",
     69            istate->cs, (void *) istate->rip,
     70            istate->rflags, istate->error_word);
     71       
    7072        if (istate_from_uspace(istate))
    71                 printf("ss =%p\n", istate->ss);
    72        
    73         printf("rax=%p\trbx=%p\trcx=%p\trdx=%p\n",
     73                printf("ss =%#0" PRIx64 "\n", istate->ss);
     74       
     75        printf("rax=%#0" PRIx64 "\trbx=%#0" PRIx64 "\t"
     76            "rcx=%#0" PRIx64 "\trdx=%#0" PRIx64 "\n",
    7477            istate->rax, istate->rbx, istate->rcx, istate->rdx);
     78       
    7579        printf("rsi=%p\trdi=%p\trbp=%p\trsp=%p\n",
    76             istate->rsi, istate->rdi, istate->rbp,
    77             istate_from_uspace(istate) ? istate->rsp : (uintptr_t)&istate->rsp);
    78         printf("r8 =%p\tr9 =%p\tr10=%p\tr11=%p\n",
     80            (void *) istate->rsi, (void *) istate->rdi,
     81            (void *) istate->rbp,
     82            istate_from_uspace(istate) ? ((void *) istate->rsp) :
     83            &istate->rsp);
     84       
     85        printf("r8 =%#0" PRIx64 "\tr9 =%#0" PRIx64 "\t"
     86            "r10=%#0" PRIx64 "\tr11=%#0" PRIx64 "\n",
    7987            istate->r8, istate->r9, istate->r10, istate->r11);
    80         printf("r12=%p\tr13=%p\tr14=%p\tr15=%p\n",
     88       
     89        printf("r12=%#0" PRIx64 "\tr13=%#0" PRIx64 "\t"
     90            "r14=%#0" PRIx64 "\tr15=%#0" PRIx64 "\n",
    8191            istate->r12, istate->r13, istate->r14, istate->r15);
    8292}
  • kernel/arch/amd64/src/mm/page.c

    r202f57b r7e752b2  
    8989       
    9090        if (as_page_fault(page, access, istate) == AS_PF_FAULT) {
    91                 fault_if_from_uspace(istate, "Page fault: %#x.", page);
     91                fault_if_from_uspace(istate, "Page fault: %p.", (void *) page);
    9292                panic_memtrap(istate, access, page, NULL);
    9393        }
     
    9797{
    9898        if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
    99                 panic("Unable to map physical memory %p (%" PRIs " bytes).", physaddr,
    100                     size);
     99                panic("Unable to map physical memory %p (%zu bytes).",
     100                    (void *) physaddr, size);
    101101       
    102102        uintptr_t virtaddr = PA2KA(last_frame);
  • kernel/arch/arm32/src/exception.c

    r202f57b r7e752b2  
    175175void istate_decode(istate_t *istate)
    176176{
    177         printf("r0 =%#0.8lx\tr1 =%#0.8lx\tr2 =%#0.8lx\tr3 =%#0.8lx\n",
     177        printf("r0 =%#0" PRIx32 "\tr1 =%#0" PRIx32 "\t"
     178            "r2 =%#0" PRIx32 "\tr3 =%#0" PRIx32 "\n",
    178179            istate->r0, istate->r1, istate->r2, istate->r3);
    179         printf("r4 =%#0.8lx\tr5 =%#0.8lx\tr6 =%#0.8lx\tr7 =%#0.8lx\n",
     180        printf("r4 =%#" PRIx32 "\tr5 =%#0" PRIx32 "\t"
     181            "r6 =%#0" PRIx32 "\tr7 =%#0" PRIx32 "\n",
    180182            istate->r4, istate->r5, istate->r6, istate->r7);
    181         printf("r8 =%#0.8lx\tr9 =%#0.8lx\tr10=%#0.8lx\tfp =%#0.8lx\n",
    182             istate->r8, istate->r9, istate->r10, istate->fp);
    183         printf("r12=%#0.8lx\tsp =%#0.8lx\tlr =%#0.8lx\tspsr=%#0.8lx\n",
    184             istate->r12, istate->sp, istate->lr, istate->spsr);
     183        printf("r8 =%#0" PRIx32 "\tr9 =%#0" PRIx32 "\t"
     184            "r10=%#0" PRIx32 "\tfp =%p\n",
     185            istate->r8, istate->r9, istate->r10,
     186            (void *) istate->fp);
     187        printf("r12=%#0" PRIx32 "\tsp =%p\tlr =%p\tspsr=%p\n",
     188            istate->r12, (void *) istate->sp,
     189            (void *) istate->lr, (void *) istate->spsr);
    185190}
    186191
  • kernel/arch/arm32/src/mm/page.c

    r202f57b r7e752b2  
    9393            KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) {
    9494                panic("Unable to map physical memory %p (%d bytes).",
    95                     physaddr, size);
     95                    (void *) physaddr, size);
    9696        }
    9797       
  • kernel/arch/arm32/src/mm/page_fault.c

    r202f57b r7e752b2  
    141141        if (instr.condition == 0xf) {
    142142                panic("page_fault - instruction does not access memory "
    143                     "(instr_code: %x, badvaddr:%x).", instr, badvaddr);
     143                    "(instr_code: %#0" PRIx32 ", badvaddr:%p).",
     144                    instr_union.pc, (void *) badvaddr);
    144145                return PF_ACCESS_EXEC;
    145146        }
     
    160161
    161162        panic("page_fault - instruction doesn't access memory "
    162             "(instr_code: %x, badvaddr:%x).", instr, badvaddr);
     163            "(instr_code: %#0" PRIx32 ", badvaddr:%p).",
     164            instr_union.pc, (void *) badvaddr);
    163165
    164166        return PF_ACCESS_EXEC;
  • kernel/arch/ia32/src/interrupt.c

    r202f57b r7e752b2  
    6565void istate_decode(istate_t *istate)
    6666{
    67         printf("cs =%p\teip=%p\tefl=%p\terr=%p\n",
    68             istate->cs, istate->eip, istate->eflags, istate->error_word);
    69 
    70         printf("ds =%p\tes =%p\tfs =%p\tgs =%p\n",
     67        printf("cs =%#0" PRIx32 "\teip=%p\t"
     68            "efl=%#0" PRIx32 "\terr=%#0" PRIx32 "\n",
     69            istate->cs, (void *) istate->eip,
     70            istate->eflags, istate->error_word);
     71       
     72        printf("ds =%#0" PRIx32 "\tes =%#0" PRIx32 "\t"
     73            "fs =%#0" PRIx32 "\tgs =%#0" PRIx32 "\n",
    7174            istate->ds, istate->es, istate->fs, istate->gs);
     75       
    7276        if (istate_from_uspace(istate))
    73                 printf("ss =%p\n", istate->ss);
    74 
    75         printf("eax=%p\tebx=%p\tecx=%p\tedx=%p\n",
     77                printf("ss =%#0" PRIx32 "\n", istate->ss);
     78       
     79        printf("eax=%#0" PRIx32 "\tebx=%#0" PRIx32 "\t"
     80            "ecx=%#0" PRIx32 "\tedx=%#0" PRIx32 "\n",
    7681            istate->eax, istate->ebx, istate->ecx, istate->edx);
     82       
    7783        printf("esi=%p\tedi=%p\tebp=%p\tesp=%p\n",
    78             istate->esi, istate->edi, istate->ebp,
    79             istate_from_uspace(istate) ? istate->esp : (uintptr_t)&istate->esp);
     84            (void *) istate->esi, (void *) istate->edi,
     85            (void *) istate->ebp,
     86            istate_from_uspace(istate) ? ((void *) istate->esp) :
     87            &istate->esp);
    8088}
    8189
     
    139147        );
    140148       
    141         fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR=%#0.8x.",
    142             (unative_t) mxcsr);
    143         panic_badtrap(istate, n, "SIMD FP exception, MXCSR=%#0.8x");
     149        fault_if_from_uspace(istate, "SIMD FP exception(19), MXCSR=%#0" PRIx32 ".",
     150            mxcsr);
     151        panic_badtrap(istate, n, "SIMD FP exception");
    144152}
    145153
  • kernel/arch/ia32/src/mm/page.c

    r202f57b r7e752b2  
    8282{
    8383        if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
    84                 panic("Unable to map physical memory %p (%d bytes).", physaddr, size);
     84                panic("Unable to map physical memory %p (%zu bytes).",
     85                    (void *) physaddr, size);
    8586       
    8687        uintptr_t virtaddr = PA2KA(last_frame);
  • kernel/arch/ia32/src/smp/apic.c

    r202f57b r7e752b2  
    477477{
    478478#ifdef LAPIC_VERBOSE
    479         printf("LVT on cpu%" PRIs ", LAPIC ID: %" PRIu8 "\n",
     479        printf("LVT on cpu%u, LAPIC ID: %" PRIu8 "\n",
    480480            CPU->id, l_apic_id());
    481481       
  • kernel/arch/ia64/src/interrupt.c

    r202f57b r7e752b2  
    135135void istate_decode(istate_t *istate)
    136136{
    137         printf("ar.bsp=%p\tar.bspstore=%p\n", istate->ar_bsp,
    138             istate->ar_bspstore);
    139         printf("ar.rnat=%#018llx\tar.rsc=%#018llx\n", istate->ar_rnat,
    140             istate->ar_rsc);
    141         printf("ar.ifs=%#018llx\tar.pfs=%#018llx\n", istate->ar_ifs,
    142             istate->ar_pfs);
    143         printf("cr.isr=%#018llx\tcr.ipsr=%#018llx\t\n", istate->cr_isr.value,
    144             istate->cr_ipsr);
    145        
    146         printf("cr.iip=%#018llx, #%d\t(%s)\n", istate->cr_iip, istate->cr_isr.ei,
     137        printf("ar.bsp=%p\tar.bspstore=%p\n",
     138            (void *) istate->ar_bsp, (void *) istate->ar_bspstore);
     139        printf("ar.rnat=%#0" PRIx64 "\tar.rsc=%#0" PRIx64 "\n",
     140            istate->ar_rnat, istate->ar_rsc);
     141        printf("ar.ifs=%#0" PRIx64 "\tar.pfs=%#0" PRIx64 "\n",
     142            istate->ar_ifs, istate->ar_pfs);
     143        printf("cr.isr=%#0" PRIx64 "\tcr.ipsr=%#0" PRIx64 "\n",
     144            istate->cr_isr.value, istate->cr_ipsr.value);
     145       
     146        printf("cr.iip=%#0" PRIx64 ", #%u\t(%s)\n",
     147            istate->cr_iip, istate->cr_isr.ei,
    147148            symtab_fmt_name_lookup(istate->cr_iip));
    148         printf("cr.iipa=%#018llx\t(%s)\n", istate->cr_iipa,
     149        printf("cr.iipa=%#0" PRIx64 "\t(%s)\n", istate->cr_iipa,
    149150            symtab_fmt_name_lookup(istate->cr_iipa));
    150         printf("cr.ifa=%#018llx\t(%s)\n", istate->cr_ifa,
     151        printf("cr.ifa=%#0" PRIx64 "\t(%s)\n", istate->cr_ifa,
    151152            symtab_fmt_name_lookup(istate->cr_ifa));
    152153}
  • kernel/arch/ia64/src/mm/tlb.c

    r202f57b r7e752b2  
    499499                page_table_unlock(AS, true);
    500500                if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) {
    501                         fault_if_from_uspace(istate, "Page fault at %p.", va);
     501                        fault_if_from_uspace(istate, "Page fault at %p.",
     502                            (void *) va);
    502503                        panic_memtrap(istate, PF_ACCESS_EXEC, va, NULL);
    503504                }
     
    556557                        } else {
    557558                                fault_if_from_uspace(istate,
    558                                     "IO access fault at %p.", va);
     559                                    "IO access fault at %p.", (void *) va);
    559560                        }
    560561                }
     
    620621                 */
    621622                if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
    622                         fault_if_from_uspace(istate, "Page fault at %p.", va);
     623                        fault_if_from_uspace(istate, "Page fault at %p.",
     624                            (void *) va);
    623625                        panic_memtrap(istate, PF_ACCESS_UNKNOWN, va, NULL);
    624626                }
     
    668670        } else {
    669671                if (as_page_fault(va, PF_ACCESS_WRITE, istate) == AS_PF_FAULT) {
    670                         fault_if_from_uspace(istate, "Page fault at %p.", va);
     672                        fault_if_from_uspace(istate, "Page fault at %p.",
     673                            (void *) va);
    671674                        panic_memtrap(istate, PF_ACCESS_WRITE, va, NULL);
    672675                }
     
    704707        } else {
    705708                if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) {
    706                         fault_if_from_uspace(istate, "Page fault at %p.", va);
     709                        fault_if_from_uspace(istate, "Page fault at %p.",
     710                            (void *) va);
    707711                        panic_memtrap(istate, PF_ACCESS_EXEC, va, NULL);
    708712                }
     
    740744        } else {
    741745                if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
    742                         fault_if_from_uspace(istate, "Page fault at %p.", va);
     746                        fault_if_from_uspace(istate, "Page fault at %p.",
     747                            (void *) va);
    743748                        panic_memtrap(istate, PF_ACCESS_UNKNOWN, va, NULL);
    744749                }
     
    772777        ASSERT(!t->w);
    773778        if (as_page_fault(va, PF_ACCESS_WRITE, istate) == AS_PF_FAULT) {
    774                 fault_if_from_uspace(istate, "Page fault at %p.", va);
     779                fault_if_from_uspace(istate, "Page fault at %p.",
     780                    (void *) va);
    775781                panic_memtrap(istate, PF_ACCESS_WRITE, va, NULL);
    776782        }
     
    812818                page_table_unlock(AS, true);
    813819                if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
    814                         fault_if_from_uspace(istate, "Page fault at %p.", va);
     820                        fault_if_from_uspace(istate, "Page fault at %p.",
     821                            (void *) va);
    815822                        panic_memtrap(istate, PF_ACCESS_UNKNOWN, va, NULL);
    816823                }
  • kernel/arch/mips32/src/cache.c

    r202f57b r7e752b2  
    3939void cache_error(istate_t *istate)
    4040{
    41         panic("cache_error exception (epc=%p).", istate->epc);
     41        panic("cache_error exception (epc=%p).", (void *) istate->epc);
    4242}
    4343
  • kernel/arch/mips32/src/debugger.c

    r202f57b r7e752b2  
    191191        }
    192192       
    193         printf("Adding breakpoint on address %p\n", argv->intval);
     193        printf("Adding breakpoint on address %p\n", (void *) argv->intval);
    194194       
    195195        cur->address = (uintptr_t) argv->intval;
     
    267267                            breakpoints[i].address);
    268268                       
    269                         printf("%-4u %7" PRIs " %p %-8s %-9s %-10s %s\n", i,
    270                             breakpoints[i].counter, breakpoints[i].address,
     269                        printf("%-4u %7zu %p %-8s %-9s %-10s %s\n", i,
     270                            breakpoints[i].counter, (void *) breakpoints[i].address,
    271271                            ((breakpoints[i].flags & BKPOINT_INPROG) ? "true" :
    272272                            "false"), ((breakpoints[i].flags & BKPOINT_ONESHOT)
     
    366366               
    367367                if (!(cur->flags & BKPOINT_FUNCCALL)) {
    368                         printf("***Breakpoint %u: %p in %s.\n", i, fireaddr,
     368                        printf("***Breakpoint %u: %p in %s.\n", i,
     369                            (void *) fireaddr,
    369370                            symtab_fmt_name_lookup(fireaddr));
    370371                }
     
    381382                cur->flags |= BKPOINT_INPROG;
    382383        } else {
    383                 printf("***Breakpoint %d: %p in %s.\n", i, fireaddr,
     384                printf("***Breakpoint %d: %p in %s.\n", i,
     385                    (void *) fireaddr,
    384386                    symtab_fmt_name_lookup(fireaddr));
    385387               
  • kernel/arch/mips32/src/exception.c

    r202f57b r7e752b2  
    7474void istate_decode(istate_t *istate)
    7575{
    76         printf("epc=%p\tsta=%p\tlo =%p\thi =%p\n",
    77             istate->epc, istate->status, istate->lo, istate->hi);
    78         printf("a0 =%p\ta1 =%p\ta2 =%p\ta3 =%p\n",
     76        printf("epc=%p\tsta=%#0" PRIx32 "\t"
     77            "lo =%#0" PRIx32 "\thi =%#0" PRIx32 "\n",
     78            (void *) istate->epc, istate->status,
     79            istate->lo, istate->hi);
     80       
     81        printf("a0 =%#0" PRIx32 "\ta1 =%#0" PRIx32 "\t"
     82            "a2 =%#0" PRIx32 "\ta3 =%#0" PRIx32 "\n",
    7983            istate->a0, istate->a1, istate->a2, istate->a3);
    80         printf("t0 =%p\tt1 =%p\tt2 =%p\tt3 =%p\n",
     84       
     85        printf("t0 =%#0" PRIx32 "\tt1 =%#0" PRIx32 "\t"
     86            "t2 =%#0" PRIx32 "\tt3 =%#0" PRIx32 "\n",
    8187            istate->t0, istate->t1, istate->t2, istate->t3);
    82         printf("t4 =%p\tt5 =%p\tt6 =%p\tt7 =%p\n",
     88       
     89        printf("t4 =%#0" PRIx32 "\tt5 =%#0" PRIx32 "\t"
     90            "t6 =%#0" PRIx32 "\tt7 =%#0" PRIx32 "\n",
    8391            istate->t4, istate->t5, istate->t6, istate->t7);
    84         printf("t8 =%p\tt9 =%p\tv0 =%p\tv1 =%p\n",
     92       
     93        printf("t8 =%#0" PRIx32 "\tt9 =%#0" PRIx32 "\t"
     94            "v0 =%#0" PRIx32 "\tv1 =%#0" PRIx32 "\n",
    8595            istate->t8, istate->t9, istate->v0, istate->v1);
    86         printf("s0 =%p\ts1 =%p\ts2 =%p\ts3 =%p\n",
     96       
     97        printf("s0 =%#0" PRIx32 "\ts1 =%#0" PRIx32 "\t"
     98            "s2 =%#0" PRIx32 "\ts3 =%#0" PRIx32 "\n",
    8799            istate->s0, istate->s1, istate->s2, istate->s3);
    88         printf("s4 =%p\ts5 =%p\ts6 =%p\ts7 =%p\n",
     100       
     101        printf("s4 =%#0" PRIx32 "\ts5 =%#0" PRIx32 "\t"
     102            "s6 =%#0" PRIx32 "\ts7 =%#0" PRIx32 "\n",
    89103            istate->s4, istate->s5, istate->s6, istate->s7);
    90         printf("s8 =%p\tat =%p\tkt0=%p\tkt1=%p\n",
     104       
     105        printf("s8 =%#0" PRIx32 "\tat =%#0" PRIx32 "\t"
     106            "kt0=%#0" PRIx32 "\tkt1=%#0" PRIx32 "\n",
    91107            istate->s8, istate->at, istate->kt0, istate->kt1);
     108       
    92109        printf("sp =%p\tra =%p\tgp =%p\n",
    93             istate->sp, istate->ra, istate->gp);
     110            (void *) istate->sp, (void *) istate->ra,
     111            (void *) istate->gp);
    94112}
    95113
  • kernel/arch/mips32/src/mm/tlb.c

    r202f57b r7e752b2  
    323323        uintptr_t va = cp0_badvaddr_read();
    324324       
    325         fault_if_from_uspace(istate, "TLB Refill Exception on %p.", va);
     325        fault_if_from_uspace(istate, "TLB Refill Exception on %p.",
     326            (void *) va);
    326327        panic_memtrap(istate, PF_ACCESS_UNKNOWN, va, "TLB Refill Exception.");
    327328}
     
    332333        uintptr_t va = cp0_badvaddr_read();
    333334       
    334         fault_if_from_uspace(istate, "TLB Invalid Exception on %p.", va);
     335        fault_if_from_uspace(istate, "TLB Invalid Exception on %p.",
     336            (void *) va);
    335337        panic_memtrap(istate, PF_ACCESS_UNKNOWN, va, "TLB Invalid Exception.");
    336338}
     
    340342        uintptr_t va = cp0_badvaddr_read();
    341343       
    342         fault_if_from_uspace(istate, "TLB Modified Exception on %p.", va);
     344        fault_if_from_uspace(istate, "TLB Modified Exception on %p.",
     345            (void *) va);
    343346        panic_memtrap(istate, PF_ACCESS_WRITE, va, "TLB Modified Exception.");
    344347}
  • kernel/arch/ppc32/src/cpu/cpu.c

    r202f57b r7e752b2  
    6868        }
    6969       
    70         printf("cpu%" PRIs ": version=%" PRIu16" (%s), revision=%" PRIu16 "\n", cpu->id,
     70        printf("cpu%u: version=%" PRIu16" (%s), revision=%" PRIu16 "\n", cpu->id,
    7171            cpu->arch.version, name, cpu->arch.revision);
    7272}
  • kernel/arch/ppc32/src/interrupt.c

    r202f57b r7e752b2  
    5454void istate_decode(istate_t *istate)
    5555{
    56         printf("r0 =%p\tr1 =%p\tr2 =%p\n", istate->r0, istate->sp, istate->r2);
    57         printf("r3 =%p\tr4 =%p\tr5 =%p\n", istate->r3, istate->r4, istate->r5);
    58         printf("r6 =%p\tr7 =%p\tr8 =%p\n", istate->r6, istate->r7, istate->r8);
    59         printf("r9 =%p\tr10=%p\tr11=%p\n",
     56        printf("r0 =%#0" PRIx32 "\tr1 =%p\tr2 =%#0" PRIx32 "\n",
     57            istate->r0, (void *) istate->sp, istate->r2);
     58       
     59        printf("r3 =%#0" PRIx32 "\tr4 =%#0" PRIx32 "\tr5 =%#0" PRIx32 "\n",
     60            istate->r3, istate->r4, istate->r5);
     61       
     62        printf("r6 =%#0" PRIx32 "\tr7 =%#0" PRIx32 "\tr8 =%#0" PRIx32 "\n",
     63            istate->r6, istate->r7, istate->r8);
     64       
     65        printf("r9 =%#0" PRIx32 "\tr10=%#0" PRIx32 "\tr11=%#0" PRIx32 "\n",
    6066            istate->r9, istate->r10, istate->r11);
    61         printf("r12=%p\tr13=%p\tr14=%p\n",
     67       
     68        printf("r12=%#0" PRIx32 "\tr13=%#0" PRIx32 "\tr14=%#0" PRIx32 "\n",
    6269            istate->r12, istate->r13, istate->r14);
    63         printf("r15=%p\tr16=%p\tr17=%p\n",
     70       
     71        printf("r15=%#0" PRIx32 "\tr16=%#0" PRIx32 "\tr17=%#0" PRIx32 "\n",
    6472            istate->r15, istate->r16, istate->r17);
    65         printf("r18=%p\tr19=%p\tr20=%p\n",
     73       
     74        printf("r18=%#0" PRIx32 "\tr19=%#0" PRIx32 "\tr20=%#0" PRIx32 "\n",
    6675            istate->r18, istate->r19, istate->r20);
    67         printf("r21=%p\tr22=%p\tr23=%p\n",
     76       
     77        printf("r21=%#0" PRIx32 "\tr22=%#0" PRIx32 "\tr23=%#0" PRIx32 "\n",
    6878            istate->r21, istate->r22, istate->r23);
    69         printf("r24=%p\tr25=%p\tr26=%p\n",
     79       
     80        printf("r24=%#0" PRIx32 "\tr25=%#0" PRIx32 "\tr26=%#0" PRIx32 "\n",
    7081            istate->r24, istate->r25, istate->r26);
    71         printf("r27=%p\tr28=%p\tr29=%p\n",
     82       
     83        printf("r27=%#0" PRIx32 "\tr28=%#0" PRIx32 "\tr29=%#0" PRIx32 "\n",
    7284            istate->r27, istate->r28, istate->r29);
    73         printf("r30=%p\tr31=%p\n", istate->r30, istate->r31);
    74         printf("cr =%p\tpc =%p\tlr =%p\n", istate->cr, istate->pc, istate->lr);
    75         printf("ctr=%p\txer=%p\tdar=%p\n",
     85       
     86        printf("r30=%#0" PRIx32 "\tr31=%#0" PRIx32 "\n",
     87            istate->r30, istate->r31);
     88       
     89        printf("cr =%#0" PRIx32 "\tpc =%p\tlr =%p\n",
     90            istate->cr, (void *) istate->pc, (void *) istate->lr);
     91       
     92        printf("ctr=%#0" PRIx32 "\txer=%#0" PRIx32 "\tdar=%#0" PRIx32 "\n",
    7693            istate->ctr, istate->xer, istate->dar);
    77         printf("srr1=%p\n", istate->srr1);
     94       
     95        printf("srr1=%p\n", (void *) istate->srr1);
    7896}
    7997
     
    111129                         */
    112130#ifdef CONFIG_DEBUG
    113                         printf("cpu%" PRIs ": spurious interrupt (inum=%" PRIu8 ")\n",
     131                        printf("cpu%u: spurious interrupt (inum=%" PRIu8 ")\n",
    114132                            CPU->id, inum);
    115133#endif
  • kernel/arch/ppc32/src/mm/frame.c

    r202f57b r7e752b2  
    4949        size_t i;
    5050        for (i = 0; i < memmap.cnt; i++) {
    51                 printf("%#10x %#10x\n", memmap.zones[i].start,
     51                printf("%p %#0zx\n", memmap.zones[i].start,
    5252                    memmap.zones[i].size);
    5353        }
  • kernel/arch/ppc32/src/mm/page.c

    r202f57b r7e752b2  
    4949        if (last_frame + ALIGN_UP(size, PAGE_SIZE) >
    5050            KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
    51                 panic("Unable to map physical memory %p (%" PRIs " bytes).",
    52                     physaddr, size);
     51                panic("Unable to map physical memory %p (%zu bytes).",
     52                    (void *) physaddr, size);
    5353       
    5454        uintptr_t virtaddr = PA2KA(last_frame);
  • kernel/arch/ppc32/src/mm/tlb.c

    r202f57b r7e752b2  
    111111static void pht_refill_fail(uintptr_t badvaddr, istate_t *istate)
    112112{
    113         fault_if_from_uspace(istate, "PHT Refill Exception on %p.", badvaddr);
     113        fault_if_from_uspace(istate, "PHT Refill Exception on %p.",
     114            (void *) badvaddr);
    114115        panic_memtrap(istate, PF_ACCESS_UNKNOWN, badvaddr,
    115116            "PHT Refill Exception.");
     
    459460                length = 0; \
    460461        \
    461         printf(name ": page=%.*p frame=%.*p length=%d KB (mask=%#x)%s%s\n", \
    462             sizeof(upper) * 2, upper & 0xffff0000, sizeof(lower) * 2, \
    463             lower & 0xffff0000, length, mask, \
     462        printf(name ": page=%#0" PRIx32 " frame=%#0" PRIx32 \
     463            " length=%#0" PRIx32 " KB (mask=%#0" PRIx32 ")%s%s\n", \
     464            upper & UINT32_C(0xffff0000), lower & UINT32_C(0xffff0000), \
     465            length, mask, \
    464466            ((upper >> 1) & 1) ? " supervisor" : "", \
    465467            (upper & 1) ? " user" : "");
    466468
    467 
    468469void tlb_print(void)
    469470{
     
    473474                uint32_t vsid = sr_get(sr << 28);
    474475               
    475                 printf("sr[%02u]: vsid=%.*p (asid=%u)%s%s\n", sr,
    476                     sizeof(vsid) * 2, vsid & 0xffffff, (vsid & 0xffffff) >> 4,
     476                printf("sr[%02" PRIu32 "]: vsid=%#0" PRIx32 " (asid=%" PRIu32 ")"
     477                    "%s%s\n", sr, vsid & UINT32_C(0x00ffffff),
     478                    (vsid & UINT32_C(0x00ffffff)) >> 4,
    477479                    ((vsid >> 30) & 1) ? " supervisor" : "",
    478480                    ((vsid >> 29) & 1) ? " user" : "");
  • kernel/arch/sparc64/src/console.c

    r202f57b r7e752b2  
    7070        ofw_tree_node_t *screen = ofw_tree_lookup(prop_scr->value);
    7171        if (!screen)
    72                 panic("Cannot find %s.", prop_scr->value);
     72                panic("Cannot find %s.", (char *) prop_scr->value);
    7373       
    7474        scr_init(screen);
     
    8383        ofw_tree_node_t *keyboard = ofw_tree_lookup(prop_kbd->value);
    8484        if (!keyboard)
    85                 panic("Cannot find %s.", prop_kbd->value);
     85                panic("Cannot find %s.", (char *) prop_kbd->value);
    8686       
    8787        kbd_init(keyboard);
  • kernel/arch/sparc64/src/drivers/pci.c

    r202f57b r7e752b2  
    211211                 * Unsupported model.
    212212                 */
    213                 printf("Unsupported PCI controller model (%s).\n", prop->value);
     213                printf("Unsupported PCI controller model (%s).\n",
     214                    (char *) prop->value);
    214215        }
    215216
  • kernel/arch/sparc64/src/mm/sun4u/tlb.c

    r202f57b r7e752b2  
    360360static void print_tlb_entry(int i, tlb_tag_read_reg_t t, tlb_data_t d)
    361361{
    362         printf("%d: vpn=%#llx, context=%d, v=%d, size=%d, nfo=%d, "
    363             "ie=%d, soft2=%#x, pfn=%#x, soft=%#x, l=%d, "
    364             "cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n", i, t.vpn,
     362        printf("%u: vpn=%#" PRIx64 ", context=%u, v=%u, size=%u, nfo=%u, "
     363            "ie=%u, soft2=%#x, pfn=%#x, soft=%#x, l=%u, "
     364            "cp=%u, cv=%u, e=%u, p=%u, w=%u, g=%u\n", i, (uint64_t) t.vpn,
    365365            t.context, d.v, d.size, d.nfo, d.ie, d.soft2,
    366366            d.pfn, d.soft, d.l, d.cp, d.cv, d.e, d.p, d.w, d.g);
     
    441441    uintptr_t va, const char *str)
    442442{
    443         fault_if_from_uspace(istate, "%s, Address=%p.", str, va);
     443        fault_if_from_uspace(istate, "%s, address=%p.", str, (void *) va);
    444444        panic_memtrap(istate, PF_ACCESS_EXEC, va, str);
    445445}
     
    451451
    452452        va = tag.vpn << MMU_PAGE_WIDTH;
    453         fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d).", str, va,
    454             tag.context);
     453        fault_if_from_uspace(istate, "%s, page=%p (asid=%u).", str,
     454            (void *) va, tag.context);
    455455        panic_memtrap(istate, PF_ACCESS_UNKNOWN, va, str);
    456456}
     
    462462
    463463        va = tag.vpn << MMU_PAGE_WIDTH;
    464         fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d).", str, va,
    465             tag.context);
     464        fault_if_from_uspace(istate, "%s, page=%p (asid=%u).", str,
     465            (void *) va, tag.context);
    466466        panic_memtrap(istate, PF_ACCESS_WRITE, va, str);
    467467}
     
    484484            sfsr.e, sfsr.ct, sfsr.pr, sfsr.w, sfsr.ow, sfsr.fv);
    485485#endif
    486            
    487         printf("DTLB SFAR: address=%p\n", sfar);
     486       
     487        printf("DTLB SFAR: address=%p\n", (void *) sfar);
    488488       
    489489        dtlb_sfsr_write(0);
     
    508508#endif
    509509           
    510         printf("DTLB SFAR: address=%p\n", sfar);
     510        printf("DTLB SFAR: address=%p\n", (void *) sfar);
    511511       
    512512        dtlb_sfsr_write(0);
  • kernel/arch/sparc64/src/mm/sun4v/tlb.c

    r202f57b r7e752b2  
    358358    const char *str)
    359359{
    360         fault_if_from_uspace(istate, "%s, Address=%p.", str, va);
     360        fault_if_from_uspace(istate, "%s, address=%p.", str,
     361            (void *) va);
    361362        panic_memtrap(istate, PF_ACCESS_EXEC, va, str);
    362363}
     
    365366    uint64_t page_and_ctx, const char *str)
    366367{
    367         fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d).", str,
    368             DMISS_ADDRESS(page_and_ctx), DMISS_CONTEXT(page_and_ctx));
     368        fault_if_from_uspace(istate, "%s, page=%p (asid=%" PRId64 ").", str,
     369            (void *) DMISS_ADDRESS(page_and_ctx), DMISS_CONTEXT(page_and_ctx));
    369370        panic_memtrap(istate, PF_ACCESS_UNKNOWN, DMISS_ADDRESS(page_and_ctx),
    370371            str);
     
    374375    uint64_t page_and_ctx, const char *str)
    375376{
    376         fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d).", str,
    377             DMISS_ADDRESS(page_and_ctx), DMISS_CONTEXT(page_and_ctx));
     377        fault_if_from_uspace(istate, "%s, page=%p (asid=%" PRId64 ").", str,
     378            (void *) DMISS_ADDRESS(page_and_ctx), DMISS_CONTEXT(page_and_ctx));
    378379        panic_memtrap(istate, PF_ACCESS_WRITE, DMISS_ADDRESS(page_and_ctx),
    379380            str);
     
    399400        uint64_t errno =  __hypercall_fast3(MMU_DEMAP_ALL, 0, 0,
    400401                MMU_FLAG_DTLB | MMU_FLAG_ITLB);
    401         if (errno != HV_EOK) {
    402                 panic("Error code = %d.\n", errno);
    403         }
     402        if (errno != HV_EOK)
     403                panic("Error code = %" PRIu64 ".\n", errno);
    404404}
    405405
  • kernel/arch/sparc64/src/sun4v/md.c

    r202f57b r7e752b2  
    310310        retval = retval;
    311311        if (retval != HV_EOK) {
    312                 printf("Could not retrieve machine description, error = %d.\n",
    313                     retval);
     312                printf("Could not retrieve machine description, "
     313                    "error=%" PRIu64 ".\n", retval);
    314314        }
    315315}
  • kernel/arch/sparc64/src/trap/sun4v/interrupt.c

    r202f57b r7e752b2  
    8787                KA2PA(cpu_mondo_queues[CPU->id]),
    8888                CPU_MONDO_NENTRIES) != HV_EOK)
    89                         panic("Initializing mondo queue failed on CPU %d.\n",
     89                        panic("Initializing mondo queue failed on CPU %" PRIu64 ".\n",
    9090                            CPU->arch.id);
    9191}
  • kernel/generic/include/synch/spinlock.h

    r202f57b r7e752b2  
    146146        if ((pname)++ > (value)) { \
    147147                (pname) = 0; \
    148                 printf("Deadlock probe %s: exceeded threshold %u\n", \
     148                printf("Deadlock probe %s: exceeded threshold %u\n" \
    149149                    "cpu%u: function=%s, line=%u\n", \
    150150                    #pname, (value), CPU->id, __func__, __LINE__); \
  • kernel/generic/src/cpu/cpu.c

    r202f57b r7e752b2  
    107107void cpu_list(void)
    108108{
    109         size_t i;
     109        unsigned int i;
    110110       
    111111        for (i = 0; i < config.cpu_count; i++) {
  • kernel/generic/src/debug/debug.c

    r202f57b r7e752b2  
    5252        if (symtab_name_lookup((uintptr_t) call_site, &call_site_sym,
    5353            &call_site_off) == EOK)
    54                 printf("%s+%" PRIp "->%s\n", call_site_sym, call_site_off,
    55                     fn_sym);
     54                printf("%s()+%p->%s()\n", call_site_sym,
     55                    (void *) call_site_off, fn_sym);
    5656        else
    57                 printf("->%s\n", fn_sym);
     57                printf("->%s()\n", fn_sym);
    5858}
    5959
     
    6767        if (symtab_name_lookup((uintptr_t) call_site, &call_site_sym,
    6868            &call_site_off) == EOK)
    69                 printf("%s+%" PRIp "<-%s\n", call_site_sym, call_site_off,
    70                     fn_sym);
     69                printf("%s()+%p<-%s()\n", call_site_sym,
     70                    (void *) call_site_off, fn_sym);
    7171        else
    72                 printf("<-%s\n", fn_sym);
     72                printf("<-%s()\n", fn_sym);
    7373}
    7474
  • kernel/generic/src/debug/panic.c

    r202f57b r7e752b2  
    4242#include <interrupt.h>
    4343
     44#define BANNER_LEFT   "######>"
     45#define BANNER_RIGHT  "<######"
     46
    4447void panic_common(panic_category_t cat, istate_t *istate, int access,
    4548    uintptr_t address, const char *fmt, ...)
    4649{
    4750        va_list args;
    48 
     51       
    4952        silent = false;
    50 
    51         printf("\nKERNEL PANIC ");
     53       
     54        printf("\n%s Kernel panic ", BANNER_LEFT);
    5255        if (CPU)
    53                 printf("ON cpu%d ", CPU->id);
    54         printf("DUE TO ");
    55 
     56                printf("on cpu%u ", CPU->id);
     57        printf("due to ");
     58       
    5659        va_start(args, fmt);
    5760        if (cat == PANIC_ASSERT) {
    58                 printf("A FAILED ASSERTION:\n");
     61                printf("a failed assertion: %s\n", BANNER_RIGHT);
    5962                vprintf(fmt, args);
    6063                printf("\n");
    6164        } else if (cat == PANIC_BADTRAP) {
    62                 printf("BAD TRAP %ld.\n", address);
     65                printf("bad trap %" PRIun ". %s\n", address,
     66                    BANNER_RIGHT);
    6367                if (fmt) {
    6468                        vprintf(fmt, args);
     
    6670                }
    6771        } else if (cat == PANIC_MEMTRAP) {
    68                 printf("A BAD MEMORY ACCESS WHILE ");
     72                printf("a bad memory access while ");
    6973                if (access == PF_ACCESS_READ)
    70                         printf("LOADING FROM");
     74                        printf("loading from");
    7175                else if (access == PF_ACCESS_WRITE)
    72                         printf("STORING TO");
     76                        printf("storing to");
    7377                else if (access == PF_ACCESS_EXEC)
    74                         printf("BRANCHING TO");
     78                        printf("branching to");
    7579                else
    76                         printf("REFERENCING");
    77                 printf(" ADDRESS %p.\n", address);
     80                        printf("referencing");
     81                printf(" address %p. %s\n", (void *) address,
     82                    BANNER_RIGHT);
    7883                if (fmt) {
    7984                        vprintf(fmt, args);
     
    8186                }
    8287        } else {
    83                 printf("THE FOLLOWING REASON:\n");
     88                printf("the following reason: %s\n",
     89                    BANNER_RIGHT);
    8490                vprintf(fmt, args);
    8591                printf("\n");
    8692        }
    8793        va_end(args);
    88 
     94       
    8995        printf("\n");
    90 
     96       
    9197        if (istate) {
    9298                istate_decode(istate);
    9399                printf("\n");
    94100        }
    95 
     101       
    96102        stack_trace();
    97103        halt();
  • kernel/generic/src/debug/stacktrace.c

    r202f57b r7e752b2  
    4141#define STACK_FRAMES_MAX        20
    4242
    43 void
    44 stack_trace_ctx(stack_trace_ops_t *ops, stack_trace_context_t *ctx)
     43void stack_trace_ctx(stack_trace_ops_t *ops, stack_trace_context_t *ctx)
    4544{
    4645        int cnt = 0;
     
    5453                if (ops->symbol_resolve &&
    5554                    ops->symbol_resolve(ctx->pc, &symbol, &offset)) {
    56                         if (offset)
    57                                 printf("%p: %s+%" PRIp "()\n",
    58                                     ctx->fp, symbol, offset);
     55                        if (offset)
     56                                printf("%p: %s()+%p\n", (void *) ctx->fp,
     57                                    symbol, (void *) offset);
    5958                        else
    60                                 printf("%p: %s()\n",
    61                                     ctx->fp, symbol);
    62                 } else {
    63                         printf("%p: %p()\n", ctx->fp, ctx->pc);
    64                 }
     59                                printf("%p: %s()\n", (void *) ctx->fp, symbol);
     60                } else
     61                        printf("%p: %p()\n", (void *) ctx->fp, (void *) ctx->pc);
     62               
    6563                if (!ops->return_address_get(ctx, &pc))
    6664                        break;
     65               
    6766                if (!ops->frame_pointer_prev(ctx, &fp))
    6867                        break;
     68               
    6969                ctx->fp = fp;
    7070                ctx->pc = pc;
  • kernel/generic/src/debug/symtab.c

    r202f57b r7e752b2  
    192192                uintptr_t addr = uint64_t_le2host(symbol_table[pos].address_le);
    193193                char *realname = symbol_table[pos].symbol_name;
    194                 printf("%p: %s\n", addr, realname);
     194                printf("%p: %s\n", (void *) addr, realname);
    195195                pos++;
    196196        }
  • kernel/generic/src/interrupt/interrupt.c

    r202f57b r7e752b2  
    176176        printf("Task %s (%" PRIu64 ") killed due to an exception at "
    177177            "program counter %p.\n", TASK->name, TASK->taskid,
    178             istate_get_pc(istate));
     178            (void *) istate_get_pc(istate));
    179179       
    180180        stack_trace_istate(istate);
  • kernel/generic/src/ipc/ipc.c

    r202f57b r7e752b2  
    702702        for (i = 0; i < IPC_MAX_PHONES; i++) {
    703703                if (SYNCH_FAILED(mutex_trylock(&task->phones[i].lock))) {
    704                         printf("%d: mutex busy\n", i);
     704                        printf("%zu: mutex busy\n", i);
    705705                        continue;
    706706                }
    707707               
    708708                if (task->phones[i].state != IPC_PHONE_FREE) {
    709                         printf("%" PRIs ": ", i);
     709                        printf("%zu: ", i);
    710710                       
    711711                        switch (task->phones[i].state) {
  • kernel/generic/src/main/kinit.c

    r202f57b r7e752b2  
    129129                 * For each CPU, create its load balancing thread.
    130130                 */
    131                 size_t i;
     131                unsigned int i;
    132132               
    133133                for (i = 0; i < config.cpu_count; i++) {
     
    139139                                thread_ready(thread);
    140140                        } else
    141                                 printf("Unable to create kcpulb thread for cpu" PRIs "\n", i);
     141                                printf("Unable to create kcpulb thread for cpu%u\n", i);
    142142                }
    143143        }
     
    179179        for (i = 0; i < init.cnt; i++) {
    180180                if (init.tasks[i].addr % FRAME_SIZE) {
    181                         printf("init[%" PRIs "].addr is not frame aligned\n", i);
     181                        printf("init[%zu].addr is not frame aligned\n", i);
    182182                        programs[i].task = NULL;
    183183                        continue;
     
    219219                       
    220220                        if (rd != RE_OK)
    221                                 printf("Init binary %" PRIs " not used (error %d)\n", i, rd);
     221                                printf("Init binary %zu not used (error %d)\n", i, rd);
    222222                }
    223223        }
  • kernel/generic/src/main/main.c

    r202f57b r7e752b2  
    183183        version_print();
    184184       
    185         LOG("\nconfig.base=%p config.kernel_size=%" PRIs
    186             "\nconfig.stack_base=%p config.stack_size=%" PRIs,
     185        LOG("\nconfig.base=%p config.kernel_size=%zu"
     186            "\nconfig.stack_base=%p config.stack_size=%zu",
    187187            config.base, config.kernel_size, config.stack_base,
    188188            config.stack_size);
     
    225225        slab_enable_cpucache();
    226226       
    227         printf("Detected %" PRIs " CPU(s), %" PRIu64" MiB free memory\n",
     227        printf("Detected %u CPU(s), %" PRIu64 " MiB free memory\n",
    228228            config.cpu_count, SIZE2MB(zones_total_size()));
    229229       
     
    241241                size_t i;
    242242                for (i = 0; i < init.cnt; i++)
    243                         LOG("init[%" PRIs "].addr=%p, init[%" PRIs
    244                             "].size=%" PRIs, i, init.tasks[i].addr, i,
    245                             init.tasks[i].size);
     243                        LOG("init[%zu].addr=%p, init[%zu].size=%zu",
     244                            i, init.tasks[i].addr, i, init.tasks[i].size);
    246245        } else
    247246                printf("No init binaries found.\n");
  • kernel/generic/src/mm/as.c

    r202f57b r7e752b2  
    18111811        }
    18121812       
    1813         panic("Inconsistency detected while adding %" PRIs " pages of used "
    1814             "space at %p.", count, page);
     1813        panic("Inconsistency detected while adding %zu pages of used "
     1814            "space at %p.", count, (void *) page);
    18151815}
    18161816
     
    19911991       
    19921992error:
    1993         panic("Inconsistency detected while removing %" PRIs " pages of used "
    1994             "space from %p.", count, page);
     1993        panic("Inconsistency detected while removing %zu pages of used "
     1994            "space from %p.", count, (void *) page);
    19951995}
    19961996
     
    21052105                       
    21062106                        mutex_lock(&area->lock);
    2107                         printf("as_area: %p, base=%p, pages=%" PRIs
    2108                             " (%p - %p)\n", area, area->base, area->pages,
    2109                             area->base, area->base + FRAMES2SIZE(area->pages));
     2107                        printf("as_area: %p, base=%p, pages=%zu"
     2108                            " (%p - %p)\n", area, (void *) area->base,
     2109                            area->pages, (void *) area->base,
     2110                            (void *) (area->base + FRAMES2SIZE(area->pages)));
    21102111                        mutex_unlock(&area->lock);
    21112112                }
  • kernel/generic/src/mm/frame.c

    r202f57b r7e752b2  
    145145                            (!iswithin(zones.info[i].base, zones.info[i].count,
    146146                            base, count))) {
    147                                 printf("Zone (%p, %p) overlaps with previous zone (%p, %p)!\n",
    148                                     PFN2ADDR(base), PFN2ADDR(count),
    149                                     PFN2ADDR(zones.info[i].base),
    150                                     PFN2ADDR(zones.info[i].count));
     147                                printf("Zone (%p, %p) overlaps "
     148                                    "with previous zone (%p %p)!\n",
     149                                    (void *) PFN2ADDR(base), (void *) PFN2ADDR(count),
     150                                    (void *) PFN2ADDR(zones.info[i].base),
     151                                    (void *) PFN2ADDR(zones.info[i].count));
    151152                        }
    152153                       
     
    10491050               
    10501051#ifdef CONFIG_DEBUG
    1051                 printf("Thread %" PRIu64 " waiting for %" PRIs " frames, "
    1052                     "%" PRIs " available.\n", THREAD->tid, size, avail);
     1052                printf("Thread %" PRIu64 " waiting for %zu frames, "
     1053                    "%zu available.\n", THREAD->tid, size, avail);
    10531054#endif
    10541055               
     
    12971298                bool available = zone_flags_available(flags);
    12981299               
    1299                 printf("%-4" PRIs, i);
     1300                printf("%-4zu", i);
    13001301               
    13011302#ifdef __32_BITS__
    1302                 printf("  %10p", base);
     1303                printf("  %p", (void *) base);
    13031304#endif
    13041305               
    13051306#ifdef __64_BITS__
    1306                 printf(" %18p", base);
     1307                printf(" %p", (void *) base);
    13071308#endif
    13081309               
    1309                 printf(" %12" PRIs " %c%c%c      ", count,
     1310                printf(" %12zu %c%c%c      ", count,
    13101311                    available ? 'A' : ' ',
    13111312                    (flags & ZONE_RESERVED) ? 'R' : ' ',
     
    13131314               
    13141315                if (available)
    1315                         printf("%14" PRIs " %14" PRIs,
     1316                        printf("%14zu %14zu",
    13161317                            free_count, busy_count);
    13171318               
     
    13541355        bool available = zone_flags_available(flags);
    13551356       
    1356         printf("Zone number:       %" PRIs "\n", znum);
    1357         printf("Zone base address: %p\n", base);
    1358         printf("Zone size:         %" PRIs " frames (%" PRIs " KiB)\n", count,
     1357        printf("Zone number:       %zu\n", znum);
     1358        printf("Zone base address: %p\n", (void *) base);
     1359        printf("Zone size:         %zu frames (%zu KiB)\n", count,
    13591360            SIZE2KB(FRAMES2SIZE(count)));
    13601361        printf("Zone flags:        %c%c%c\n",
     
    13641365       
    13651366        if (available) {
    1366                 printf("Allocated space:   %" PRIs " frames (%" PRIs " KiB)\n",
     1367                printf("Allocated space:   %zu frames (%zu KiB)\n",
    13671368                    busy_count, SIZE2KB(FRAMES2SIZE(busy_count)));
    1368                 printf("Available space:   %" PRIs " frames (%" PRIs " KiB)\n",
     1369                printf("Available space:   %zu frames (%zu KiB)\n",
    13691370                    free_count, SIZE2KB(FRAMES2SIZE(free_count)));
    13701371        }
  • kernel/generic/src/mm/slab.c

    r202f57b r7e752b2  
    890890                irq_spinlock_unlock(&slab_cache_lock, true);
    891891               
    892                 printf("%-18s %8" PRIs " %8u %8" PRIs " %8ld %8ld %8ld %-5s\n",
     892                printf("%-18s %8zu %8u %8zu %8ld %8ld %8ld %-5s\n",
    893893                    name, size, (1 << order), objects, allocated_slabs,
    894894                    cached_objs, allocated_objs,
  • kernel/generic/src/proc/program.c

    r202f57b r7e752b2  
    145145               
    146146                program_loader = image_addr;
    147                 LOG("Registered program loader at 0x%" PRIp,
    148                     image_addr);
     147                LOG("Registered program loader at %p",
     148                    (void *) image_addr);
    149149               
    150150                return EOK;
  • kernel/generic/src/proc/scheduler.c

    r202f57b r7e752b2  
    727727                irq_spinlock_lock(&cpus[cpu].lock, true);
    728728               
    729                 printf("cpu%u: address=%p, nrdy=%ld, needs_relink=%" PRIs "\n",
     729                printf("cpu%u: address=%p, nrdy=%" PRIua ", needs_relink=%zu\n",
    730730                    cpus[cpu].id, &cpus[cpu], atomic_get(&cpus[cpu].nrdy),
    731731                    cpus[cpu].needs_relink);
  • kernel/generic/src/proc/task.c

    r202f57b r7e752b2  
    478478#ifdef __32_BITS__
    479479        if (*additional)
    480                 printf("%-8" PRIu64 " %9lu %7lu", task->taskid,
     480                printf("%-8" PRIu64 " %9" PRIua " %7" PRIua, task->taskid,
    481481                    atomic_get(&task->refcount), atomic_get(&task->active_calls));
    482482        else
     
    489489#ifdef __64_BITS__
    490490        if (*additional)
    491                 printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c %9lu %7lu",
     491                printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c "
     492                    "%9" PRIua " %7" PRIua,
    492493                    task->taskid, ucycles, usuffix, kcycles, ksuffix,
    493494                    atomic_get(&task->refcount), atomic_get(&task->active_calls));
     
    501502                for (i = 0; i < IPC_MAX_PHONES; i++) {
    502503                        if (task->phones[i].callee)
    503                                 printf(" %" PRIs ":%p", i, task->phones[i].callee);
     504                                printf(" %zu:%p", i, task->phones[i].callee);
    504505                }
    505506                printf("\n");
  • kernel/generic/src/synch/spinlock.c

    r202f57b r7e752b2  
    102102               
    103103                if (i++ > DEADLOCK_THRESHOLD) {
    104                         printf("cpu%u: looping on spinlock %" PRIp ":%s, "
    105                             "caller=%" PRIp "(%s)\n", CPU->id, lock, lock->name,
    106                             CALLER, symtab_fmt_name_lookup(CALLER));
     104                        printf("cpu%u: looping on spinlock %p:%s, "
     105                            "caller=%p (%s)\n", CPU->id, lock, lock->name,
     106                            (void *) CALLER, symtab_fmt_name_lookup(CALLER));
    107107                       
    108108                        i = 0;
  • kernel/generic/src/sysinfo/sysinfo.c

    r202f57b r7e752b2  
    494494                        break;
    495495                case SYSINFO_VAL_DATA:
    496                         printf("+ %s (%" PRIs" bytes)\n", cur->name,
     496                        printf("+ %s (%zu bytes)\n", cur->name,
    497497                            cur->val.data.size);
    498498                        break;
     
    505505                        /* N.B.: No data was actually returned (only a dry run) */
    506506                        (void) cur->val.fn_data(cur, &size, true);
    507                         printf("+ %s (%" PRIs" bytes) [generated]\n", cur->name,
     507                        printf("+ %s (%zu bytes) [generated]\n", cur->name,
    508508                            size);
    509509                        break;
  • kernel/test/avltree/avltree1.c

    r202f57b r7e752b2  
    202202        avltree_create(tree);
    203203       
    204         TPRINTF("Inserting %" PRIs " nodes...", node_count);
     204        TPRINTF("Inserting %zu nodes...", node_count);
    205205       
    206206        for (i = 0; i < node_count; i++) {
  • kernel/test/fpu/fpu1_ia64.c

    r202f57b r7e752b2  
    161161       
    162162        while (atomic_get(&threads_ok) != total) {
    163                 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok));
     163                TPRINTF("Threads left: %" PRIua "\n",
     164                    total - atomic_get(&threads_ok));
    164165                thread_sleep(1);
    165166        }
  • kernel/test/fpu/fpu1_x86.c

    r202f57b r7e752b2  
    8282               
    8383                if ((int) (100000000 * e) != E_10e8) {
    84                         TPRINTF("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
     84                        TPRINTF("tid%" PRIu64 ": e*10e8=%" PRIun " should be %" PRIun "\n",
     85                            THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
    8586                        atomic_inc(&threads_fault);
    8687                        break;
     
    115116               
    116117                if ((int) (100000000 * pi) != PI_10e8) {
    117                         TPRINTF("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
     118                        TPRINTF("tid%" PRIu64 ": pi*10e8=%" PRIun " should be %" PRIun "\n",
     119                            THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
    118120                        atomic_inc(&threads_fault);
    119121                        break;
     
    158160       
    159161        while (atomic_get(&threads_ok) != total) {
    160                 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok));
     162                TPRINTF("Threads left: %" PRIua "\n", total - atomic_get(&threads_ok));
    161163                thread_sleep(1);
    162164        }
  • kernel/test/fpu/sse1.c

    r202f57b r7e752b2  
    142142       
    143143        while (atomic_get(&threads_ok) != total) {
    144                 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok));
     144                TPRINTF("Threads left: %" PRIua "\n", total - atomic_get(&threads_ok));
    145145                thread_sleep(1);
    146146        }
  • kernel/test/mm/falloc1.c

    r202f57b r7e752b2  
    6464                               
    6565                                if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
    66                                         TPRINTF("Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
     66                                        TPRINTF("Block at address %p (size %dK) is not aligned\n",
     67                                            (void *) frames[allocated], (FRAME_SIZE << order) >> 10);
    6768                                        return "Test failed";
    6869                                }
  • kernel/test/mm/falloc2.c

    r202f57b r7e752b2  
    8585                                for (k = 0; k <= (((size_t) FRAME_SIZE << order) - 1); k++) {
    8686                                        if (((uint8_t *) frames[i])[k] != val) {
    87                                                 TPRINTF("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %#" PRIs "\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
     87                                                TPRINTF("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %zu\n",
     88                                                    THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
    8889                                                atomic_inc(&thread_fail);
    8990                                                goto cleanup;
     
    121122       
    122123        while (atomic_get(&thread_count) > 0) {
    123                 TPRINTF("Threads left: %ld\n", atomic_get(&thread_count));
     124                TPRINTF("Threads left: %" PRIua "\n", atomic_get(&thread_count));
    124125                thread_sleep(1);
    125126        }
  • kernel/test/mm/mapping1.c

    r202f57b r7e752b2  
    3939#define PAGE1  (PAGE0 + PAGE_SIZE)
    4040
    41 #define VALUE0  0x01234567
    42 #define VALUE1  0x89abcdef
     41#define VALUE0  UINT32_C(0x01234567)
     42#define VALUE1  UINT32_C(0x89abcdef)
    4343
    4444const char *test_mapping1(void)
     
    5050        frame1 = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_KA);
    5151       
    52         TPRINTF("Writing %#x to physical address %p.\n", VALUE0, KA2PA(frame0));
     52        TPRINTF("Writing %#" PRIx32 " to physical address %p.\n",
     53            (uint32_t) VALUE0, (void *) KA2PA(frame0));
    5354        *((uint32_t *) frame0) = VALUE0;
    5455       
    55         TPRINTF("Writing %#x to physical address %p.\n", VALUE1, KA2PA(frame1));
     56        TPRINTF("Writing %#" PRIx32 " to physical address %p.\n",
     57            (uint32_t) VALUE1, (void *) KA2PA(frame1));
    5658        *((uint32_t *) frame1) = VALUE1;
    5759       
    58         TPRINTF("Mapping virtual address %p to physical address %p.\n", PAGE0, KA2PA(frame0));
     60        TPRINTF("Mapping virtual address %p to physical address %p.\n",
     61            (void *) PAGE0, (void *) KA2PA(frame0));
    5962        page_mapping_insert(AS_KERNEL, PAGE0, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE);
    6063       
    61         TPRINTF("Mapping virtual address %p to physical address %p.\n", PAGE1, KA2PA(frame1));
     64        TPRINTF("Mapping virtual address %p to physical address %p.\n",
     65            (void *) PAGE1, (void *) KA2PA(frame1));
    6266        page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE);
    6367       
    6468        v0 = *((uint32_t *) PAGE0);
    6569        v1 = *((uint32_t *) PAGE1);
    66         TPRINTF("Value at virtual address %p is %#x.\n", PAGE0, v0);
    67         TPRINTF("Value at virtual address %p is %#x.\n", PAGE1, v1);
     70        TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n",
     71            (void *) PAGE0, v0);
     72        TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n",
     73            (void *) PAGE1, v1);
    6874       
    6975        if (v0 != VALUE0)
     
    7278                return "Value at v1 not equal to VALUE1";
    7379       
    74         TPRINTF("Writing %#x to virtual address %p.\n", 0, PAGE0);
     80        TPRINTF("Writing %#" PRIx32 " to virtual address %p.\n",
     81            (uint32_t) 0, (void *) PAGE0);
    7582        *((uint32_t *) PAGE0) = 0;
    7683       
    77         TPRINTF("Writing %#x to virtual address %p.\n", 0, PAGE1);
     84        TPRINTF("Writing %#" PRIx32 " to virtual address %p.\n",
     85            (uint32_t) 0, (void *) PAGE1);
    7886        *((uint32_t *) PAGE1) = 0;
    7987       
     
    8189        v1 = *((uint32_t *) PAGE1);
    8290       
    83         TPRINTF("Value at virtual address %p is %#x.\n", PAGE0, *((uint32_t *) PAGE0));
    84         TPRINTF("Value at virtual address %p is %#x.\n", PAGE1, *((uint32_t *) PAGE1));
     91        TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n",
     92            (void *) PAGE0, *((uint32_t *) PAGE0));
     93        TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n",
     94            (void *) PAGE1, *((uint32_t *) PAGE1));
    8595       
    8696        if (v0 != 0)
  • kernel/test/synch/semaphore1.c

    r202f57b r7e752b2  
    8888                producers = (4 - i) * PRODUCERS;
    8989               
    90                 TPRINTF("Creating %d consumers and %d producers...", consumers, producers);
     90                TPRINTF("Creating %" PRIua " consumers and %" PRIua " producers...",
     91                    consumers, producers);
    9192               
    9293                for (j = 0; j < (CONSUMERS + PRODUCERS) / 2; j++) {
     
    113114               
    114115                while ((items_consumed.count != consumers) || (items_produced.count != producers)) {
    115                         TPRINTF("%d consumers remaining, %d producers remaining\n", consumers - items_consumed.count, producers - items_produced.count);
     116                        TPRINTF("%" PRIua " consumers remaining, %" PRIua " producers remaining\n",
     117                            consumers - items_consumed.count, producers - items_produced.count);
    116118                        thread_sleep(1);
    117119                }
  • kernel/test/thread/thread1.c

    r202f57b r7e752b2  
    7676        atomic_set(&finish, 0);
    7777        while (atomic_get(&threads_finished) < total) {
    78                 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_finished));
     78                TPRINTF("Threads left: %" PRIua "\n", total - atomic_get(&threads_finished));
    7979                thread_sleep(1);
    8080        }
Note: See TracChangeset for help on using the changeset viewer.