Use only whole kernel lock

This commit is contained in:
TXuian
2024-03-15 16:21:36 +08:00
parent d987bf0357
commit b939557317
14 changed files with 8 additions and 79 deletions

View File

@@ -106,7 +106,8 @@ int task_exec(struct TaskMicroDescriptor* task, char* img_start, char* name, cha
for (int addr_offset = 0; addr_offset < ph.filesz; addr_offset += PAGE_SIZE) {
uintptr_t page_paddr = xizi_pager.address_translate(&pgdir, ph.vaddr + addr_offset);
if (page_paddr == 0) {
panic("copy elf file to unmapped addr");
ERROR("copy elf file to unmapped addr");
goto error_exec;
}
uintptr_t read_size = (ph.filesz - addr_offset < PAGE_SIZE ? ph.filesz - addr_offset : PAGE_SIZE);
memcpy(P2V(page_paddr), img_start + (ph.off + addr_offset), read_size);