mmap: generalize mmap

also add a range search function to ensure that memory allocations do
not overlap in virtual space
This commit is contained in:
Michael Shaw 2023-11-15 16:40:14 -05:00
commit 823f811954
5 changed files with 106 additions and 28 deletions

View file

@ -4,6 +4,8 @@
#include <stdint.h>
#include <stdbool.h>
#include <kernel/lock.h>
#include <kernel/rbtree.h>
#define PROC_RUNNING 0
#define PROC_STOPPED 1
@ -45,6 +47,9 @@ struct proc {
bool is_kernel;
uint8_t state;
struct rbtree page_map;
spinlock_t page_map_lock;
};
struct procregs *proc_current_regs();