Changeset 25eec4e in mainline for kernel/generic/src/mm/backend_phys.c


Ignore:
Timestamp:
2013-04-19T18:38:18Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6d717a4
Parents:
a1e2df13 (diff), 289cb7dd (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline chages.

File:
1 edited

Legend:

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

    ra1e2df13 r25eec4e  
    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.