# HG changeset patch # User anatofuz # Date 1594624162 -32400 # Node ID 297515214d9b8942e2557f1a7c9b24bc4e394ab5 # Parent 19d966c1d2c67007327a8f11d485a87429e9bfc1 add SyscallEntry interface diff -r 19d966c1d2c6 -r 297515214d9b src/impl/KernelError.cbc --- 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; diff -r 19d966c1d2c6 -r 297515214d9b src/impl/ReadSyscallEntry.cbc --- /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 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(...); +} + diff -r 19d966c1d2c6 -r 297515214d9b src/impl/ReadSyscallEntry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/impl/ReadSyscallEntry.h Mon Jul 13 16:09:22 2020 +0900 @@ -0,0 +1,3 @@ +typedef struct ReadSyscallEntry impl SyscallEntry { + __code next(....); +} ReadSyscallEntry; diff -r 19d966c1d2c6 -r 297515214d9b src/interface/SyscallEntry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/interface/SyscallEntry.h Mon Jul 13 16:09:22 2020 +0900 @@ -0,0 +1,4 @@ +typedef struct SyscallEntry { + __code exec(Impl* syscall_entry, __code next(...)); + __code next(....); +} SyscallEntry;