Ignore:
File:
1 edited

Legend:

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

    r59fb782 rcda1378  
    5252static void phys_destroy(as_area_t *);
    5353
    54 static bool phys_is_resizable(as_area_t *);
    55 static bool phys_is_shareable(as_area_t *);
    56 
    57 
    5854static int phys_page_fault(as_area_t *, uintptr_t, pf_access_t);
    5955
     
    6359        .share = phys_share,
    6460        .destroy = phys_destroy,
    65 
    66         .is_resizable = phys_is_resizable,
    67         .is_shareable = phys_is_shareable,
    6861
    6962        .page_fault = phys_page_fault,
     
    9588}
    9689
    97 bool phys_is_resizable(as_area_t *area)
    98 {
    99         return false;
    100 }
    101 
    102 bool phys_is_shareable(as_area_t *area)
    103 {
    104         return true;
    105 }
    106 
    107 
    10890/** Service a page fault in the address space area backed by physical memory.
    10991 *
     
    11193 *
    11294 * @param area Pointer to the address space area.
    113  * @param upage Faulting virtual page.
     95 * @param addr Faulting virtual address.
    11496 * @param access Access mode that caused the fault (i.e. read/write/exec).
    11597 *
     
    11799 * serviced).
    118100 */
    119 int phys_page_fault(as_area_t *area, uintptr_t upage, pf_access_t access)
     101int phys_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access)
    120102{
    121103        uintptr_t base = area->backend_data.base;
     
    123105        ASSERT(page_table_locked(AS));
    124106        ASSERT(mutex_locked(&area->lock));
    125         ASSERT(IS_ALIGNED(upage, PAGE_SIZE));
    126107
    127108        if (!as_area_check_access(area, access))
    128109                return AS_PF_FAULT;
    129110
    130         ASSERT(upage - area->base < area->backend_data.frames * FRAME_SIZE);
    131         page_mapping_insert(AS, upage, base + (upage - area->base),
     111        ASSERT(addr - area->base < area->backend_data.frames * FRAME_SIZE);
     112        page_mapping_insert(AS, addr, base + (addr - area->base),
    132113            as_area_get_flags(area));
    133114       
    134         if (!used_space_insert(area, upage, 1))
     115        if (!used_space_insert(area, ALIGN_DOWN(addr, PAGE_SIZE), 1))
    135116                panic("Cannot insert used space.");
    136117
Note: See TracChangeset for help on using the changeset viewer.