# HG changeset patch # User tobaru # Date 1572855840 -32400 # Node ID 0ddcd561d975c4e228d302bc2c62377237b48d9a # Parent 0956648d24e5d36ce77143b19eb05c6d95d42c30 fix make error diff -r 0956648d24e5 -r 0ddcd561d975 src/context.h --- a/src/context.h Wed Oct 23 17:33:25 2019 +0900 +++ b/src/context.h Mon Nov 04 17:24:00 2019 +0900 @@ -24,6 +24,7 @@ #endif #ifdef XV6KERNEL +extern void* kmalloc (int order); #define calloc(a,b) kmalloc((a)*(b)) #define free(a) kfree(a) #else diff -r 0956648d24e5 -r 0ddcd561d975 src/defs.h --- a/src/defs.h Wed Oct 23 17:33:25 2019 +0900 +++ b/src/defs.h Mon Nov 04 17:24:00 2019 +0900 @@ -70,7 +70,6 @@ void fileclose(struct file*); struct file* filedup(struct file*); void fileinit(void); -__code cbc_fileread (struct file*, char*, int, __code (*)(int)); int fileread(struct file*, char*, int n); int filestat(struct file*, struct stat*); int filewrite(struct file*, char*, int n); @@ -121,7 +120,6 @@ int pipealloc(struct file**, struct file**); void pipeclose(struct pipe*, int); int piperead(struct pipe*, char*, int); -__code cbc_piperead(struct pipe*, char*, int, __code (*)(int)); int pipewrite(struct pipe*, char*, int); //PAGEBREAK: 16 diff -r 0956648d24e5 -r 0ddcd561d975 src/file.cbc --- a/src/file.cbc Wed Oct 23 17:33:25 2019 +0900 +++ b/src/file.cbc Mon Nov 04 17:24:00 2019 +0900 @@ -114,14 +114,14 @@ } -__code cbc_fileread (struct file *f, char *addr, int n, __code (*next)(int ret)) +__code cbc_fileread(struct file *f, char *addr, int n, __code next(int ret, ...)) { if (f->readable == 0) { goto next(-1); } if (f->type == FD_PIPE) { - goto cbc_piperead(f->pipe, addr, n, next); + piperead(f->pipe, addr, n); goto next(-1); } @@ -134,12 +134,6 @@ goto cbc_panic("fileread"); } -__code cbc_fileread_stub(struct Context* cbc_context) { - struct CbCSysFile* cbc_file = &cbc_context->data[D_CbCSysFile]->CbCSysFile; - enum Code next = cbc_context->next; - goto cbc_fileread(cbc_file->f, cbc_file->p, cbc_file->n, cbc_context->code[next]); -} - // Read from file f. int fileread (struct file *f, char *addr, int n) {