Support multi page task mapping

This commit is contained in:
tuyuyang
2024-07-28 14:02:14 +08:00
parent 19d467463b
commit 4716a4e018
13 changed files with 41 additions and 48 deletions

View File

@@ -111,7 +111,7 @@ static uintptr_t map_task_share_page(struct Thread* task, const uintptr_t paddr,
vaddr = alloc_share_page_addr(task, nr_pages * 2);
// time to use buddy
if (vaddr >= USER_IPC_USE_ALLOCATOR_WATERMARK) {
if (vaddr + (2 * nr_pages * PAGE_SIZE) >= USER_IPC_USE_ALLOCATOR_WATERMARK) {
task->memspace->massive_ipc_allocator = (struct KBuddy*)slab_alloc(&xizi_task_manager.task_buddy_allocator);
if (!task->memspace->massive_ipc_allocator) {
ERROR("Alloc task buddy failed.\n");