diff options
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/crt0.S')
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/crt0.S | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/crt0.S b/firmware/target/mips/ingenic_jz47xx/crt0.S index 3d2308a578..b9ffde3b65 100644 --- a/firmware/target/mips/ingenic_jz47xx/crt0.S +++ b/firmware/target/mips/ingenic_jz47xx/crt0.S | |||
@@ -135,15 +135,14 @@ except_common_entry: | |||
135 | nop | 135 | nop |
136 | nop | 136 | nop |
137 | nop | 137 | nop |
138 | 138 | .fill 0x20 | |
139 | |||
139 | .extern _int | 140 | .extern _int |
140 | .extern _exception | 141 | .extern _exception |
141 | .global real_exception_handler | 142 | .global real_exception_handler |
142 | .type real_exception_handler,@function | 143 | .type real_exception_handler,@function |
143 | .set noreorder | 144 | .set noreorder |
144 | real_exception_handler: | 145 | real_exception_handler: |
145 | |||
146 | |||
147 | addiu sp, -0x80 | 146 | addiu sp, -0x80 |
148 | sw ra, 0(sp) | 147 | sw ra, 0(sp) |
149 | sw fp, 4(sp) | 148 | sw fp, 4(sp) |
@@ -196,8 +195,7 @@ real_exception_handler: | |||
196 | and k0, k1 | 195 | and k0, k1 |
197 | beq zero, k0, _int | 196 | beq zero, k0, _int |
198 | nop | 197 | nop |
199 | la k0, _exception | 198 | j _exception |
200 | jr k0 | ||
201 | nop | 199 | nop |
202 | 200 | ||
203 | .global _int | 201 | .global _int |
@@ -261,9 +259,17 @@ _int: | |||
261 | .global _exception | 259 | .global _exception |
262 | .type _exception,@function | 260 | .type _exception,@function |
263 | _exception: | 261 | _exception: |
264 | move a0, sp | 262 | add a0, sp, $0 |
265 | mfc0 a1, C0_CAUSE # C0_CAUSE of last exception | 263 | mfc0 a1, C0_CAUSE # C0_CAUSE of last exception |
264 | sll zero, 1 | ||
265 | sll zero, 1 | ||
266 | sll zero, 1 | ||
267 | sll zero, 1 | ||
266 | mfc0 a2, C0_EPC # Exception Program Counter | 268 | mfc0 a2, C0_EPC # Exception Program Counter |
269 | sll zero, 1 | ||
270 | sll zero, 1 | ||
271 | sll zero, 1 | ||
272 | sll zero, 1 | ||
267 | la k0, exception_handler | 273 | la k0, exception_handler |
268 | jr k0 | 274 | jr k0 |
269 | nop | 275 | nop |