kernel/ELF: Avoid zeroing out memory twice
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4f6e020196
commit
2acd2ed75d
@ -101,9 +101,12 @@ namespace ELFLoader
|
||||
if (can_execute_segment(program_header.p_flags)) flags &= ~MMU::NoExecute;
|
||||
|
||||
// Allocate physical memory for the segment
|
||||
TRY(MemoryManager::alloc_at_zeroed(
|
||||
TRY(MemoryManager::alloc_at(
|
||||
base_vaddr, get_blocks_from_size(program_header.p_memsz + vaddr_diff, ARCH_PAGE_SIZE), flags));
|
||||
|
||||
// Zero out unused memory (before the start of the segment)
|
||||
memset((void*)base_vaddr, 0, vaddr_diff);
|
||||
|
||||
// Load the file section of the segment
|
||||
inode->read((u8*)program_header.p_vaddr, program_header.p_offset, program_header.p_filesz);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user