renamed and cleaned up export header files to match linux convention
[lunaix-os.git] / lunaix-os / includes / lunaix / mm / mm.h
index 31954d37b32b05cd146d5b3e16bdae6285de7252..742ee1d4139cd1532c234bbc08138ec54dd413e6 100644 (file)
@@ -2,8 +2,11 @@
 #define __LUNAIX_MM_H
 
 #include <lunaix/types.h>
+#include <lunaix/ds/llist.h>
 
-#include <usr/lunaix/mann_flags.h>
+#include <asm/pagetable.h>
+
+#include <usr/lunaix/mman.h>
 
 /**
  * @brief 私有区域,该区域中的页无法进行任何形式的共享。
 #define REGION_TYPE_STACK (4 << 16)
 #define REGION_TYPE_VARS (5 << 16)
 
+struct mm_region
+{
+    struct llist_header head; // must be first field!
+    struct proc_mm* proc_vms;
+
+    // file mapped to this region
+    struct v_file* mfile;
+    // mapped file offset
+    off_t foff;
+    // mapped file length
+
+    ptr_t start;
+    ptr_t end;
+    u32_t attr;
+    size_t flen;
+
+    void** index; // fast reference, to accelerate access to this very region.
+
+    void* data;
+    // when a region is copied
+    void (*region_copied)(struct mm_region*);
+    // when a region is unmapped
+    void (*destruct_region)(struct mm_region*);
+};
+
+
 #endif /* __LUNAIX_MM_H */