Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/as.c

    r908bb96 r94795812  
    7979#include <syscall/copy.h>
    8080#include <arch/interrupt.h>
    81 #include <interrupt.h>
    8281
    8382/**
     
    427426        /*
    428427         * So far, the area does not conflict with other areas.
    429          * Check if it is contained in the user address space.
     428         * Check if it doesn't conflict with kernel address space.
    430429         */
    431430        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);
    435433        }
    436434       
     
    698696                return ENOENT;
    699697        }
    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.
    704703                 */
    705704                mutex_unlock(&area->lock);
     
    10581057        }
    10591058       
    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.
    10631063                 */
    10641064                mutex_unlock(&src_area->lock);
     
    13631363int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate)
    13641364{
    1365         int rc = AS_PF_FAULT;
    1366 
    13671365        if (!THREAD)
    1368                 goto page_fault;
     1366                return AS_PF_FAULT;
    13691367       
    13701368        if (!AS)
    1371                 goto page_fault;
     1369                return AS_PF_FAULT;
    13721370       
    13731371        mutex_lock(&AS->lock);
     
    14251423         * Resort to the backend page fault handler.
    14261424         */
    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) {
    14291426                page_table_unlock(AS, false);
    14301427                mutex_unlock(&area->lock);
     
    14471444                istate_set_retaddr(istate,
    14481445                    (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);
    14531446        } else {
    1454                 fault_if_from_uspace(istate, "Page fault: %p.", (void *) page);
    1455                 panic_memtrap(istate, access, page, NULL);
     1447                return AS_PF_FAULT;
    14561448        }
    14571449       
Note: See TracChangeset for help on using the changeset viewer.