Rev 1096 | Rev 1100 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1096 | Rev 1097 | ||
---|---|---|---|
Line 233... | Line 233... | ||
233 | # it seems that mips reserves some space on stack for varfuncs??? |
233 | # it seems that mips reserves some space on stack for varfuncs??? |
234 | #define SS_ARG4 16 |
234 | #define SS_ARG4 16 |
235 | #define SS_SP 20 |
235 | #define SS_SP 20 |
236 | #define SS_STATUS 24 |
236 | #define SS_STATUS 24 |
237 | #define SS_EPC 28 |
237 | #define SS_EPC 28 |
238 | #define SS_RA 32 |
- | |
239 | uspace_shortcut: |
238 | uspace_shortcut: |
240 | # We have a lot of space on the stack, with free use |
239 | # We have a lot of space on the stack, with free use |
241 | sw $sp, SS_SP($k0) |
240 | sw $sp, SS_SP($k0) |
242 | move $sp, $k0 |
241 | move $sp, $k0 |
243 | sw $ra, SS_RA($k0) |
- | |
244 | 242 | ||
245 | mfc0 $t1, $epc |
243 | mfc0 $t1, $epc |
246 | mfc0 $t0, $status |
244 | mfc0 $t0, $status |
247 | sw $t1,SS_EPC($sp) # Save EPC |
245 | sw $t1,SS_EPC($sp) # Save EPC |
248 | 246 | ||
Line 255... | Line 253... | ||
255 | mtc0 $t0, $status |
253 | mtc0 $t0, $status |
256 | 254 | ||
257 | jal syscall_handler |
255 | jal syscall_handler |
258 | sw $v0, SS_ARG4($sp) # save v0 - arg4 to stack |
256 | sw $v0, SS_ARG4($sp) # save v0 - arg4 to stack |
259 | 257 | ||
260 | # Restore RA |
- | |
261 | lw $ra, SS_RA($sp) |
- | |
262 | - | ||
263 | # restore epc+4 |
258 | # restore epc+4 |
264 | lw $t0,SS_EPC($sp) |
259 | lw $t0,SS_EPC($sp) |
265 | addi $t0, $t0, 4 |
260 | addi $t0, $t0, 4 |
266 | mtc0 $t0, $epc |
261 | mtc0 $t0, $epc |
267 | 262 |