[rtems commit] bsps/powerpc: Fix warnings

Sebastian Huber sebh at rtems.org
Wed Feb 15 12:51:47 UTC 2017


Module:    rtems
Branch:    master
Commit:    6afeedaa713a8c8084b0877f91d6786404c593ed
Changeset: http://git.rtems.org/rtems/commit/?id=6afeedaa713a8c8084b0877f91d6786404c593ed

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Feb 15 13:39:02 2017 +0100

bsps/powerpc: Fix warnings

---

 .../powerpc/mvme5500/pci/detect_host_bridge.c      |  5 +-
 .../powerpc/mvme5500/vectors/exceptionhandler.c    | 82 +++++++++++-----------
 .../libbsp/powerpc/shared/startup/probeMemEnd.c    |  3 +-
 c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c  |  4 +-
 4 files changed, 48 insertions(+), 46 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/mvme5500/pci/detect_host_bridge.c b/c/src/lib/libbsp/powerpc/mvme5500/pci/detect_host_bridge.c
index 6d75b65..3bd5b00 100644
--- a/c/src/lib/libbsp/powerpc/mvme5500/pci/detect_host_bridge.c
+++ b/c/src/lib/libbsp/powerpc/mvme5500/pci/detect_host_bridge.c
@@ -18,6 +18,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <inttypes.h>
 
 #define PCI_DEBUG 0
 
@@ -41,7 +42,7 @@ unsigned long _BSP_clear_hostbridge_errors(int enableMCP, int quiet)
                         &pcidata);
 
     if (!quiet)
-    printk("Before _BSP_clear_hostbridge_errors(): 0x%x, cause 0x%x\n",
+    printk("Before _BSP_clear_hostbridge_errors(): 0x%" PRIx32 ", cause 0x%lx\n",
 	   pcidata, inl(0x1d58));
 
     outl(0,0x1d58);
@@ -62,7 +63,7 @@ unsigned long _BSP_clear_hostbridge_errors(int enableMCP, int quiet)
 			  PCI_COMMAND,
                           &pcidata1);
 
