diff options
author | Andrew Waterman <waterman@s141.Millennium.Berkeley.EDU> | 2010-07-19 22:58:42 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@s141.Millennium.Berkeley.EDU> | 2010-07-19 22:58:42 -0700 |
commit | 263c2ff7d8ae261fc2ee2dbf740ba048df9c956d (patch) | |
tree | 7ae86a67320c67b9eb1531521d63269a10736976 | |
parent | 9c4398472919cff07e8cad82edc7b74ddc26498a (diff) | |
download | pk-263c2ff7d8ae261fc2ee2dbf740ba048df9c956d.zip pk-263c2ff7d8ae261fc2ee2dbf740ba048df9c956d.tar.gz pk-263c2ff7d8ae261fc2ee2dbf740ba048df9c956d.tar.bz2 |
[pk,sim] added temporary "exit" functionality
-rw-r--r-- | file.c | 2 | ||||
-rw-r--r-- | pk.c | 5 | ||||
-rw-r--r-- | pk.h | 3 |
3 files changed, 7 insertions, 3 deletions
@@ -93,7 +93,6 @@ static void putch(int c) sysret_t file_write(file_t* f, const void* buf, size_t size) { - kassert(f == stdout); for(int i = 0; i < size; i++) putch(((char*)buf)[i]); return (sysret_t){0,0}; @@ -101,7 +100,6 @@ sysret_t file_write(file_t* f, const void* buf, size_t size) sysret_t file_stat(file_t* f, struct stat* s) { - kassert(f == stdout); s->st_mode = S_IFCHR; return (sysret_t){0,0}; } @@ -145,3 +145,8 @@ void boot() tf.epc = 0x1000; pop_tf(&tf); } + +void gtfo() +{ + asm("mtc0 $0,$9"); +} @@ -9,7 +9,7 @@ typedef struct long badvaddr; } trapframe_t; -#define panic(s,...) do { printk(s"\n", ##__VA_ARGS__); while(1); } while(0) +#define panic(s,...) do { printk(s"\n", ##__VA_ARGS__); gtfo(); } while(0) #define kassert(cond) do { if(!(cond)) panic("assertion failed: "#cond); } while(0) #ifdef __cplusplus @@ -24,6 +24,7 @@ void unhandled_trap(trapframe_t*); void handle_syscall(trapframe_t*); void handle_breakpoint(trapframe_t*); void boot(); +void gtfo(); #ifdef __cplusplus } |