Mercurial > hg > CbC > CbC_xv6
annotate 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 |
parents | 4e9638616d31 |
children |
rev | line source |
---|---|
385 | 1 #include "context.h" |
378
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 #interface "SyscallEntry.h" |
380
8f2bc03fcbb2
impl ReadSyscall*.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
378
diff
changeset
|
3 #interface "ReadSyscall.h" |
8f2bc03fcbb2
impl ReadSyscall*.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
378
diff
changeset
|
4 |
378
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 // ---- |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 // typedef struct ReadSyscallEntry <Type, Isa> impl SyscallEntry { |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 // __code next(....); |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 // } ReadSyscallEntry; |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 // ---- |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 SyscallEntry* createReadSyscallEntry(struct Context* cbc_context) { |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 struct SyscallEntry* syscall_entry = new SyscallEntry(); |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 struct ReadSyscallEntry* read_syscall_entry = new ReadSyscallEntry(); |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 syscall_entry->syscall_entry = (union Data*)read_syscall_entry; |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 syscall_entry->exec = C_execReadSyscallEntry; |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 return syscall_entry; |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 } |
380
8f2bc03fcbb2
impl ReadSyscall*.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
378
diff
changeset
|
19 |
8f2bc03fcbb2
impl ReadSyscall*.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
378
diff
changeset
|
20 extern ReadSyscall* createReadSyscallImpl(struct Context*); |
378
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 |
380
8f2bc03fcbb2
impl ReadSyscall*.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
378
diff
changeset
|
22 __code execReadSyscallEntry(struct ReadSyscallEntry* syscall_entry, __code next(...)) { |
8f2bc03fcbb2
impl ReadSyscall*.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
378
diff
changeset
|
23 ReadSyscall* read_syscall = createReadSyscallImpl(cbc_context); |
8f2bc03fcbb2
impl ReadSyscall*.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
378
diff
changeset
|
24 goto read_syscall->fileread(next); |
378
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 } |
297515214d9b
add SyscallEntry interface
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 |