-    if (!quiet) printk("After _BSP_clear_hostbridge_errors(): sts 0x%x\n",
+    if (!quiet) printk("After _BSP_clear_hostbridge_errors(): sts 0x%" PRIx32 "\n",
                         pcidata1);
     if (pcidata1 & HOSTBRIDGET_ERROR) printk("BSP_clear_hostbridge_errors(): unable to clear pending hostbridge errors\n");
     busNumber += BSP_MAX_PCI_BUS_ON_PCI0;
diff --git a/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c b/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c
index f8f124e..70f66b0 100644
--- a/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c
+++ b/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c
@@ -54,6 +54,7 @@
 #include <rtems/bspIo.h>
 #include <rtems/score/percpu.h>
 #include <threads.h>
+#include <inttypes.h>
 
 #include <bsp/bspException.h>
 
@@ -74,7 +75,6 @@ volatile BSP_ExceptionExtension	test;
 void
 BSP_exceptionHandler(BSP_Exception_frame* excPtr)
 {
-uint32_t	note;
 BSP_ExceptionExtension	ext=0;
 rtems_id		id=0;
 int			recoverable = 0;
@@ -96,7 +96,7 @@ int			quiet=0;
 	   if (ext)
 	       quiet=ext->quiet;
 	   if (!quiet) {
-	      printk("Task (Id 0x%08x) got ",id);
+	      printk("Task (Id 0x%08" PRIx32 ") got ",id);
 	   }
 	   fmt="exception %d\n";
 	}
@@ -112,44 +112,44 @@ int			quiet=0;
        /* message about exception */
        printk(fmt, excPtr->_EXC_number);
        /* register dump */
-       printk("\t Next PC or Address of fault = %x, ", excPtr->EXC_SRR0);
-       printk("Mvme5500 Saved MSR = %x\n", excPtr->EXC_SRR1);
-       printk("\t R0  = %08x", excPtr->GPR0);
-       printk(" R1  = %08x", excPtr->GPR1);
-       printk(" R2  = %08x", excPtr->GPR2);
-       printk(" R3  = %08x\n", excPtr->GPR3);
-       printk("\t R4  = %08x", excPtr->GPR4);
-       printk(" R5  = %08x", excPtr->GPR5);
-       printk(" R6  = %08x", excPtr->GPR6);
-       printk(" R7  = %08x\n", excPtr->GPR7);
-       printk("\t R8  = %08x", excPtr->GPR8);
-       printk(" R9  = %08x", excPtr->GPR9);
-       printk(" R10 = %08x", excPtr->GPR10);
-       printk(" R11 = %08x\n", excPtr->GPR11);
-       printk("\t R12 = %08x", excPtr->GPR12);
-       printk(" R13 = %08x", excPtr->GPR13);
-       printk(" R14 = %08x", excPtr->GPR14);
-       printk(" R15 = %08x\n", excPtr->GPR15);
-       printk("\t R16 = %08x", excPtr->GPR16);
-       printk(" R17 = %08x", excPtr->GPR17);
-       printk(" R18 = %08x", excPtr->GPR18);
-       printk(" R19 = %08x\n", excPtr->GPR19);
-       printk("\t R20 = %08x", excPtr->GPR20);
-       printk(" R21 = %08x", excPtr->GPR21);
-       printk(" R22 = %08x", excPtr->GPR22);
-       printk(" R23 = %08x\n", excPtr->GPR23);
-       printk("\t R24 = %08x", excPtr->GPR24);
-       printk(" R25 = %08x", excPtr->GPR25);
-       printk(" R26 = %08x", excPtr->GPR26);
-       printk(" R27 = %08x\n", excPtr->GPR27);
-       printk("\t R28 = %08x", excPtr->GPR28);
-       printk(" R29 = %08x", excPtr->GPR29);
-       printk(" R30 = %08x", excPtr->GPR30);
-       printk(" R31 = %08x\n", excPtr->GPR31);
-       printk("\t CR  = %08x\n", excPtr->EXC_CR);
-       printk("\t CTR = %08x\n", excPtr->EXC_CTR);
-       printk("\t XER = %08x\n", excPtr->EXC_XER);
-       printk("\t LR  = %08x\n", excPtr->EXC_LR);
+       printk("\t Next PC or Address of fault = %" PRIx32 ", ", excPtr->EXC_SRR0);
+       printk("Mvme5500 Saved MSR = %" PRIx32 "\n", excPtr->EXC_SRR1);
+       printk("\t R0  = %08" PRIx32, excPtr->GPR0);
+       printk(" R1  = %08" PRIx32, excPtr->GPR1);
+       printk(" R2  = %08" PRIx32, excPtr->GPR2);
+       printk(" R3  = %08" PRIx32 "\n", excPtr->GPR3);
+       printk("\t R4  = %08" PRIx32, excPtr->GPR4);
+       printk(" R5  = %08" PRIx32, excPtr->GPR5);
+       printk(" R6  = %08" PRIx32, excPtr->GPR6);
+       printk(" R7  = %08" PRIx32 "\n", excPtr->GPR7);
+       printk("\t R8  = %08" PRIx32, excPtr->GPR8);
+       printk(" R9  = %08" PRIx32, excPtr->GPR9);
+       printk(" R10 = %08" PRIx32, excPtr->GPR10);
+       printk(" R11 = %08" PRIx32 "\n", excPtr->GPR11);
+       printk("\t R12 = %08" PRIx32, excPtr->GPR12);
+       printk(" R13 = %08" PRIx32, excPtr->GPR13);
+       printk(" R14 = %08" PRIx32, excPtr->GPR14);
+       printk(" R15 = %08" PRIx32 "\n", excPtr->GPR15);
+       printk("\t R16 = %08" PRIx32, excPtr->GPR16);
+       printk(" R17 = %08" PRIx32, excPtr->GPR17);
+       printk(" R18 = %08" PRIx32, excPtr->GPR18);
+       printk(" R19 = %08" PRIx32 "\n", excPtr->GPR19);
+       printk("\t R20 = %08" PRIx32, excPtr->GPR20);
+       printk(" R21 = %08" PRIx32, excPtr->GPR21);
+       printk(" R22 = %08" PRIx32, excPtr->GPR22);
+       printk(" R23 = %08" PRIx32 "\n", excPtr->GPR23);
+       printk("\t R24 = %08" PRIx32, excPtr->GPR24);
+       printk(" R25 = %08" PRIx32, excPtr->GPR25);
+       printk(" R26 = %08" PRIx32, excPtr->GPR26);
+       printk(" R27 = %08" PRIx32 "\n", excPtr->GPR27);
+       printk("\t R28 = %08" PRIx32, excPtr->GPR28);
+       printk(" R29 = %08" PRIx32, excPtr->GPR29);
+       printk(" R30 = %08" PRIx32, excPtr->GPR30);
+       printk(" R31 = %08" PRIx32 "\n", excPtr->GPR31);
+       printk("\t CR  = %08" PRIx32 "\n", excPtr->EXC_CR);
+       printk("\t CTR = %08" PRIx32 "\n", excPtr->EXC_CTR);
+       printk("\t XER = %08" PRIx32 "\n", excPtr->EXC_XER);
+       printk("\t LR  = %08" PRIx32 "\n", excPtr->EXC_LR);
 
        BSP_printStackTrace(excPtr);
     }
