diff options
author | Andrew Waterman <waterman@s144.Millennium.Berkeley.EDU> | 2011-04-15 14:32:18 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@s144.Millennium.Berkeley.EDU> | 2011-04-15 14:33:12 -0700 |
commit | ba0cf0546686acac7e891d9740009bcc4ada73ee (patch) | |
tree | 5a80659c0b61aab37e36290875713d7c2a09cd8f /pk/pk.h | |
parent | 04c8f1c003bbee2f9b45f5e706103837a6d61a30 (diff) | |
download | pk-ba0cf0546686acac7e891d9740009bcc4ada73ee.zip pk-ba0cf0546686acac7e891d9740009bcc4ada73ee.tar.gz pk-ba0cf0546686acac7e891d9740009bcc4ada73ee.tar.bz2 |
[pk] fixed timer interrupt bug, etc.
Diffstat (limited to 'pk/pk.h')
-rw-r--r-- | pk/pk.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -8,6 +8,7 @@ #ifndef __ASSEMBLER__ #include <stdint.h> +#include <machine/syscall.h> typedef struct { @@ -37,7 +38,6 @@ void pop_tf(trapframe_t*); void dump_tf(trapframe_t*); void unhandled_trap(trapframe_t*); -void handle_syscall(trapframe_t*); void handle_misaligned_load(trapframe_t*); void handle_misaligned_store(trapframe_t*); void handle_fault_load(trapframe_t*); @@ -45,14 +45,18 @@ void handle_fault_store(trapframe_t*); void boot(); void sys_exit(int code) __attribute__((noreturn)); +sysret_t syscall(long a0, long a1, long a2, long a3, long n); long load_elf(const char* fn, int* user64); static inline void advance_pc(trapframe_t* tf) { - tf->epc += 4; + int rvc = (tf->insn & 0x3) < 0x3; + tf->epc += rvc ? 2 : 4; } +#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) + #ifdef __cplusplus } #endif |