From 50e1b103669a334d31bb27d7d858400c7a12e29e Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 19 Sep 2025 23:29:18 -0400 Subject: 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 --- src/sys/include/vm/vm.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/sys/include/vm/vm.h') 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 +#include #include #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_ */ -- cgit v1.2.3