Changeset 06b0211b in mainline for kernel/generic/src/mm/backend_elf.c


Ignore:
Timestamp:
2013-04-29T11:29:45Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aa2b32c
Parents:
ba4799a (diff), df956b9b (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 changes

File:
1 edited

Legend:

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

    rba4799a r06b0211b  
    235235 *
    236236 * @param area          Pointer to the address space area.
    237  * @param addr          Faulting virtual address.
     237 * @param upage         Faulting virtual page.
    238238 * @param access        Access mode that caused the fault (i.e.
    239239 *                      read/write/exec).
     
    242242 *                      on success (i.e. serviced).
    243243 */
    244 int elf_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access)
     244int elf_page_fault(as_area_t *area, uintptr_t upage, pf_access_t access)
    245245{
    246246        elf_header_t *elf = area->backend_data.elf;
     
    250250        uintptr_t frame;
    251251        uintptr_t kpage;
    252         uintptr_t upage;
    253252        uintptr_t start_anon;
    254253        size_t i;
     
    257256        ASSERT(page_table_locked(AS));
    258257        ASSERT(mutex_locked(&area->lock));
     258        ASSERT(IS_ALIGNED(upage, PAGE_SIZE));
    259259
    260260        if (!as_area_check_access(area, access))
    261261                return AS_PF_FAULT;
    262262       
    263         if (addr < ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE))
     263        if (upage < ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE))
    264264                return AS_PF_FAULT;
    265265       
    266         if (addr >= entry->p_vaddr + entry->p_memsz)
     266        if (upage >= entry->p_vaddr + entry->p_memsz)
    267267                return AS_PF_FAULT;
    268268       
    269         i = (addr - ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH;
     269        i = (upage - ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH;
    270270        base = (uintptr_t)
    271271            (((void *) elf) + ALIGN_DOWN(entry->p_offset, PAGE_SIZE));
    272 
    273         /* Virtual address of faulting page */
    274         upage = ALIGN_DOWN(addr, PAGE_SIZE);
    275272
    276273        /* Virtual address of the end of initialized part of segment */
Note: See TracChangeset for help on using the changeset viewer.