changeset 311:b40deb55b7db

build success
author menikon
date Tue, 04 Feb 2020 16:11:36 +0900
parents f26b3dcbc6db
children b527f27761bf
files src/gearsTools/lib/Gears/Context/Template/XV6.pm src/impl/fs_impl.cbc src/impl/fs_impl.h src/impl/fs_impl_private.cbc src/interface/fs.dg
diffstat 5 files changed, 26 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/gearsTools/lib/Gears/Context/Template/XV6.pm	Mon Feb 03 15:41:24 2020 +0900
+++ b/src/gearsTools/lib/Gears/Context/Template/XV6.pm	Tue Feb 04 16:11:36 2020 +0900
@@ -168,6 +168,7 @@
 typedef struct superblock superblock;
 typedef struct buf buf;
 typedef struct dinode dinode;
+typedef struct dirent dirent;
 EOFEOF
     print $out $str;
 }
--- a/src/impl/fs_impl.cbc	Mon Feb 03 15:41:24 2020 +0900
+++ b/src/impl/fs_impl.cbc	Tue Feb 04 16:11:36 2020 +0900
@@ -172,9 +172,13 @@
     goto next(strncmp_val, ...);
 }
 
-__code dirlookupfs_impl(struct inode* dp, char* name, uint* poff, __code next(...)) {
-
-    goto next(...);
+__code dirlookupfs_impl(struct fs_impl* fs, struct inode* dp, char* name, uint* poff, dirent* de,  __code next(...)) { //:skip
+    if (dp->type != T_DIR) { 
+        /*
+        panic("dirlookup not DIR");
+        */
+    }
+    goto dirlookup_loopcheck(fs, dp, name, poff, de, next(...));
 }
 
 __code dirlinkfs_impl(struct fs_impl* fs, struct inode* dp, char* name, uint inum, __code next(...)) {
--- a/src/impl/fs_impl.h	Mon Feb 03 15:41:24 2020 +0900
+++ b/src/impl/fs_impl.h	Tue Feb 04 16:11:36 2020 +0900
@@ -7,15 +7,20 @@
     struct dinode* dip;
     int inum;
     int iget_val;
+    struct inode* dp;
+    char* name;
+    uint* poff;
+    dirent* de;
 
-    __code allocinode(struct fs_impl* fs_impl, uint dev, short type, __code next(int iget_val, ...));
-    __code allocinode_loop(struct fs_impl* fs_impl, int inum, uint dev, struct superblock* sb, struct buf* bp, struct dinode* dip, __code next(int iget_val, ...));
+    __code allocinode(Type* fs_impl, uint dev, short type, __code next(int iget_val, ...));
+    __code allocinode_loop(Type* fs_impl, int inum, uint dev, struct superblock* sb, struct buf* bp, struct dinode* dip, __code next(int iget_val, ...));
     __code allocinode_loopcheck(Type* fs_impl, int inum, uint dev, struct superblock* sb, struct buf* bp, struct dinode* dip, __code next(int iget_val, ...));
-    __code allocinode_noloop(struct fs_impl* fs_impl, int inum, uint dev, struct superblock* sb, struct buf* bp, struct dinode* dip, __code next(int iget_val, ...));
+    __code allocinode_noloop(Type* fs_impl, int inum, uint dev, struct superblock* sb, struct buf* bp, struct dinode* dip, __code next(int iget_val, ...));
     __code lockinode1(Type* fs_impl, struct inode *ip, struct buf *bp, struct dinode *dip, __code next(...));
-    __code lockinode2(struct fs_impl* fs_impl, struct inode* ip, struct buf* bp, struct dinode* dip, __code next(...));
-    __code lockinode_sleepcheck(struct fs_impl* fs_impl, struct inode* ip, __code next(...));
-    __code iput_check(struct fs_impl* fs_impl, struct inode* ip, __code next(...));
-    __code iput_inode_nolink(struct fs_impl* fs_impl, struct inode* ip, __code next(...));
+    __code lockinode2(Type* fs_impl, struct inode* ip, struct buf* bp, struct dinode* dip, __code next(...));
+    __code lockinode_sleepcheck(Type* fs_impl, struct inode* ip, __code next(...));
+    __code iput_check(Type* fs_impl, struct inode* ip, __code next(...));
+    __code iput_inode_nolink(Type* fs_impl, struct inode* ip, __code next(...));
+    __code dirlookup_loopcheck(Type* fs_impl, struct inode* dp, char* name, uint* poff, dirent* de, next(...));
     __code next(...);
 } fs_impl;
--- a/src/impl/fs_impl_private.cbc	Mon Feb 03 15:41:24 2020 +0900
+++ b/src/impl/fs_impl_private.cbc	Tue Feb 04 16:11:36 2020 +0900
@@ -234,5 +234,7 @@
     wakeup(ip); 
     goto next(...);
 }
-
-
+typedef struct dirent dirent;
+__code dirlookup_loopcheck(struct fs_impl* fs_impl, struct inode* dp, char* name, uint* poff, dirent* de, __code next(...)){ //:skip
+    goto next(...);
+}
--- a/src/interface/fs.dg	Mon Feb 03 15:41:24 2020 +0900
+++ b/src/interface/fs.dg	Tue Feb 04 16:11:36 2020 +0900
@@ -18,6 +18,7 @@
     char* src;
     int namex_val;
     int strncmp_val;
+    dirent* de;
 
     __code readsb(Impl* fs, uint dev, struct superblock* sb, __code next(...));
     __code iinit(Impl* fs, __code next(...));
@@ -32,7 +33,7 @@
     __code readi(Impl* fs, struct inode* ip, char* dst, uint off, uint n, __code next(...));
     __code writei(Impl* fs, struct inode* ip, char* src, uint off, uint n, __code next(...));
     __code namecmp(Impl* fs, const char* s, const char* t, __code next(int strncmp_val, ...));
-    __code dirlookup(struct inode* dp, char* name, uint* poff, __code next(...));
+    __code dirlookup(struct inode* dp, char* name, uint* poff, dirent* de, __code next(...));
     __code dirlink(Impl* fs, struct inode* dp, char* name, uint inum, __code next(...));
     __code namei(Impl* fs, char* path, __code next(int namex_val, ...));
     __code nameiparent(Impl* fs, char* path, char* name, __code next(int namex_val, ...));