changeset 132:8e93917ce4be

add sys_read_impl.cbc (incomplete)
author anatofuz
date Thu, 05 Dec 2019 10:59:27 +0900
parents c690327cabc8
children ae25a4e76377
files src/CMakeLists.txt src/file.h src/gearsTools/trans_impl.pl src/sys_read_impl.cbc
diffstat 4 files changed, 36 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/CMakeLists.txt	Wed Dec 04 20:44:29 2019 +0900
+++ b/src/CMakeLists.txt	Thu Dec 05 10:59:27 2019 +0900
@@ -125,7 +125,7 @@
       kernel
   SOURCES
 	string.c arm.c asm.S bio.c buddy.c console.cbc exec.c file.cbc fs.c log.c main.c memide.c pipe.cbc proc.cbc spinlock.cbc 
-	start.c swtch.S syscall.cbc sysfile.cbc sysproc.c trap_asm.S trap.c vm.c device/picirq.c device/timer.c device/uart.c
-  SingleLinkedStack.cbc
+	start.c swtch.S syscall.cbc sysfile.cbc sysproc.c trap_asm.S trap.c vm.c device/picirq.c device/timer.c device/uart.c 
+  SingleLinkedStack.cbc sys_read_impl.cbc
          entry.S 
 )
--- a/src/file.h	Wed Dec 04 20:44:29 2019 +0900
+++ b/src/file.h	Thu Dec 05 10:59:27 2019 +0900
@@ -1,3 +1,4 @@
+/*
 typedef struct file {
     enum { FD_NONE, FD_PIPE, FD_INODE } type;
     int          ref;   // reference count
@@ -7,6 +8,7 @@
     struct inode *ip;
     uint         off;
 } file;
+*/
 // in-memory copy of an inode
 struct inode {
     uint    dev;        // Device number
--- a/src/gearsTools/trans_impl.pl	Wed Dec 04 20:44:29 2019 +0900
+++ b/src/gearsTools/trans_impl.pl	Thu Dec 05 10:59:27 2019 +0900
@@ -39,8 +39,8 @@
 sub emit_include_part {
   my ($out, $interface) = @_;
   print $out <<"EOF"
-#include "../context.h";
-#interface "$interface.h";
+#include "../context.h"
+#interface "$interface.h"
 
 EOF
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sys_read_impl.cbc	Thu Dec 05 10:59:27 2019 +0900
@@ -0,0 +1,30 @@
+#include "../context.h"
+#interface "SysRead.h"
+//data_gear "file.dg"
+
+// ----
+// typedef struct SysReadImpl <Type, Isa> impl SysRead {
+// 
+// } SysReadImpl;
+// ----
+
+SysRead* createSysReadImpl(struct Context* cbc_context) {
+    struct SysRead* sys_read  = new SysRead();
+    struct SysReadImpl* sys_read_impl = new SysReadImpl();
+    sys_read->sys_read = (union Data*)sys_read_impl;
+    sys_read->num  = 0;
+    sys_read->addr = NULL;
+    sys_read->file = NULL;
+    sys_read->read = C_readSysReadImpl;
+    sys_read->next = C_nextSysReadImpl;
+    return sys_read;
+}
+__code readSysReadImpl(struct SysReadImpl* sys_read, __code next(...)) {
+
+  goto next(...);
+}
+
+__code nextSysReadImpl(...) {
+
+}
+