summaryrefslogtreecommitdiff
path: root/sys/vm/vm_physmem.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-06-09 01:46:32 -0400
committerIan Moffett <ian@osmora.org>2025-06-09 01:46:32 -0400
commit547faafc2b5731256c77e7799c34d0c62a2195c6 (patch)
treefb38b66fca5534893263df3a39812a6548d8a7d8 /sys/vm/vm_physmem.c
parentba5a42ffd5e68beb60461dc735732ccb582a6d92 (diff)
kernel: physmem: Ensure base is page aligned
- Use ALIGN_UP() on base address in vm_free_frame() Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/vm/vm_physmem.c')
-rw-r--r--sys/vm/vm_physmem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/vm/vm_physmem.c b/sys/vm/vm_physmem.c
index c7fcedb..ad8a38d 100644
--- a/sys/vm/vm_physmem.c
+++ b/sys/vm/vm_physmem.c
@@ -169,6 +169,8 @@ vm_free_frame(uintptr_t base, size_t count)
{
size_t stop_at = base + (count * DEFAULT_PAGESIZE);
+ base = ALIGN_UP(base, DEFAULT_PAGESIZE);
+
spinlock_acquire(&lock);
for (uintptr_t p = base; p < stop_at; p += DEFAULT_PAGESIZE) {
clrbit(bitmap, p / DEFAULT_PAGESIZE);