aboutsummaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-14 21:02:10 -0400
committerIan Moffett <ian@osmora.org>2024-03-14 21:03:09 -0400
commit3e3ff0acccfbb1d251a9b9bacbf0851c9de69561 (patch)
treed48fa68e58c0395f27f848d4872ea2d2bf7f1f50 /sys/arch/amd64
parent7a32267fcc81af31d595373884911d503b0a9df8 (diff)
kernel/amd64: pmap: Add pmap_free_vas()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/pmap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c
index 2760532..54d4ca3 100644
--- a/sys/arch/amd64/amd64/pmap.c
+++ b/sys/arch/amd64/amd64/pmap.c
@@ -228,6 +228,19 @@ pmap_switch_vas(struct vm_ctx *ctx, struct vas vas)
: "memory");
}
+/*
+ * TODO: During the mapping of a virtual address, a level
+ * may be allocated. This function does not handle the
+ * freeing of allocated levels. We should keep track
+ * of levels allocated and free them here.
+ */
+int
+pmap_free_vas(struct vm_ctx *ctx, struct vas vas)
+{
+ vm_free_pageframe(vas.top_level, 1);
+ return 0;
+}
+
struct vas
pmap_read_vas(void)
{