Mercurial > hg > CbC > CbC_xv6
changeset 378:297515214d9b
add SyscallEntry interface
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 13 Jul 2020 16:09:22 +0900 |
parents | 19d966c1d2c6 |
children | a0d6f7124b9b |
files | src/impl/KernelError.cbc src/impl/ReadSyscallEntry.cbc src/impl/ReadSyscallEntry.h src/interface/SyscallEntry.h |
diffstat | 4 files changed, 28 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/impl/KernelError.cbc Mon Jul 13 15:57:24 2020 +0900 +++ b/src/impl/KernelError.cbc Mon Jul 13 16:09:22 2020 +0900 @@ -29,10 +29,6 @@ } __code panicKernelError(struct KernelError* err, char* msg) { - extern struct cpu* cpu; - extern struct { struct spinlock lock; int locking; } cons; - extern int panicked; - cli(); cons.locking = 0;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/impl/ReadSyscallEntry.cbc Mon Jul 13 16:09:22 2020 +0900 @@ -0,0 +1,21 @@ +#include "../context.h" +#interface "SyscallEntry.h" + +// ---- +// typedef struct ReadSyscallEntry <Type, Isa> impl SyscallEntry { +// __code next(....); +// } ReadSyscallEntry; +// ---- + +SyscallEntry* createReadSyscallEntry(struct Context* cbc_context) { + struct SyscallEntry* syscall_entry = new SyscallEntry(); + struct ReadSyscallEntry* read_syscall_entry = new ReadSyscallEntry(); + syscall_entry->syscall_entry = (union Data*)read_syscall_entry; + syscall_entry->exec = C_execReadSyscallEntry; + return syscall_entry; +} +__code execReadSyscallEntry(struct ReadSyscallEntry* syscall_entry, __code next(...)) { + + goto next(...); +} +