Index: c/src/lib/libbsp/powerpc/psim/network/if_sim.c
===================================================================
--- c/src/lib/libbsp/powerpc/psim/network/if_sim.c	(revision 7a462cc60d5361131a8844d79d1bcbc10bb6fc2e)
+++ c/src/lib/libbsp/powerpc/psim/network/if_sim.c	(revision 73f8d938474d04013d785f5918d75b9d82c80ca3)
@@ -108,14 +108,14 @@
 rtems_id           ifsim_tid = 0;
 
-__inline__ uint32_t
+static __inline__ uint32_t
 ifsim_in(struct ifsim_softc *sc, unsigned regno)
 {
-	return in_be32( sc->pvt.base + regno );
-}
-
-__inline__ void
+	return in_be32((volatile uint32_t *) (sc->pvt.base + regno));
+}
+
+static __inline__ void
 ifsim_out(struct ifsim_softc *sc, unsigned regno, uint32_t v)
 {
-	out_be32(sc->pvt.base + regno, v);
+	out_be32((volatile uint32_t *) (sc->pvt.base + regno), v);
 }
 
@@ -379,5 +379,5 @@
 								 && (memcpy(&crc_net, (char*)eh + len, crc_len),
 							        (crc = (ether_crc32_le((uint8_t *)eh, len) ^ 0xffffffff)) != crc_net) ) {
-								printk("CSUM: me 0x%08X, them 0x%08x\n", crc, crc_net);
+								printk("CSUM: me 0x%08" PRIx32 ", them 0x%08" PRIx32 "\n", crc, crc_net);
 								sc->pvt.rx_cserrs++;
 							} else {
Index: c/src/lib/libbsp/powerpc/shared/openpic/openpic.c
===================================================================
--- c/src/lib/libbsp/powerpc/shared/openpic/openpic.c	(revision 7a462cc60d5361131a8844d79d1bcbc10bb6fc2e)
+++ c/src/lib/libbsp/powerpc/shared/openpic/openpic.c	(revision 73f8d938474d04013d785f5918d75b9d82c80ca3)
@@ -26,4 +26,5 @@
 #include <libcpu/byteorder.h>
 #include <rtems/bspIo.h>
+#include <inttypes.h>
 
 #ifndef NULL
@@ -73,7 +74,7 @@
 #define check_arg_irq(irq) \
     if (irq < 0 || irq >= NumSources) \
-	printk("openpic.c:%d: illegal irq %d from 0x%08x,[0x%08x],[[0x%08x]]\n", \
-	       __LINE__, irq, __builtin_return_address(0), \
-	       __builtin_return_address(1), __builtin_return_address(2) \
+	printk("openpic.c:%d: illegal irq %d from 0x%08" PRIxPTR ",[0x%08" PRIxPTR "],[[0x%08" PRIxPTR "]]\n", \
+	       __LINE__, irq, (uintptr_t) __builtin_return_address(0), \
+	       (uintptr_t) __builtin_return_address(1), (uintptr_t) __builtin_return_address(2) \
 	       );
 #define check_arg_cpu(cpu) \
@@ -235,6 +236,6 @@
 	}
     }
