Rev 1097 | Rev 1102 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1097 | Rev 1100 | ||
---|---|---|---|
Line 213... | Line 213... | ||
213 | 213 | ||
214 | sra $k1, $k1, 0x2 # cp0_exc_cause() part 1 |
214 | sra $k1, $k1, 0x2 # cp0_exc_cause() part 1 |
215 | andi $k1, $k1, 0x1f # cp0_exc_cause() part 2 |
215 | andi $k1, $k1, 0x1f # cp0_exc_cause() part 2 |
216 | sub $k1, 8 # 8=SYSCALL |
216 | sub $k1, 8 # 8=SYSCALL |
217 | 217 | ||
218 | beqz $k1, uspace_shortcut |
218 | beqz $k1, syscall_shortcut |
219 | add $k1, 8 # Revert $k1 back to correct exc number |
219 | add $k1, 8 # Revert $k1 back to correct exc number |
220 | 220 | ||
221 | REGISTERS_STORE_AND_EXC_RESET $k0 |
221 | REGISTERS_STORE_AND_EXC_RESET $k0 |
222 | move $sp, $k0 |
222 | move $sp, $k0 |
223 | 223 | ||
Line 226... | Line 226... | ||
226 | move $a0, $k1 |
226 | move $a0, $k1 |
227 | 227 | ||
228 | REGISTERS_LOAD $sp |
228 | REGISTERS_LOAD $sp |
229 | # The $sp is automatically restored to former value |
229 | # The $sp is automatically restored to former value |
230 | eret |
230 | eret |
231 | nop |
- | |
232 | 231 | ||
233 | # it seems that mips reserves some space on stack for varfuncs??? |
232 | # it seems that mips reserves some space on stack for varfuncs??? |
234 | #define SS_ARG4 16 |
233 | #define SS_ARG4 16 |
235 | #define SS_SP 20 |
234 | #define SS_SP 20 |
236 | #define SS_STATUS 24 |
235 | #define SS_STATUS 24 |
237 | #define SS_EPC 28 |
236 | #define SS_EPC 28 |
238 | uspace_shortcut: |
237 | syscall_shortcut: |
239 | # We have a lot of space on the stack, with free use |
238 | # We have a lot of space on the stack, with free use |
240 | sw $sp, SS_SP($k0) |
239 | sw $sp, SS_SP($k0) |
241 | move $sp, $k0 |
240 | move $sp, $k0 |
242 | 241 | ||
243 | mfc0 $t1, $epc |
242 | mfc0 $t1, $epc |