Changeset 73f8d93 in rtems


Ignore:
Timestamp:
Feb 15, 2017, 10:09:50 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
444cb5c
Parents:
7a462cc
Message:

bsps/powerpc: Fix warnings

Location:
c/src/lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/psim/network/if_sim.c

    r7a462cc r73f8d93  
    108108rtems_id           ifsim_tid = 0;
    109109
    110 __inline__ uint32_t
     110static __inline__ uint32_t
    111111ifsim_in(struct ifsim_softc *sc, unsigned regno)
    112112{
    113         return in_be32( sc->pvt.base + regno );
    114 }
    115 
    116 __inline__ void
     113        return in_be32((volatile uint32_t *) (sc->pvt.base + regno));
     114}
     115
     116static __inline__ void
    117117ifsim_out(struct ifsim_softc *sc, unsigned regno, uint32_t v)
    118118{
    119         out_be32(sc->pvt.base + regno, v);
     119        out_be32((volatile uint32_t *) (sc->pvt.base + regno), v);
    120120}
    121121
     
    379379                                                                 && (memcpy(&crc_net, (char*)eh + len, crc_len),
    380380                                                                (crc = (ether_crc32_le((uint8_t *)eh, len) ^ 0xffffffff)) != crc_net) ) {
    381                                                                 printk("CSUM: me 0x%08X, them 0x%08x\n", crc, crc_net);
     381                                                                printk("CSUM: me 0x%08" PRIx32 ", them 0x%08" PRIx32 "\n", crc, crc_net);
    382382                                                                sc->pvt.rx_cserrs++;
    383383                                                        } else {
  • c/src/lib/libbsp/powerpc/shared/openpic/openpic.c

    r7a462cc r73f8d93  
    2626#include <libcpu/byteorder.h>
    2727#include <rtems/bspIo.h>
     28#include <inttypes.h>
    2829
    2930#ifndef NULL
     
    7374#define check_arg_irq(irq) \
    7475    if (irq < 0 || irq >= NumSources) \
    75         printk("openpic.c:%d: illegal irq %d from 0x%08x,[0x%08x],[[0x%08x]]\n", \
    76                __LINE__, irq, __builtin_return_address(0), \
    77                __builtin_return_address(1), __builtin_return_address(2) \
     76        printk("openpic.c:%d: illegal irq %d from 0x%08" PRIxPTR ",[0x%08" PRIxPTR "],[[0x%08" PRIxPTR "]]\n", \
     77               __LINE__, irq, (uintptr_t) __builtin_return_address(0), \
     78               (uintptr_t) __builtin_return_address(1), (uintptr_t) __builtin_return_address(2) \
    7879               );
    7980#define check_arg_cpu(cpu) \
     
    235236        }
    236237    }
    237     printk("OpenPIC Version %s (%d CPUs and %d IRQ sources) at 0x%08x\n", version,
    238            NumProcessors, NumSources, OpenPIC);
     238    printk("OpenPIC Version %s (%d CPUs and %d IRQ sources) at 0x%08" PRIuPTR "\n", version,
     239           NumProcessors, NumSources, (uintptr_t) OpenPIC);
    239240
    240241    printk("OpenPIC Vendor %d (%s), Device %d (%s), Stepping %d\n", vendorid,
  • c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c

    r7a462cc r73f8d93  
    336336
    337337  if (check_bat_index (bat_index)) {
    338     printk ("Invalid BAT index\n", bat_index);
     338    printk ("Invalid BAT index %d\n", bat_index);
    339339    return -1;
    340340  }
    341341
    342342  if ((int) (bl = check_bat_size (size)) < 0) {
    343     printk ("Invalid BAT size\n", size);
     343    printk ("Invalid BAT size %u\n", size);
    344344    return -1;
    345345  }
    346346
    347347  if (virt & (size - 1)) {
    348     printk ("BAT effective address 0x%08x misaligned (size is 0x%08x)\n",
     348    printk ("BAT effective address 0x%08lx misaligned (size is 0x%08x)\n",
    349349            virt, size);
    350350    return -1;
     
    352352
    353353  if (phys & (size - 1)) {
    354     printk ("BAT physical address 0x%08x misaligned (size is 0x%08x)\n", phys,
     354    printk ("BAT physical address 0x%08lx misaligned (size is 0x%08x)\n", phys,
    355355            size);
    356356    return -1;
     
    358358
    359359  if (virt + size - 1 < virt) {
    360     printk ("BAT range invalid: wraps around zero 0x%08x..0x%08x\n", virt,
     360    printk ("BAT range invalid: wraps around zero 0x%08lx..0x%08lx\n", virt,
    361361            virt + size - 1);
    362362    return -1;
     
    384384  if ((size >= (1 << 17)) && (err >= 0) && (err != bat_index)) {
    385385    rtems_interrupt_enable (level);
    386     printk ("BATs must not overlap; area 0x%08x..0x%08x hits %cBAT %i\n",
     386    printk ("BATs must not overlap; area 0x%08lx..0x%08lx hits %cBAT %i\n",
    387387            virt, virt + size, (TYP_I == typ ? 'I' : 'D'), err);
    388388    return -1;
     
    496496    b.words.u = u;
    497497    b.words.l = l;
    498     printk ("Raw %cBAT %i contents; UPPER: (0x%08x)", (TYP_I == typ ? 'I' : 'D'), idx, u);
     498    printk ("Raw %cBAT %i contents; UPPER: (0x%08lx)", (TYP_I == typ ? 'I' : 'D'), idx, u);
    499499    printk (" BEPI: 0x%08x", b.bat.batu.bepi);
    500     printk (" BL: 0x%08x", (u >> 2) & ((1 << 15) - 1));
     500    printk (" BL: 0x%08lx", (u >> 2) & ((1 << 15) - 1));
    501501    printk (" VS: 0b%i", b.bat.batu.vs);
    502502    printk (" VP: 0b%i", b.bat.batu.vp);
    503503    printk ("\n");
    504     printk ("                     LOWER: (0x%08x)", l);
     504    printk ("                     LOWER: (0x%08lx)", l);
    505505    printk ("  RPN: 0x%08x", b.bat.batl.brpn);
    506506    printk (" wimg:   0b%1i%1i%1i%1i", b.bat.batl.w, b.bat.batl.i,
     
    510510    printk ("Covering EA Range: ");
    511511    if (bat_in_use[typ] & (1 << idx))
    512       printk ("0x%08x .. 0x%08x\n", bat_addrs[typ][idx].start,
     512      printk ("0x%08lx .. 0x%08lx\n", bat_addrs[typ][idx].start,
    513513              bat_addrs[typ][idx].limit);
    514514    else
  • c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c

    r7a462cc r73f8d93  
    183183#ifdef __rtems__
    184184/* must not use printf until multitasking is up */
    185 typedef void (*PrintF) (const char *, ...);
     185typedef int (*PrintF) (const char *, ...);
    186186static PrintF
    187187whatPrintf (void)
    188188{
    189   return _Thread_Executing ? (PrintF) printf : printk;
     189  return _Thread_Executing ? printf : printk;
    190190}
    191191
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_print.c

    r7a462cc r73f8d93  
    2121
    2222#include <rtems/score/threaddispatch.h>
     23
     24#include <inttypes.h>
    2325
    2426#ifndef __SPE__
     
    6668  printk("Stack Trace: \n  ");
    6769  if (excPtr) {
    68     printk("IP: 0x%08x, ", excPtr->EXC_SRR0);
     70    printk("IP: 0x%08" PRIu32 ", ", excPtr->EXC_SRR0);
    6971    sp = (LRFrame) GET_GPR(excPtr->GPR1);
    7072    lr = (void *) excPtr->EXC_LR;
     
    7476    lr = (LRFrame) ppc_link_register();
    7577  }
    76   printk("LR: 0x%08x\n", lr);
     78  printk("LR: 0x%08" PRIuPTR "\n", (uintptr_t) lr);
    7779  for (f = (LRFrame) sp, i = 0; f->frameLink && i < STACK_CLAMP; f = f->frameLink) {
    78     printk("--^ 0x%08x", (long) (f->frameLink->lr));
     80    printk("--^ 0x%08" PRIuPTR "", (uintptr_t) (f->frameLink->lr));
    7981    if (!(++i % 5))
    8082      printk("\n");
     
    9597
    9698  printk("exception vector %d (0x%x)\n", n, n);
    97   printk("  next PC or address of fault = 0x%08x\n", excPtr->EXC_SRR0);
    98   printk("  saved MSR = 0x%08x\n", excPtr->EXC_SRR1);
     99  printk("  next PC or address of fault = 0x%08" PRIu32 "\n", excPtr->EXC_SRR0);
     100  printk("  saved MSR = 0x%08" PRIu32 "\n", excPtr->EXC_SRR1);
    99101
    100102  /* Try to find out more about the context where this happened */
    101103  printk(
    102     "  context = %s, ISR nest level = %u\n",
     104    "  context = %s, ISR nest level = %" PRIu32 "\n",
    103105    _ISR_Nest_level == 0 ? "task" : "interrupt",
    104106    _ISR_Nest_level
    105107  );
    106108  printk(
    107     "  thread dispatch disable level = %u\n",
     109    "  thread dispatch disable level = %" PRIu32 "\n",
    108110    _Thread_Dispatch_disable_level
    109111  );
     
    111113  /* Dump registers */
    112114
    113   printk("  R0  = 0x%08x", GET_GPR(excPtr->GPR0));
     115  printk("  R0  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR0));
    114116  if (synch) {
    115     printk(" R1  = 0x%08x", GET_GPR(excPtr->GPR1));
    116     printk(" R2  = 0x%08x", GET_GPR(excPtr->GPR2));
     117    printk(" R1  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR1));
     118    printk(" R2  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR2));
    117119  } else {
    118120    printk("               ");
    119121    printk("               ");
    120122  }
    121   printk(" R3  = 0x%08x\n", GET_GPR(excPtr->GPR3));
    122   printk("  R4  = 0x%08x", GET_GPR(excPtr->GPR4));
    123   printk(" R5  = 0x%08x", GET_GPR(excPtr->GPR5));
    124   printk(" R6  = 0x%08x", GET_GPR(excPtr->GPR6));
    125   printk(" R7  = 0x%08x\n", GET_GPR(excPtr->GPR7));
    126   printk("  R8  = 0x%08x", GET_GPR(excPtr->GPR8));
    127   printk(" R9  = 0x%08x", GET_GPR(excPtr->GPR9));
    128   printk(" R10 = 0x%08x", GET_GPR(excPtr->GPR10));
    129   printk(" R11 = 0x%08x\n", GET_GPR(excPtr->GPR11));
    130   printk("  R12 = 0x%08x", GET_GPR(excPtr->GPR12));
     123  printk(" R3  = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR3));
     124  printk("  R4  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR4));
     125  printk(" R5  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR5));
     126  printk(" R6  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR6));
     127  printk(" R7  = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR7));
     128  printk("  R8  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR8));
     129  printk(" R9  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR9));
     130  printk(" R10 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR10));
     131  printk(" R11 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR11));
     132  printk("  R12 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR12));
    131133  if (synch) {
    132     printk(" R13 = 0x%08x", GET_GPR(excPtr->GPR13));
    133     printk(" R14 = 0x%08x", GET_GPR(excPtr->GPR14));
    134     printk(" R15 = 0x%08x\n", GET_GPR(excPtr->GPR15));
    135     printk("  R16 = 0x%08x", GET_GPR(excPtr->GPR16));
    136     printk(" R17 = 0x%08x", GET_GPR(excPtr->GPR17));
    137     printk(" R18 = 0x%08x", GET_GPR(excPtr->GPR18));
    138     printk(" R19 = 0x%08x\n", GET_GPR(excPtr->GPR19));
    139     printk("  R20 = 0x%08x", GET_GPR(excPtr->GPR20));
    140     printk(" R21 = 0x%08x", GET_GPR(excPtr->GPR21));
    141     printk(" R22 = 0x%08x", GET_GPR(excPtr->GPR22));
    142     printk(" R23 = 0x%08x\n", GET_GPR(excPtr->GPR23));
    143     printk("  R24 = 0x%08x", GET_GPR(excPtr->GPR24));
    144     printk(" R25 = 0x%08x", GET_GPR(excPtr->GPR25));
    145     printk(" R26 = 0x%08x", GET_GPR(excPtr->GPR26));
    146     printk(" R27 = 0x%08x\n", GET_GPR(excPtr->GPR27));
    147     printk("  R28 = 0x%08x", GET_GPR(excPtr->GPR28));
    148     printk(" R29 = 0x%08x", GET_GPR(excPtr->GPR29));
    149     printk(" R30 = 0x%08x", GET_GPR(excPtr->GPR30));
    150     printk(" R31 = 0x%08x\n", GET_GPR(excPtr->GPR31));
     134    printk(" R13 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR13));
     135    printk(" R14 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR14));
     136    printk(" R15 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR15));
     137    printk("  R16 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR16));
     138    printk(" R17 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR17));
     139    printk(" R18 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR18));
     140    printk(" R19 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR19));
     141    printk("  R20 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR20));
     142    printk(" R21 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR21));
     143    printk(" R22 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR22));
     144    printk(" R23 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR23));
     145    printk("  R24 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR24));
     146    printk(" R25 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR25));
     147    printk(" R26 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR26));
     148    printk(" R27 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR27));
     149    printk("  R28 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR28));
     150    printk(" R29 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR29));
     151    printk(" R30 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR30));
     152    printk(" R31 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR31));
    151153  } else {
    152154    printk("\n");
    153155  }
    154   printk("  CR  = 0x%08x\n", excPtr->EXC_CR);
    155   printk("  CTR = 0x%08x\n", excPtr->EXC_CTR);
    156   printk("  XER = 0x%08x\n", excPtr->EXC_XER);
    157   printk("  LR  = 0x%08x\n", excPtr->EXC_LR);
     156  printk("  CR  = 0x%08" PRIu32 "\n", excPtr->EXC_CR);
     157  printk("  CTR = 0x%08" PRIu32 "\n", excPtr->EXC_CTR);
     158  printk("  XER = 0x%08" PRIu32 "\n", excPtr->EXC_XER);
     159  printk("  LR  = 0x%08" PRIu32 "\n", excPtr->EXC_LR);
    158160
    159161  /* Would be great to print DAR but unfortunately,
     
    165167  if (ppc_exc_get_DAR != NULL) {
    166168    char* reg = ppc_cpu_is_60x() ? " DAR" : "DEAR";
    167     printk(" %s = 0x%08x\n", reg, ppc_exc_get_DAR());
     169    printk(" %s = 0x%08" PRIu32 "\n", reg, ppc_exc_get_DAR());
    168170  }
    169171  if (ppc_cpu_is_bookE()) {
     
    220222
    221223    printk(
    222       "  executing thread ID = 0x%08x, name = %c%c%c%c\n",
     224      "  executing thread ID = 0x%08" PRIx32 ", name = %c%c%c%c\n",
    223225      executing->Object.id,
    224226      name [0],
  • c/src/lib/libcpu/powerpc/shared/src/stack.c

    r7a462cc r73f8d93  
    22#include <rtems/bspIo.h>
    33#include <libcpu/spr.h>
     4#include <inttypes.h>
    45
    56SPR_RO(PPC_LR)
     
    3738                if (i%5) printk("--> ");
    3839                else     printk("\n");
    39                 printk("0x%08x",stck[i]);
     40                printk("0x%08" PRIuPTR, (uintptr_t)stck[i]);
    4041        }
    4142        printk("\n");
Note: See TracChangeset for help on using the changeset viewer.