-    printk("OpenPIC Version %s (%d CPUs and %d IRQ sources) at 0x%08x\n", version,
-	   NumProcessors, NumSources, OpenPIC);
+    printk("OpenPIC Version %s (%d CPUs and %d IRQ sources) at 0x%08" PRIuPTR "\n", version,
+	   NumProcessors, NumSources, (uintptr_t) OpenPIC);
 
     printk("OpenPIC Vendor %d (%s), Device %d (%s), Stepping %d\n", vendorid,
Index: c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c
===================================================================
--- c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c	(revision 7a462cc60d5361131a8844d79d1bcbc10bb6fc2e)
+++ c/src/lib/libcpu/powerpc/mpc6xx/mmu/bat.c	(revision 73f8d938474d04013d785f5918d75b9d82c80ca3)
@@ -336,15 +336,15 @@
 
   if (check_bat_index (bat_index)) {
-    printk ("Invalid BAT index\n", bat_index);
+    printk ("Invalid BAT index %d\n", bat_index);
     return -1;
   }
 
   if ((int) (bl = check_bat_size (size)) < 0) {
-    printk ("Invalid BAT size\n", size);
+    printk ("Invalid BAT size %u\n", size);
     return -1;
   }
 
   if (virt & (size - 1)) {
-    printk ("BAT effective address 0x%08x misaligned (size is 0x%08x)\n",
+    printk ("BAT effective address 0x%08lx misaligned (size is 0x%08x)\n",
             virt, size);
     return -1;
@@ -352,5 +352,5 @@
 
   if (phys & (size - 1)) {
-    printk ("BAT physical address 0x%08x misaligned (size is 0x%08x)\n", phys,
+    printk ("BAT physical address 0x%08lx misaligned (size is 0x%08x)\n", phys,
             size);
     return -1;
@@ -358,5 +358,5 @@
 
   if (virt + size - 1 < virt) {
-    printk ("BAT range invalid: wraps around zero 0x%08x..0x%08x\n", virt,
+    printk ("BAT range invalid: wraps around zero 0x%08lx..0x%08lx\n", virt,
             virt + size - 1);
     return -1;
@@ -384,5 +384,5 @@
   if ((size >= (1 << 17)) && (err >= 0) && (err != bat_index)) {
     rtems_interrupt_enable (level);
-    printk ("BATs must not overlap; area 0x%08x..0x%08x hits %cBAT %i\n",
+    printk ("BATs must not overlap; area 0x%08lx..0x%08lx hits %cBAT %i\n",
             virt, virt + size, (TYP_I == typ ? 'I' : 'D'), err);
     return -1;
@@ -496,11 +496,11 @@
     b.words.u = u;
     b.words.l = l;
-    printk ("Raw %cBAT %i contents; UPPER: (0x%08x)", (TYP_I == typ ? 'I' : 'D'), idx, u);
+    printk ("Raw %cBAT %i contents; UPPER: (0x%08lx)", (TYP_I == typ ? 'I' : 'D'), idx, u);
     printk (" BEPI: 0x%08x", b.bat.batu.bepi);
-    printk (" BL: 0x%08x", (u >> 2) & ((1 << 15) - 1));
+    printk (" BL: 0x%08lx", (u >> 2) & ((1 << 15) - 1));
     printk (" VS: 0b%i", b.bat.batu.vs);
     printk (" VP: 0b%i", b.bat.batu.vp);
     printk ("\n");
-    printk ("                     LOWER: (0x%08x)", l);
+    printk ("                     LOWER: (0x%08lx)", l);
     printk ("  RPN: 0x%08x", b.bat.batl.brpn);
     printk (" wimg:   0b%1i%1i%1i%1i", b.bat.batl.w, b.bat.batl.i,
@@ -510,5 +510,5 @@
     printk ("Covering EA Range: ");
     if (bat_in_use[typ] & (1 << idx))
-      printk ("0x%08x .. 0x%08x\n", bat_addrs[typ][idx].start,
+      printk ("0x%08lx .. 0x%08lx\n", bat_addrs[typ][idx].start,
               bat_addrs[typ][idx].limit);
     else
Index: c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c
===================================================================
--- c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c	(revision 7a462cc60d5361131a8844d79d1bcbc10bb6fc2e)
+++ c/src/lib/libcpu/powerpc/mpc6xx/mmu/pte121.c	(revision 73f8d938474d04013d785f5918d75b9d82c80ca3)
@@ -183,9 +183,9 @@
 #ifdef __rtems__
 /* must not use printf until multitasking is up */
-typedef void (*PrintF) (const char *, ...);
+typedef int (*PrintF) (const char *, ...);
 static PrintF
 whatPrintf (void)
 {
-  return _Thread_Executing ? (PrintF) printf : printk;
+  return _Thread_Executing ? printf : printk;
 }
 
Index: c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_print.c
===================================================================
--- c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_print.c	(revision 7a462cc60d5361131a8844d79d1bcbc10bb6fc2e)
+++ c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_print.c	(revision 73f8d938474d04013d785f5918d75b9d82c80ca3)
@@ -21,4 +21,6 @@
 
 #include <rtems/score/threaddispatch.h>
+
+#include <inttypes.h>
 
 #ifndef __SPE__
@@ -66,5 +68,5 @@
   printk("Stack Trace: \n  ");
   if (excPtr) {
-    printk("IP: 0x%08x, ", excPtr->EXC_SRR0);
+    printk("IP: 0x%08" PRIu32 ", ", excPtr->EXC_SRR0);
     sp = (LRFrame) GET_GPR(excPtr->GPR1);
     lr = (void *) excPtr->EXC_LR;
@@ -74,7 +76,7 @@
     lr = (LRFrame) ppc_link_register();
   }
-  printk("LR: 0x%08x\n", lr);
+  printk("LR: 0x%08" PRIuPTR "\n", (uintptr_t) lr);
   for (f = (LRFrame) sp, i = 0; f->frameLink && i < STACK_CLAMP; f = f->frameLink) {
-    printk("--^ 0x%08x", (long) (f->frameLink->lr));
+    printk("--^ 0x%08" PRIuPTR "", (uintptr_t) (f->frameLink->lr));
     if (!(++i % 5))
       printk("\n");
@@ -95,15 +97,15 @@
 
   printk("exception vector %d (0x%x)\n", n, n);
-  printk("  next PC or address of fault = 0x%08x\n", excPtr->EXC_SRR0);
-  printk("  saved MSR = 0x%08x\n", excPtr->EXC_SRR1);
+  printk("  next PC or address of fault = 0x%08" PRIu32 "\n", excPtr->EXC_SRR0);
+  printk("  saved MSR = 0x%08" PRIu32 "\n", excPtr->EXC_SRR1);
 
   /* Try to find out more about the context where this happened */
   printk(
-    "  context = %s, ISR nest level = %u\n",
+    "  context = %s, ISR nest level = %" PRIu32 "\n",
     _ISR_Nest_level == 0 ? "task" : "interrupt",
     _ISR_Nest_level
   );
   printk(
-    "  thread dispatch disable level = %u\n",
+    "  thread dispatch disable level = %" PRIu32 "\n",
     _Thread_Dispatch_disable_level
   );
@@ -111,49 +113,49 @@
   /* Dump registers */
 
-  printk("  R0  = 0x%08x", GET_GPR(excPtr->GPR0));
+  printk("  R0  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR0));
   if (synch) {
-    printk(" R1  = 0x%08x", GET_GPR(excPtr->GPR1));
-    printk(" R2  = 0x%08x", GET_GPR(excPtr->GPR2));
+    printk(" R1  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR1));
+    printk(" R2  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR2));
   } else {
     printk("               ");
     printk("               ");
   }
-  printk(" R3  = 0x%08x\n", GET_GPR(excPtr->GPR3));
-  printk("  R4  = 0x%08x", GET_GPR(excPtr->GPR4));
-  printk(" R5  = 0x%08x", GET_GPR(excPtr->GPR5));
-  printk(" R6  = 0x%08x", GET_GPR(excPtr->GPR6));
-  printk(" R7  = 0x%08x\n", GET_GPR(excPtr->GPR7));
-  printk("  R8  = 0x%08x", GET_GPR(excPtr->GPR8));
-  printk(" R9  = 0x%08x", GET_GPR(excPtr->GPR9));
-  printk(" R10 = 0x%08x", GET_GPR(excPtr->GPR10));
-  printk(" R11 = 0x%08x\n", GET_GPR(excPtr->GPR11));
-  printk("  R12 = 0x%08x", GET_GPR(excPtr->GPR12));
+  printk(" R3  = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR3));
+  printk("  R4  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR4));
+  printk(" R5  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR5));
+  printk(" R6  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR6));
+  printk(" R7  = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR7));
+  printk("  R8  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR8));
+  printk(" R9  = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR9));
+  printk(" R10 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR10));
+  printk(" R11 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR11));
+  printk("  R12 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR12));
   if (synch) {
-    printk(" R13 = 0x%08x", GET_GPR(excPtr->GPR13));
-    printk(" R14 = 0x%08x", GET_GPR(excPtr->GPR14));
-    printk(" R15 = 0x%08x\n", GET_GPR(excPtr->GPR15));
-    printk("  R16 = 0x%08x", GET_GPR(excPtr->GPR16));
-    printk(" R17 = 0x%08x", GET_GPR(excPtr->GPR17));
-    printk(" R18 = 0x%08x", GET_GPR(excPtr->GPR18));
-    printk(" R19 = 0x%08x\n", GET_GPR(excPtr->GPR19));
-    printk("  R20 = 0x%08x", GET_GPR(excPtr->GPR20));
-    printk(" R21 = 0x%08x", GET_GPR(excPtr->GPR21));
-    printk(" R22 = 0x%08x", GET_GPR(excPtr->GPR22));
-    printk(" R23 = 0x%08x\n", GET_GPR(excPtr->GPR23));
-    printk("  R24 = 0x%08x", GET_GPR(excPtr->GPR24));
-    printk(" R25 = 0x%08x", GET_GPR(excPtr->GPR25));
-    printk(" R26 = 0x%08x", GET_GPR(excPtr->GPR26));
-    printk(" R27 = 0x%08x\n", GET_GPR(excPtr->GPR27));
-    printk("  R28 = 0x%08x", GET_GPR(excPtr->GPR28));
-    printk(" R29 = 0x%08x", GET_GPR(excPtr->GPR29));
-    printk(" R30 = 0x%08x", GET_GPR(excPtr->GPR30));
-    printk(" R31 = 0x%08x\n", GET_GPR(excPtr->GPR31));
+    printk(" R13 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR13));
+    printk(" R14 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR14));
+    printk(" R15 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR15));
+    printk("  R16 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR16));
+    printk(" R17 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR17));
+    printk(" R18 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR18));
+    printk(" R19 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR19));
+    printk("  R20 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR20));
+    printk(" R21 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR21));
+    printk(" R22 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR22));
+    printk(" R23 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR23));
+    printk("  R24 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR24));
+    printk(" R25 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR25));
+    printk(" R26 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR26));
+    printk(" R27 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR27));
+    printk("  R28 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR28));
+    printk(" R29 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR29));
+    printk(" R30 = 0x%08" PRIu32 "", GET_GPR(excPtr->GPR30));
+    printk(" R31 = 0x%08" PRIu32 "\n", GET_GPR(excPtr->GPR31));
   } else {
     printk("\n");
   }
-  printk("  CR  = 0x%08x\n", excPtr->EXC_CR);
-  printk("  CTR = 0x%08x\n", excPtr->EXC_CTR);
-  printk("  XER = 0x%08x\n", excPtr->EXC_XER);
-  printk("  LR  = 0x%08x\n", excPtr->EXC_LR);
+  printk("  CR  = 0x%08" PRIu32 "\n", excPtr->EXC_CR);
+  printk("  CTR = 0x%08" PRIu32 "\n", excPtr->EXC_CTR);
+  printk("  XER = 0x%08" PRIu32 "\n", excPtr->EXC_XER);
+  printk("  LR  = 0x%08" PRIu32 "\n", excPtr->EXC_LR);
 
   /* Would be great to print DAR but unfortunately,
@@ -165,5 +167,5 @@
   if (ppc_exc_get_DAR != NULL) {
     char* reg = ppc_cpu_is_60x() ? " DAR" : "DEAR";
-    printk(" %s = 0x%08x\n", reg, ppc_exc_get_DAR());
+    printk(" %s = 0x%08" PRIu32 "\n", reg, ppc_exc_get_DAR());
   }
   if (ppc_cpu_is_bookE()) {
@@ -220,5 +222,5 @@
 
     printk(
-      "  executing thread ID = 0x%08x, name = %c%c%c%c\n",
+      "  executing thread ID = 0x%08" PRIx32 ", name = %c%c%c%c\n",
       executing->Object.id,
       name [0],
Index: c/src/lib/libcpu/powerpc/shared/src/stack.c
===================================================================
--- c/src/lib/libcpu/powerpc/shared/src/stack.c	(revision 7a462cc60d5361131a8844d79d1bcbc10bb6fc2e)
+++ c/src/lib/libcpu/powerpc/shared/src/stack.c	(revision 73f8d938474d04013d785f5918d75b9d82c80ca3)
@@ -2,4 +2,5 @@
 #include <rtems/bspIo.h>
 #include <libcpu/spr.h>
+#include <inttypes.h>
 
 SPR_RO(PPC_LR)
@@ -37,5 +38,5 @@
                 if (i%5) printk("--> ");
                 else     printk("\n");
-                printk("0x%08x",stck[i]);
+                printk("0x%08" PRIuPTR, (uintptr_t)stck[i]);
 	}
 	printk("\n");
