feat: basic elf32 loader (only LOAD segment is supported)
[lunaix-os.git] / lunaix-os / includes / lunaix / mm / mmap.h
index 333504a203c2c40bbaa5063e5fde706632950471..642922542cadcf9da3c5aac327faed10496b997b 100644 (file)
@@ -5,17 +5,39 @@
 #include <lunaix/mm/region.h>
 #include <lunaix/types.h>
 
-void*
-mem_map(ptr_t pd_ref,
-        vm_regions_t* regions,
+struct mmap_param
+{
+    ptr_t vms_mnt;
+    vm_regions_t* regions;
+    off_t offset;
+    size_t length;
+    u32_t proct;
+    u32_t flags;
+    u32_t type;
+};
+
+int
+mem_map(void** addr_out,
+        struct mm_region** created,
         void* addr,
         struct v_file* file,
-        off_t offset,
-        size_t length,
-        u32_t attrs,
-        u32_t options);
+        struct mmap_param* param);
 
-void*
+int
 mem_unmap(ptr_t mnt, vm_regions_t* regions, void* addr, size_t length);
 
+void
+mem_sync_pages(ptr_t mnt,
+               struct mm_region* region,
+               ptr_t start,
+               ptr_t length,
+               int options);
+
+int
+mem_msync(ptr_t mnt,
+          vm_regions_t* regions,
+          ptr_t addr,
+          size_t length,
+          int options);
+
 #endif /* __LUNAIX_MMAP_H */