diff --git a/mips-rt/Cargo.toml b/mips-rt/Cargo.toml index 0946451..f6eab22 100644 --- a/mips-rt/Cargo.toml +++ b/mips-rt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mips-rt" -version = "0.3.2" +version = "0.3.3" authors = ["Stephan #include -.extern _general_exception_handler -.section .text.general_exception, "ax" +.section .text.exception_context, "ax" .set noreorder .set noat .set nomips16 -.globl _general_exception_context -.ent _general_exception_context +.globl _exception_context +.ent _exception_context -_general_exception_context: +_exception_context: # Save off the non-callee saved registers that may get mucked with addiu sp, sp, -88 @@ -50,24 +51,11 @@ _general_exception_context: mfhi t0 sw t0, 80(sp) -#if defined(__PIC__) - lw t9,%call16(_general_exception_handler)(gp) - nop - # Pass Cause and Status to the handler function - mfc0 a0, _CP0_CAUSE - mfc0 a1, _CP0_STATUS - jalr t9 - nop -#else - la k0,_general_exception_handler - nop - # Pass Cause and Status to the handler function mfc0 a0, _CP0_CAUSE mfc0 a1, _CP0_STATUS jalr k0 nop -#endif lw t0, 80(sp) mthi t0 @@ -97,11 +85,4 @@ _general_exception_context: ehb eret - .end _general_exception_context - -.weak _general_exception_handler -.ent _general_exception_handler -_general_exception_handler: - jr ra - nop -.end _general_exception_handler + .end _exception_context diff --git a/mips-rt/native_lib/exception_table.S b/mips-rt/native_lib/exception_table.S index dddc69c..d6e9cf1 100644 --- a/mips-rt/native_lib/exception_table.S +++ b/mips-rt/native_lib/exception_table.S @@ -21,8 +21,8 @@ _default_isr_fn: .ent _gen_exception .global _gen_exception _gen_exception: - la k0,_general_exception_context - jr k0 + la k0,_general_exception_handler + j _exception_context nop .end _gen_exception diff --git a/mips-rt/native_lib/isr_context.S b/mips-rt/native_lib/isr_context.S index 35acc5c..3b94f30 100644 --- a/mips-rt/native_lib/isr_context.S +++ b/mips-rt/native_lib/isr_context.S @@ -1,7 +1,7 @@ /* - * wrapper for exception handlers that saves registers on the stack + * wrapper for interrupt handlers that saves registers on the stack * - * address of exception handler to be called must be in register k0 + * address of interrupt handler to be called must be in register k0 * */ diff --git a/mips-rt/native_lib/libmips-rt.a b/mips-rt/native_lib/libmips-rt.a index 7c3739e..7687262 100644 Binary files a/mips-rt/native_lib/libmips-rt.a and b/mips-rt/native_lib/libmips-rt.a differ