* Memory management for processes: syscall related functions, virtual memory
* regions, etc. */
-#ifndef ROS_KERN_MM_H
-#define ROS_KERN_MM_H
+#pragma once
#include <ros/common.h>
#include <ros/mman.h>
void unmap_and_destroy_vmrs(struct proc *p);
int duplicate_vmrs(struct proc *p, struct proc *new_p);
void print_vmrs(struct proc *p);
+void enumerate_vmrs(struct proc *p,
+ void (*func)(struct vm_region *vmr, void *opaque),
+ void *opaque);
/* mmap() related functions. These manipulate VMRs and change the hardware page
* tables. Any requests below the LOWEST_VA will silently be upped. This may
int mprotect(struct proc *p, uintptr_t addr, size_t len, int prot);
int munmap(struct proc *p, uintptr_t addr, size_t len);
int handle_page_fault(struct proc *p, uintptr_t va, int prot);
+int handle_page_fault_nofile(struct proc *p, uintptr_t va, int prot);
unsigned long populate_va(struct proc *p, uintptr_t va, unsigned long nr_pgs);
/* These assume the mm_lock is held already */
/* Helper wrappers, since no one will probably call the *_segment funcs */
uintptr_t vmap_pmem(uintptr_t paddr, size_t nr_bytes);
uintptr_t vmap_pmem_nocache(uintptr_t paddr, size_t nr_bytes);
+uintptr_t vmap_pmem_writecomb(uintptr_t paddr, size_t nr_bytes);
int vunmap_vmem(uintptr_t vaddr, size_t nr_bytes);
-
-#endif /* !ROS_KERN_MM_H */