view src/impl/ReadSyscallEntry.cbc @ 395:17e8a4bc06a7 default tip

add macOS AR/RANLIB
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 14 Dec 2020 21:59:50 +0900 (2020-12-14)
parents 4e9638616d31
children
line wrap: on
line source
#include "context.h"
#interface "SyscallEntry.h"
#interface "ReadSyscall.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;
}

extern ReadSyscall* createReadSyscallImpl(struct Context*);

__code execReadSyscallEntry(struct ReadSyscallEntry* syscall_entry, __code next(...)) {
    ReadSyscall* read_syscall = createReadSyscallImpl(cbc_context);
    goto read_syscall->fileread(next);
}