[rtems commit] bsps/sparc: Fix trap table initialization

Sebastian Huber sebh at rtems.org
Fri Dec 5 10:08:42 UTC 2014


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Dec  5 11:07:02 2014 +0100

bsps/sparc: Fix trap table initialization

Fixes bug introduced with dff1803cfbec3775fff1b9c34cc707c05494dc3b.

---

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

diff --git a/c/src/lib/libbsp/sparc/erc32/startup/spurious.c b/c/src/lib/libbsp/sparc/erc32/startup/spurious.c
index 05f6efa..3d2128a 100644
--- a/c/src/lib/libbsp/sparc/erc32/startup/spurious.c
+++ b/c/src/lib/libbsp/sparc/erc32/startup/spurious.c
@@ -155,14 +155,16 @@ void bsp_spurious_initialize()
 
     /*
      *  Skip window overflow, underflow, and flush as well as software
-     *  trap 0 which we will use as a shutdown. Also avoid trap 0x70 - 0x7f
-     *  which cannot happen and where some of the space is used to pass
-     *  paramaters to the program.
+     *  trap 0,9,10 which we will use as a shutdown, IRQ disable, IRQ enable.
+     *  Also avoid trap 0x70 - 0x7f which cannot happen and where some of the
+     *  space is used to pass parameters to the program.
      */
 
     if (( trap == 5 || trap == 6 ) ||
         (( trap >= 0x11 ) && ( trap <= 0x1f )) ||
-        (( trap >= 0x70 ) && ( trap <= 0x83 )))
+        (( trap >= 0x70 ) && ( trap <= 0x83 )) ||
+        ( trap == 0x80 + SPARC_SWTRAP_IRQDIS ) ||
+        ( trap == 0x80 + SPARC_SWTRAP_IRQEN ))
       continue;
 
     set_vector( (rtems_isr_entry) bsp_spurious_handler,
diff --git a/c/src/lib/libbsp/sparc/leon2/startup/spurious.c b/c/src/lib/libbsp/sparc/leon2/startup/spurious.c
index 6b43a39..43435d9 100644
--- a/c/src/lib/libbsp/sparc/leon2/startup/spurious.c
+++ b/c/src/lib/libbsp/sparc/leon2/startup/spurious.c
@@ -142,14 +142,16 @@ void bsp_spurious_initialize()
 
     /*
      *  Skip window overflow, underflow, and flush as well as software
-     *  trap 0 which we will use as a shutdown. Also avoid trap 0x70 - 0x7f
-     *  which cannot happen and where some of the space is used to pass
-     *  paramaters to the program.
+     *  trap 0,9,10 which we will use as a shutdown, IRQ disable, IRQ enable.
+     *  Also avoid trap 0x70 - 0x7f which cannot happen and where some of the
+     *  space is used to pass parameters to the program.
      */
 
     if (( trap == 5 || trap == 6 ) ||
         (( trap >= 0x11 ) && ( trap <= 0x1f )) ||
-        (( trap >= 0x70 ) && ( trap <= 0x83 )))
+        (( trap >= 0x70 ) && ( trap <= 0x83 )) ||
+        ( trap == 0x80 + SPARC_SWTRAP_IRQDIS ) ||
+        ( trap == 0x80 + SPARC_SWTRAP_IRQEN ))
       continue;
 
     set_vector(
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/spurious.c b/c/src/lib/libbsp/sparc/leon3/startup/spurious.c
index f4b02e3..0fb7849 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/spurious.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/spurious.c
@@ -149,7 +149,7 @@ void bsp_spurious_initialize()
      *  Skip window overflow, underflow, and flush as well as software
      *  trap 0,9,10 which we will use as a shutdown, IRQ disable, IRQ enable.
      *  Also avoid trap 0x70 - 0x7f which cannot happen and where some of the
-     *  space is used to pass paramaters to the program.
+     *  space is used to pass parameters to the program.
      */
 
     if (( trap == 5 ) || ( trap == 6 ) ||



More information about the vc mailing list