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