Mercurial > hg > Members > tobaru > CbC_xv6
changeset 159:e8b76f16de1a
add argument in SysCloseImpl.h
author | tobaru |
---|---|
date | Fri, 20 Dec 2019 17:02:50 +0900 |
parents | 74d9f25dcb76 |
children | db7d79dea533 |
files | src/interface/SysClose.h src/sys_close_impl.cbc |
diffstat | 2 files changed, 11 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/interface/SysClose.h Fri Dec 20 16:16:45 2019 +0900 +++ b/src/interface/SysClose.h Fri Dec 20 17:02:50 2019 +0900 @@ -1,7 +1,8 @@ typedef struct SysClose<Type, Impl>{ + union Data* sys_close; int fd; struct file *f; - __code close(int fd, struct file *f, __code next(...)); + __code close(Impl* sys_close, int fd, struct file *f, __code next(...)); } SysClose;
--- a/src/sys_close_impl.cbc Fri Dec 20 16:16:45 2019 +0900 +++ b/src/sys_close_impl.cbc Fri Dec 20 17:02:50 2019 +0900 @@ -1,5 +1,5 @@ -#include "../context.h"; -#interface "SysClose.h"; +#include "../context.h" +#interface "SysClose.h" // ---- // typedef struct SysCloseImpl<Type, Isa> impl SysClose { @@ -8,18 +8,15 @@ // ---- SysClose* createSysCloseImpl(struct Context* cbc_context) { - struct SysClose* int fd; - = new SysClose(); + struct SysClose* sys_close = new SysClose(); struct SysCloseImpl* sys_close_impl = new SysCloseImpl(); - int fd; --> int fd; - = (union Data*)sys_close_impl; - int fd; -->close = C_closeSysCloseImpl; - return int fd; -; + sys_close->sys_close = (union Data*)sys_close_impl; + sys_close->fd = 0; + sys_close->file = 0; + sys_close->close = C_closeSysCloseImpl; + return sys_close; } -__code closeSysCloseImpl(int fd, struct file *f, __code next(...)) { +__code closeSysCloseImpl(struct SysCloseImpl* sys_close, int fd, struct file *f, __code next(...)) { goto next(...); }