Mercurial > hg > Members > menikon > CbC_xv6
view src/impl/PipeRead.cbc @ 144:eef045e9772a
update pipe_read
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 15 Dec 2019 13:43:23 +0900 |
parents | 547c20b052dc |
children | 6c81e02e323f |
line wrap: on
line source
#include "../context.h" #interface "SysRead.h" // ---- // typedef struct PipeRead<Type, Isa> impl SysRead { // struct pipe* p; // int i; // int n; // __code cbc_piperead1(Type* sys_read, struct pipe* p, __code next(...)); // __code cbc_piperead2(Type* sys_read, int i, int n, struct pipe* p, __code next(...)); // __code cbc_piperead3(Type* sys_read, int i, struct pipe* p, __code next(...)); // __code next(...); // } PipeRead; // ---- SysRead* createPipeRead(struct Context* cbc_context) { struct SysRead* sys_read = new SysRead(); struct PipeRead* pipe_read = new PipeRead(); sys_read->sys_read = (union Data*)pipe_read; pipe_read->p = NULL; pipe_read->i = 0; pipe_read->n = 0; sys_read->impl = NULL; sys_read->addr = NULL; sys_read->n = 0; pipe_read->cbc_piperead1 = C_cbc_piperead1PipeRead; pipe_read->cbc_piperead2 = C_cbc_piperead2PipeRead; pipe_read->cbc_piperead3 = C_cbc_piperead3PipeRead; pipe_read->next = C_nextPipeRead; sys_read->read = C_readPipeRead; sys_read->next = C_nextPipeRead; return sys_read; } SysRead* createPipeReadUseArgs(struct Context* cbc_context,struct pipe* p, char* addr, int n) { struct SysRead* sys_read = new SysRead(); struct PipeRead* pipe_read = new PipeRead(); sys_read->sys_read = (union Data*)pipe_read; pipe_read->p = p; pipe_read->i = 0; pipe_read->n = n; sys_read->impl = (union Data*)p; sys_read->addr = addr; sys_read->n = n; sys_read->read = C_readPipeRead; sys_read->next = C_nextPipeRead; return sys_read; } __code cbc_piperead1PipeRead(struct PipeRead* sys_read, struct pipe* p, __code next(...)) { goto next(...); } __code cbc_piperead2PipeRead(struct PipeRead* sys_read, int i, int n, struct pipe* p, __code next(...)) { goto next(...); } __code cbc_piperead3PipeRead(struct PipeRead* sys_read, int i, struct pipe* p, __code next(...)) { goto next(...); } __code nextPipeRead(...) { } __code readPipeRead(struct PipeRead* sys_read, union Data* impl, char* addr, int n, __code next(int ret,...)) { goto next(int ret,...); } __code nextPipeRead(...) { }