diff options
author | Ian Moffett <ian@osmora.org> | 2025-06-09 01:46:32 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-06-09 01:46:32 -0400 |
commit | 547faafc2b5731256c77e7799c34d0c62a2195c6 (patch) | |
tree | fb38b66fca5534893263df3a39812a6548d8a7d8 /sys/vm/vm_physmem.c | |
parent | ba5a42ffd5e68beb60461dc735732ccb582a6d92 (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.c | 2 |
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); |