Changes in kernel/generic/src/mm/as.c [908bb96:94795812] in mainline
- File:
-
- 1 edited
-
kernel/generic/src/mm/as.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
r908bb96 r94795812 79 79 #include <syscall/copy.h> 80 80 #include <arch/interrupt.h> 81 #include <interrupt.h>82 81 83 82 /** … … 427 426 /* 428 427 * So far, the area does not conflict with other areas. 429 * Check if it is contained in the useraddress space.428 * Check if it doesn't conflict with kernel address space. 430 429 */ 431 430 if (!KERNEL_ADDRESS_SPACE_SHADOWED) { 432 return iswithin(USER_ADDRESS_SPACE_START, 433 (USER_ADDRESS_SPACE_END - USER_ADDRESS_SPACE_START) + 1, 434 addr, P2SZ(count)); 431 return !overlaps(addr, P2SZ(count), KERNEL_ADDRESS_SPACE_START, 432 KERNEL_ADDRESS_SPACE_END - KERNEL_ADDRESS_SPACE_START); 435 433 } 436 434 … … 698 696 return ENOENT; 699 697 } 700 701 if (!area->backend->is_resizable(area)) { 702 /* 703 * The backend does not support resizing for this area. 698 699 if (area->backend == &phys_backend) { 700 /* 701 * Remapping of address space areas associated 702 * with memory mapped devices is not supported. 704 703 */ 705 704 mutex_unlock(&area->lock); … … 1058 1057 } 1059 1058 1060 if (!src_area->backend->is_shareable(src_area)) { 1061 /* 1062 * The backend does not permit sharing of this area. 1059 if ((!src_area->backend) || (!src_area->backend->share)) { 1060 /* 1061 * There is no backend or the backend does not 1062 * know how to share the area. 1063 1063 */ 1064 1064 mutex_unlock(&src_area->lock); … … 1363 1363 int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate) 1364 1364 { 1365 int rc = AS_PF_FAULT;1366 1367 1365 if (!THREAD) 1368 goto page_fault;1366 return AS_PF_FAULT; 1369 1367 1370 1368 if (!AS) 1371 goto page_fault;1369 return AS_PF_FAULT; 1372 1370 1373 1371 mutex_lock(&AS->lock); … … 1425 1423 * Resort to the backend page fault handler. 1426 1424 */ 1427 rc = area->backend->page_fault(area, page, access); 1428 if (rc != AS_PF_OK) { 1425 if (area->backend->page_fault(area, page, access) != AS_PF_OK) { 1429 1426 page_table_unlock(AS, false); 1430 1427 mutex_unlock(&area->lock); … … 1447 1444 istate_set_retaddr(istate, 1448 1445 (uintptr_t) &memcpy_to_uspace_failover_address); 1449 } else if (rc == AS_PF_SILENT) {1450 printf("Killing task %" PRIu64 " due to a "1451 "failed late reservation request.\n", TASK->taskid);1452 task_kill_self(true);1453 1446 } else { 1454 fault_if_from_uspace(istate, "Page fault: %p.", (void *) page); 1455 panic_memtrap(istate, access, page, NULL); 1447 return AS_PF_FAULT; 1456 1448 } 1457 1449
Note:
See TracChangeset
for help on using the changeset viewer.
