# HG changeset patch # User anatofuz # Date 1559050021 -32400 # Node ID fadfd62d6b142ff2c6ebfb30ad58ff76cca46123 # Parent 3931ac87d85097ac3d1e20d887239cfb2d3b6aee define filesystem DataGeas and ommit stdlib.h diff -r 3931ac87d850 -r fadfd62d6b14 src/context.h --- a/src/context.h Tue May 28 22:26:00 2019 +0900 +++ b/src/context.h Tue May 28 22:27:01 2019 +0900 @@ -1,12 +1,8 @@ /* Context definition for llrb example */ -#ifndef CONTEXT_H +#ifdef CONTEXT_H #define CONTEXT_H -#ifdef CBCXV6 - -#else #include #include -#endif #ifdef USE_CUDAWorker #include #include @@ -14,6 +10,8 @@ #include "helper_cuda.h" #endif +#include "use_context_numbers.h" + #define ALLOCATE_SIZE 20000000 #define NEW(type) (type*)(calloc(1, sizeof(type))) #define NEWN(n, type) (type*)(calloc(n, sizeof(type))) @@ -93,6 +91,7 @@ }; #include "c/enumData.h" +#define NDIRECT 12 //fs.h struct Context { enum Code next; @@ -440,7 +439,51 @@ struct Atomic* atomic; struct Context* lockContext; } SpinLock; + /* CbCxv6 context*/ + struct Inode { + uint dev; // Device number + uint inum; // Inode number + int ref; // Reference count + int flags; // I_BUSY, I_VALID + + short type; // copy of disk inode + short major; + short minor; + short nlink; + uint size; + uint addrs[NDIRECT+1]; + } Inode; + struct Uinteger { + uint value; + } Uinteger; + struct Short { + short value; + } Short; + struct String { + char* string; + } String; + // fs.h --- + struct SuperBlock { + uint size; // Size of file system image (blocks) + uint nblocks; // Number of data blocks + uint ninodes; // Number of inodes. + uint nlog; // Number of log blocks + } SuperBlock; + struct Dinode { + short type; // copy of disk inode + short major; + short minor; + short nlink; + uint size; + uint addrs[NDIRECT+1]; + } Dinode; + struct Dirent { + ushort inum; + char name[DIRSIZ]; + } Dirent; + // --- fs.h }; // union Data end this is necessary for context generator + typedef union Data Data; #include "c/typedefData.h" diff -r 3931ac87d850 -r fadfd62d6b14 src/use_context_numbers.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/use_context_numbers.h Tue May 28 22:27:01 2019 +0900 @@ -0,0 +1,1 @@ +#define NDIRECT 12