diff src/context.h @ 94:d876c9a65239 default tip

impl mac os target
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Wed, 23 Oct 2019 14:31:38 +0900
parents bc5bcfd2f6d6
children
line wrap: on
line diff
--- a/src/context.h	Sat Oct 19 18:44:57 2019 +0900
+++ b/src/context.h	Wed Oct 23 14:31:38 2019 +0900
@@ -10,10 +10,18 @@
 #include "helper_cuda.h"
 #endif
 
-#include "types.h"
-#include "use_context_numbers.h"
-#include "fs.h"
-#include "defs.h"
+#ifndef NULL
+# if defined __GNUG__ && \
+    (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
+#  define NULL (__null)
+# else
+#  if !defined(__cplusplus)
+#   define NULL ((void*)0)
+#  else
+#   define NULL (0)
+#  endif
+# endif
+#endif
 
 #ifdef XV6KERNEL
 #define calloc(a,b)  kmalloc((a)*(b))
@@ -463,21 +471,8 @@
         struct Context* lockContext;
     } SpinLock;
     /* CbCxv6 cbc_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;
+        unsigned int value;
     } Uinteger;
     struct Short {
        short value;
@@ -485,26 +480,6 @@
     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 cbc_context generator
 
 typedef union Data Data;