Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1099 → Rev 1100

/kernel/trunk/arch/mips32/include/exception.h
98,6 → 98,5
extern void exception_entry(void);
extern void cache_error_entry(void);
extern void exception_init(void);
extern __native syscall_handler(__native a0, __native a1, __native a2,
__native a3, __native sysnum);
 
#endif
/kernel/trunk/arch/mips32/src/exception.c
40,7 → 40,6
#include <func.h>
#include <console/kconsole.h>
#include <arch/debugger.h>
#include <syscall/syscall.h>
 
static char * exctable[] = {
"Interrupt","TLB Modified","TLB Invalid","TLB Invalid Store",
129,14 → 128,6
exc_dispatch(i+INT_OFFSET, istate);
}
 
__native syscall_handler(__native a0, __native a1, __native a2,
__native a3, __native sysnum)
{
if (sysnum < SYSCALL_END)
return syscall_table[sysnum](a0,a1,a2,a3);
panic("Undefined syscall %d", sysnum);
}
 
/** Handle syscall userspace call */
static void syscall_exception(int n, istate_t *istate)
{
/kernel/trunk/arch/mips32/src/start.S
215,7 → 215,7
andi $k1, $k1, 0x1f # cp0_exc_cause() part 2
sub $k1, 8 # 8=SYSCALL
beqz $k1, uspace_shortcut
beqz $k1, syscall_shortcut
add $k1, 8 # Revert $k1 back to correct exc number
REGISTERS_STORE_AND_EXC_RESET $k0
228,7 → 228,6
REGISTERS_LOAD $sp
# The $sp is automatically restored to former value
eret
nop
 
# it seems that mips reserves some space on stack for varfuncs???
#define SS_ARG4 16
235,7 → 234,7
#define SS_SP 20
#define SS_STATUS 24
#define SS_EPC 28
uspace_shortcut:
syscall_shortcut:
# We have a lot of space on the stack, with free use
sw $sp, SS_SP($k0)
move $sp, $k0