summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/leon3/startup/spurious.c
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2014-12-03 11:35:52 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2014-12-04 12:51:11 +0100
commitdff1803cfbec3775fff1b9c34cc707c05494dc3b (patch)
treedbb8850d94b30f8388f9e3df9a68fc6c99855f74 /c/src/lib/libbsp/sparc/leon3/startup/spurious.c
parentpc386 bsp fix for default mode (diff)
downloadrtems-dff1803cfbec3775fff1b9c34cc707c05494dc3b.tar.bz2
SPARC: optimize IRQ enable & disable
* Coding style cleanups. * Use OS reserved trap 0x89 for IRQ Disable * Use OS reserved trap 0x8A for IRQ Enable * Add to SPARC CPU supplement documentation This will result in faster Disable/Enable code since the system trap handler does not need to decode which function the user wants. Besides the IRQ disable/enabled can now be inline which avoids the caller to take into account that o0-o7+g1-g4 registers are destroyed by trap handler. It was also possible to reduce the interrupt trap handler by five instructions due to this.
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/startup/spurious.c')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/startup/spurious.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/spurious.c b/c/src/lib/libbsp/sparc/leon3/startup/spurious.c
index a29f113226..8801f6e933 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/spurious.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/spurious.c
@@ -18,6 +18,7 @@
*/
#include <bsp.h>
+#include <rtems/score/cpu.h>
#include <rtems/bspIo.h>
void _CPU_Exception_frame_print( const CPU_Exception_frame *frame )
@@ -146,14 +147,15 @@ 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 paramaters to the program.
*/
- if (( trap == 5 || trap == 6 ) ||
+ if (( trap == 5 ) || ( trap == 6 ) ||
(( trap >= 0x11 ) && ( trap <= 0x1f )) ||
- (( trap >= 0x70 ) && ( trap <= 0x83 )))
+ (( trap >= 0x70 ) && ( trap <= 0x83 )) ||
+ ( trap == SPARC_SWTRAP_IRQDIS ) || ( trap == SPARC_SWTRAP_IRQEN ))
continue;
set_vector(