From dff1803cfbec3775fff1b9c34cc707c05494dc3b Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Wed, 3 Dec 2014 11:35:52 +0100 Subject: 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. --- c/src/lib/libbsp/sparc/leon3/startup/spurious.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'c/src/lib/libbsp/sparc/leon3/startup/spurious.c') 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 +#include #include 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( -- cgit v1.2.3