diff src/file.cbc @ 113:ef44d384ad9d

rollback rev 52
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Mon, 02 Dec 2019 11:17:04 +0900
parents 239bd73abac6
children 7c200a8328fa
line wrap: on
line diff
--- a/src/file.cbc	Thu Nov 28 16:58:04 2019 +0900
+++ b/src/file.cbc	Mon Dec 02 11:17:04 2019 +0900
@@ -11,10 +11,7 @@
 #include "proc.h"
 
 #define __ncode __code
-
-#interface "SysRead.h"
-
-
+#
 struct devsw devsw[NDEV];
 struct cbc_devsw cbc_devsw[NDEV];
 
@@ -28,17 +25,6 @@
     initlock(&ftable.lock, "ftable");
 }
 
-SysRead* createFileRead(struct Context* cbc_context) {
-    struct SysRead* sys_read  = new SysRead();
-    struct FileRead* file_read = new FileRead();
-    sys_read->sys_read = (union Data*)file_read;
-    file_read->f = NULL;
-    sys_read->num = NULL;
-    sys_read->read = C_readFileRead;
-    sys_read->next = C_nextFileRead;
-    return sys_read;
-}
-
 // Allocate a file structure.
 struct file* filealloc (void)
 {
@@ -127,16 +113,14 @@
     goto next(r);
 }
 
-
-// Skip: generate_context
-__code cbc_fileread(struct file *f, char *addr, int n, __code next(int ret, ...))
+__ncode 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) {
-        piperead(f->pipe, addr, n);
+        goto cbc_piperead(f->pipe, addr, n, next);
         goto next(-1);
     }
 
@@ -238,11 +222,3 @@
     panic("filewrite");
 }
 
-__code readFileRead(__code next(...)) {
-
-  goto next(...);
-}
-
-__code nextFileRead(...) {
-
-}