[rtems commit] bsps/sparc: Fix warnings

Sebastian Huber sebh at rtems.org
Wed Feb 15 12:06:25 UTC 2017


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Feb 15 12:57:56 2017 +0100

bsps/sparc: Fix warnings

---

 c/src/lib/libbsp/sparc/erc32/startup/spurious.c |  9 +++++++--
 c/src/lib/libbsp/sparc/leon2/startup/spurious.c |  7 ++++++-
 c/src/lib/libbsp/sparc/leon3/startup/spurious.c | 13 ++++++-------
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/erc32/startup/spurious.c b/c/src/lib/libbsp/sparc/erc32/startup/spurious.c
index ac46aac..4e52892 100644
--- a/c/src/lib/libbsp/sparc/erc32/startup/spurious.c
+++ b/c/src/lib/libbsp/sparc/erc32/startup/spurious.c
@@ -15,6 +15,7 @@
 
 #include <bsp.h>
 #include <rtems/bspIo.h>
+#include <inttypes.h>
 
 void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
 {
@@ -26,7 +27,11 @@ void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
   real_trap = SPARC_REAL_TRAP_NUMBER(trap);
   isf = frame->isf;
 
-  printk( "Unexpected trap (%2d) at address 0x%08x\n", real_trap, isf->tpc);
+  printk(
+    "Unexpected trap (%2" PRId32 ") at address 0x%08" PRIx32 "\n",
+    real_trap,
+    isf->tpc
+  );
 
   switch (real_trap) {
 
@@ -56,7 +61,7 @@ void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
       printk( "fp exception\n" );
       break;
     case 0x09:
-      printk("data access exception at 0x%08x\n",
+      printk("data access exception at 0x%08" PRIx32 "\n",
         ERC32_MEC.First_Failing_Address );
       break;
     case 0x0A:
diff --git a/c/src/lib/libbsp/sparc/leon2/startup/spurious.c b/c/src/lib/libbsp/sparc/leon2/startup/spurious.c
index 819e6d4..a4cd1fa 100644
--- a/c/src/lib/libbsp/sparc/leon2/startup/spurious.c
+++ b/c/src/lib/libbsp/sparc/leon2/startup/spurious.c
@@ -21,6 +21,7 @@
 
 #include <bsp.h>
 #include <rtems/bspIo.h>
+#include <inttypes.h>
 
 void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
 {
@@ -32,7 +33,11 @@ void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
   real_trap = SPARC_REAL_TRAP_NUMBER(trap);
   isf = frame->isf;
 
-  printk( "Unexpected trap (%2d) at address 0x%08x\n", real_trap, isf->tpc);
+  printk(
+    "Unexpected trap (%2" PRId32 ") at address 0x%08" PRIx32 "\n",
+    real_trap,
+    isf->tpc
+  );
 
   switch (real_trap) {
 
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/spurious.c b/c/src/lib/libbsp/sparc/leon3/startup/spurious.c
index 39ceacf..647ecd0 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/spurious.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/spurious.c
@@ -20,6 +20,7 @@
 #include <bsp.h>
 #include <rtems/score/cpu.h>
 #include <rtems/bspIo.h>
+#include <inttypes.h>
 
 void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
 {
@@ -31,7 +32,11 @@ void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
   real_trap = SPARC_REAL_TRAP_NUMBER(trap);
   isf = frame->isf;
 
-  printk( "Unexpected trap (0x%02x) at address 0x%08x\n", real_trap, isf->tpc);
+  printk(
+    "Unexpected trap (%2" PRId32 ") at address 0x%08" PRIx32 "\n",
+    real_trap,
+    isf->tpc
+  );
 
   switch (real_trap) {
 
@@ -60,12 +65,6 @@ void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
     case 0x08:
       printk( "fp exception\n" );
       break;
-    case 0x09:
-      printk( "Unexpected trap (0x%2d) at address XXX\n",
-        real_trap
-        /* XXX FIXME isf->tpc */
-      );
-      break;
     case 0x0A:
       printk( "tag overflow\n" );
       break;



More information about the vc mailing list