Ignore:
File:
1 edited

Legend:

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

    rcda1378 r59fb782  
    5252static void phys_destroy(as_area_t *);
    5353
     54static bool phys_is_resizable(as_area_t *);
     55static bool phys_is_shareable(as_area_t *);
     56
     57
    5458static int phys_page_fault(as_area_t *, uintptr_t, pf_access_t);
    5559
     
    5963        .share = phys_share,
    6064        .destroy = phys_destroy,
     65
     66        .is_resizable = phys_is_resizable,
     67        .is_shareable = phys_is_shareable,
    6168
    6269        .page_fault = phys_page_fault,
     
    8895}
    8996
     97bool phys_is_resizable(as_area_t *area)
     98{
     99        return false;
     100}
     101
     102bool phys_is_shareable(as_area_t *area)
     103{
     104        return true;
     105}
     106
     107
    90108/** Service a page fault in the address space area backed by physical memory.
    91109 *
     
    93111 *
    94112 * @param area Pointer to the address space area.
    95  * @param addr Faulting virtual address.
     113 * @param upage Faulting virtual page.
    96114 * @param access Access mode that caused the fault (i.e. read/write/exec).
    97115 *
     
    99117 * serviced).
    100118 */
    101 int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access)
     119int phys_page_fault(as_area_t *area, uintptr_t upage, pf_access_t access)
    102120{
    103121        uintptr_t base = area->backend_data.base;
     
    105123        ASSERT(page_table_locked(AS));
    106124        ASSERT(mutex_locked(&area->lock));
     125        ASSERT(IS_ALIGNED(upage, PAGE_SIZE));
    107126
    108127        if (!as_area_check_access(area, access))
    109128                return AS_PF_FAULT;
    110129
    111         ASSERT(addr - area->base < area->backend_data.frames * FRAME_SIZE);
    112         page_mapping_insert(AS, addr, base + (addr - area->base),
     130        ASSERT(upage - area->base < area->backend_data.frames * FRAME_SIZE);
     131        page_mapping_insert(AS, upage, base + (upage - area->base),
    113132            as_area_get_flags(area));
    114133       
    115         if (!used_space_insert(area, ALIGN_DOWN(addr, PAGE_SIZE), 1))
     134        if (!used_space_insert(area, upage, 1))
    116135                panic("Cannot insert used space.");
    117136
Note: See TracChangeset for help on using the changeset viewer.