aboutsummaryrefslogtreecommitdiff
path: root/sys/include/vm/vm.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2023-11-24 10:10:52 -0500
committerIan Moffett <ian@osmora.org>2023-11-24 10:10:52 -0500
commit278d29c5021b1a0e3ecdead373a2d084e45dbecc (patch)
treec3be4b3b5a2eab3c3bebdddebd23a0e40863a25c /sys/include/vm/vm.h
parent82b96dbf5cbb47b09492d4899333504d48c38e4e (diff)
kernel: vm: Port TLSF allocator
This commit adds a Two-Level Segregated Fit memory allocator port to the Hyra kernelspace. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/vm/vm.h')
-rw-r--r--sys/include/vm/vm.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/include/vm/vm.h b/sys/include/vm/vm.h
index c929be0..e18df4c 100644
--- a/sys/include/vm/vm.h
+++ b/sys/include/vm/vm.h
@@ -35,6 +35,7 @@
#include <sys/cdefs.h>
#include <vm/vm_page.h>
#include <vm/vm_pmap.h>
+#include <vm/tlsf.h>
extern volatile struct limine_hhdm_request g_hhdm_request;
@@ -44,6 +45,17 @@ extern volatile struct limine_hhdm_request g_hhdm_request;
#define VIRT_TO_PHYS(virt) ((uintptr_t)virt - VM_HIGHER_HALF)
/*
+ * cpu_vm_ctx - Per core virtual memory context
+ *
+ * Holds per core virtual memory information.
+ */
+struct cpu_vm_ctx {
+ uintptr_t dynalloc_pool_phys;
+ size_t dynalloc_pool_sz; /* In bytes */
+ tlsf_t tlsf_ctx;
+};
+
+/*
* Returns the machine's pagesize:
*
* XXX TODO: This needs to be moved to vmm_init.c
@@ -56,5 +68,6 @@ vm_get_page_size(void)
}
void vm_init(void);
+struct cpu_vm_ctx vm_get_bsp_ctx(void);
#endif /* !_VM_H_ */