diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2014-11-11 15:18:01 +0100 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2014-12-02 13:57:20 +0100 |
commit | 0d3b5d47429effb350448d9e9123a67db722109f (patch) | |
tree | 589e3d1b674275049739d8ca6c686c979d0e4ad1 /c/src/lib/libbsp/sparc/shared/start/start.S | |
parent | SPARC: optimize window overflow trap entry (diff) | |
download | rtems-0d3b5d47429effb350448d9e9123a67db722109f.tar.bz2 |
SPARC: optimize window underflow trap
Save five instructions on underflow handling.
By using an optimized trap entry we can move instructions from
the window underflow function into the trap entry vector. By
setting WIM=0 and using RESTORE it is possible to move the
new WIM register content from the trapped window into the
to-be-restored register window. It is then possible to avoid
the WIM write delay.
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/start/start.S')
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/start/start.S | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/start/start.S b/c/src/lib/libbsp/sparc/shared/start/start.S index b7067b32bd..3e0e42e7df 100644 --- a/c/src/lib/libbsp/sparc/shared/start/start.S +++ b/c/src/lib/libbsp/sparc/shared/start/start.S @@ -51,6 +51,15 @@ nop /* + * Window Underflow optimized trap table entry + */ +#define WUTRAP(_vector, _handler) \ + mov %wim, %l3 ; \ + sethi %hi(_handler), %l4 ; \ + jmp %l4+%lo(_handler); \ + mov %g0, %wim ! WIM = 0, so that we can restore regardless of WIM + +/* * Software trap. Treat as BAD_TRAP for the time being... */ @@ -82,7 +91,7 @@ SYM(trap_table): BAD_TRAP; ! 03 privileged instruction BAD_TRAP; ! 04 fp disabled WOTRAP(5, SYM(window_overflow_trap_handler)); ! 05 window overflow - TRAP( 6, SYM(window_underflow_trap_handler) );! 06 window underflow + WUTRAP(6, SYM(window_underflow_trap_handler));! 06 window underflow BAD_TRAP; ! 07 memory address not aligned BAD_TRAP; ! 08 fp exception BAD_TRAP; ! 09 data access exception |