summaryrefslogtreecommitdiff
path: root/src/sys/include/vm
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-19 23:29:18 -0400
committerIan Moffett <ian@osmora.org>2025-09-19 23:29:18 -0400
commit50e1b103669a334d31bb27d7d858400c7a12e29e (patch)
tree6459d4bbfd32157be8b62ad64bd01a2a2916c395 /src/sys/include/vm
parent69933fc75a701502f06fc30680fa6fa1f13b5ebb (diff)
kern: proc: Keep track of mapped areas with ranges
This commit adds a virtual memory range queue to the process descriptor in order to keep track of mapped pages and free their respective frames upon program exit. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include/vm')
-rw-r--r--src/sys/include/vm/vm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sys/include/vm/vm.h b/src/sys/include/vm/vm.h
index 790fe0b..f5f7b16 100644
--- a/src/sys/include/vm/vm.h
+++ b/src/sys/include/vm/vm.h
@@ -31,6 +31,7 @@
#define _VM_H_ 1
#include <sys/types.h>
+#include <sys/queue.h>
#include <sys/bootvars.h>
#define VM_HIGHER_HALF (get_kernel_base())
@@ -42,6 +43,21 @@
typedef uintptr_t vaddr_t;
typedef uintptr_t paddr_t;
+/*
+ * Describes a virtual memory range
+ *
+ * @pa_base: Physical memory base
+ * @va_base: Virtual memory base
+ * @len: Length of region
+ * @link: Queue link
+ */
+struct vm_range {
+ paddr_t pa_base;
+ vaddr_t va_base;
+ size_t len;
+ TAILQ_ENTRY(vm_range) link;
+};
+
void vm_init(void);
#endif /* !_VM_H_ */