@@ -211,7 +211,7 @@ int			quiet=0;
 				_write_MSR( _read_MSR() | MSR_FP );
 				__asm__ __volatile__("isync");
 			}
-			printk("unrecoverable exception!!! task %08x suspended\n",id);
+			printk("unrecoverable exception!!! task %08" PRIx32 " suspended\n",id);
 			rtems_task_suspend(id);
 		} else {
 			printk("PANIC, rebooting...\n");
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/probeMemEnd.c b/c/src/lib/libbsp/powerpc/shared/startup/probeMemEnd.c
index 8485dbf..73b85d4 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/probeMemEnd.c
+++ b/c/src/lib/libbsp/powerpc/shared/startup/probeMemEnd.c
@@ -47,6 +47,7 @@
 #include <libcpu/spr.h>
 #include <libcpu/cpuIdent.h>
 #include <rtems/bspIo.h>
+#include <inttypes.h>
 
 /* Simple memory probing routine
  *
@@ -126,7 +127,7 @@ register uint32_t v, x;
 	}
 	asm volatile("sync");
 	switch ( _read_PPC_PVR()>>16 ) {
-		default:		printk(__FILE__" CPU_lockUnlockCaches(): unknown CPU (PVR = 0x%08x)\n",_read_PPC_PVR());
+		default:		printk(__FILE__" CPU_lockUnlockCaches(): unknown CPU (PVR = 0x%08" PRIx32 ")\n",_read_PPC_PVR());
 						return -1;
 		case PPC_750:	printk("CPU_lockUnlockCaches(): Can't lock L2 on a mpc750, sorry :-(\n");
 						return -2;	/* cannot lock L2 :-( */
diff --git a/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c b/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
index 8236ee2..0914eda 100644
--- a/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
+++ b/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
@@ -1959,7 +1959,7 @@ unsigned long 		linten;
 #else
 			vmeUniverseIntDisable(lvl);
 #endif
-			printk("vmeUniverse ISR: error read from STATID register; (level: %i) STATID: 0x%08x -- DISABLING\n", lvl, status);
+			printk("vmeUniverse ISR: error read from STATID register; (level: %i) STATID: 0x%08" PRIx32 " -- DISABLING\n", lvl, status);
 		} else if (!(ip=universeHdlTbl[status & UNIV_VIRQ_STATID_MASK])) {
 #ifdef BSP_PIC_DO_EOI
 			linten &= ~msk;
@@ -1967,7 +1967,7 @@ unsigned long 		linten;
 			vmeUniverseIntDisable(lvl);
 #endif
 				/* TODO: log error message - RTEMS has no logger :-( */
-			printk("vmeUniverse ISR: no handler installed for this vector; (level: %i) STATID: 0x%08x -- DISABLING\n", lvl, status);
+			printk("vmeUniverse ISR: no handler installed for this vector; (level: %i) STATID: 0x%08" PRIx32 " -- DISABLING\n", lvl, status);
 		} else {
 				/* dispatch handler, it must clear the IRQ at the device */
 				ip->isr(ip->usrData, status&UNIV_VIRQ_STATID_MASK);



More information about the vc mailing list