Changeset 7e752b2 in mainline for kernel/arch/ppc32/src


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/arch/ppc32/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • 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" : "");
Note: See TracChangeset for help on using the changeset viewer.