Skip to content

Commit

Permalink
vm: Allow unaligned allocations for vm_map_memory
Browse files Browse the repository at this point in the history
  • Loading branch information
marv7000 committed Feb 2, 2025
1 parent fdd1dce commit bd1efcb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/memory/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void* vm_map_memory(PhysAddr phys_addr, usize len, VMProt prot)
const usize page_size = vm_get_page_size(VMLevel_Small);
const usize aligned_bytes = ALIGN_UP(len, page_size);
const usize num_pages = aligned_bytes / page_size;
phys_addr = ALIGN_DOWN(phys_addr, page_size);

VirtAddr start = kernel_memory_base;
for (usize page = 0; page < num_pages; page++)
Expand Down

0 comments on commit bd1efcb

Please sign in to comment.