Rev 1122 | Rev 1212 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1122 | Rev 1126 | ||
---|---|---|---|
Line 249... | Line 249... | ||
249 | ori $t0, $t0, 0x1 # Set IE |
249 | ori $t0, $t0, 0x1 # Set IE |
250 | 250 | ||
251 | sw $t2,SS_STATUS($sp) |
251 | sw $t2,SS_STATUS($sp) |
252 | mtc0 $t0, $status |
252 | mtc0 $t0, $status |
253 | 253 | ||
- | 254 | # CALL Syscall handler |
|
254 | jal syscall_handler |
255 | jal syscall_handler |
255 | sw $v0, SS_ARG4($sp) # save v0 - arg4 to stack |
256 | sw $v0, SS_ARG4($sp) # save v0 - arg4 to stack |
256 | 257 | ||
257 | # restore epc+4 |
- | |
258 | lw $t0,SS_EPC($sp) |
- | |
259 | addi $t0, $t0, 4 |
- | |
260 | mtc0 $t0, $epc |
- | |
261 | - | ||
262 | # restore status |
258 | # restore status |
263 | mfc0 $t0, $status |
259 | mfc0 $t0, $status |
264 | lw $t1,SS_STATUS($sp) |
260 | lw $t1,SS_STATUS($sp) |
265 | 261 | ||
- | 262 | # Change back to EXL=1(from last exception), otherwise |
|
- | 263 | # an interrupt could rewrite the CP0-EPC |
|
266 | li $t2, ~REG_SAVE_MASK # Mask UM,EXL,ERL,IE |
264 | li $t2, ~REG_SAVE_MASK # Mask UM,EXL,ERL,IE |
267 | and $t0, $t0, $t2 |
265 | and $t0, $t0, $t2 |
268 | or $t0, $t0, $t1 # Copy UM,EXL,ERL,IE from saved status |
266 | or $t0, $t0, $t1 # Copy UM,EXL,ERL,IE from saved status |
269 | mtc0 $t0, $status |
267 | mtc0 $t0, $status |
270 | 268 | ||
- | 269 | # restore epc+4 |
|
- | 270 | lw $t0,SS_EPC($sp) |
|
- | 271 | addi $t0, $t0, 4 |
|
- | 272 | mtc0 $t0, $epc |
|
- | 273 | ||
271 | lw $sp,SS_SP($sp) # restore sp |
274 | lw $sp,SS_SP($sp) # restore sp |
272 | 275 | ||
273 | eret |
276 | eret |
274 | 277 | ||
275 | tlb_refill_handler: |
278 | tlb_refill_handler: |