diff options
Diffstat (limited to 'utils/hwstub/stub/asm/mips/system.S')
-rw-r--r-- | utils/hwstub/stub/asm/mips/system.S | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/utils/hwstub/stub/asm/mips/system.S b/utils/hwstub/stub/asm/mips/system.S index 2d89bde096..7f619c6edd 100644 --- a/utils/hwstub/stub/asm/mips/system.S +++ b/utils/hwstub/stub/asm/mips/system.S | |||
@@ -19,23 +19,24 @@ | |||
19 | ****************************************************************************/ | 19 | ****************************************************************************/ |
20 | #include "mips.h" | 20 | #include "mips.h" |
21 | #include "target-config.h" | 21 | #include "target-config.h" |
22 | #include "system.h" | ||
22 | 23 | ||
23 | /* Handling of data abort: | 24 | /* Handling of exception: |
24 | * the code can register a "longjmp" buffer to restore the context in case of | 25 | * the code can register a "longjmp" buffer to restore the context in case of |
25 | * fault */ | 26 | * fault */ |
26 | .data | 27 | .data |
27 | .global data_abort_jmp_ctx_ptr | 28 | .global exception_jmp_ctx_ptr |
28 | data_abort_jmp_ctx_ptr: | 29 | exception_jmp_ctx_ptr: |
29 | /* buffer contains in order: s0-s7, sp, s8, ra */ | 30 | /* buffer contains in order: s0-s7, sp, s8, ra */ |
30 | .skip 44 /* = 4 * (9 callee saved registers + sp + ra) */ | 31 | .skip 44 /* = 4 * (9 callee saved registers + sp + ra) */ |
31 | 32 | ||
32 | .set noreorder | 33 | .set noreorder |
33 | .section .icode, "ax", %progbits | 34 | .section .icode, "ax", %progbits |
34 | /* Prototype: int set_data_abort_jmp() | 35 | /* Prototype: int set_exception_jmp() |
35 | * Return: 1 in case of data abort, 0 otherwise */ | 36 | * Return: 1 in case of data abort, 0 otherwise */ |
36 | .global set_data_abort_jmp | 37 | .global set_exception_jmp |
37 | set_data_abort_jmp: | 38 | set_exception_jmp: |
38 | la v0, data_abort_jmp_ctx_ptr | 39 | la v0, exception_jmp_ctx_ptr |
39 | sw s0, 0(v0) | 40 | sw s0, 0(v0) |
40 | sw s1, 4(v0) | 41 | sw s1, 4(v0) |
41 | sw s2, 8(v0) | 42 | sw s2, 8(v0) |
@@ -50,10 +51,12 @@ set_data_abort_jmp: | |||
50 | jr ra | 51 | jr ra |
51 | move v0, zero | 52 | move v0, zero |
52 | 53 | ||
53 | /* restore context on read/write error, performs the interrupt return */ | 54 | /* restore context on read/write error, performs the interrupt return |
54 | .global restore_data_abort_jmp | 55 | * arguments: |
55 | restore_data_abort_jmp: | 56 | * a0: exception type (EXCEPTION_*) */ |
56 | la k1, data_abort_jmp_ctx_ptr | 57 | .global restore_exception_jmp |
58 | restore_exception_jmp: | ||
59 | la k1, exception_jmp_ctx_ptr | ||
57 | lw s0, 0(k1) | 60 | lw s0, 0(k1) |
58 | lw s1, 4(k1) | 61 | lw s1, 4(k1) |
59 | lw s2, 8(k1) | 62 | lw s2, 8(k1) |
@@ -73,7 +76,7 @@ la k1, data_abort_jmp_ctx_ptr | |||
73 | #else | 76 | #else |
74 | ehb | 77 | ehb |
75 | #endif | 78 | #endif |
76 | li v0, 1 | 79 | move v0, a0 /* set exception type */ |
77 | eret | 80 | eret |
78 | nop | 81 | nop |
79 | .set reorder | 82 | .set reorder |