Changeset 04803bf in mainline for kernel/generic/src/mm/backend_elf.c


Ignore:
Timestamp:
2011-03-21T22:00:17Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
143932e3
Parents:
b50b5af2 (diff), 7308e84 (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 (needs fixes).

File:
1 edited

Legend:

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

    rb50b5af2 r04803bf  
    3838#include <lib/elf.h>
    3939#include <debug.h>
    40 #include <arch/types.h>
     40#include <typedefs.h>
    4141#include <mm/as.h>
    4242#include <mm/frame.h>
     
    8585        size_t i;
    8686        bool dirty = false;
     87
     88        ASSERT(page_table_locked(AS));
     89        ASSERT(mutex_locked(&area->lock));
    8790
    8891        if (!as_area_check_access(area, access))
     
    232235void elf_frame_free(as_area_t *area, uintptr_t page, uintptr_t frame)
    233236{
    234         elf_header_t *elf = area->backend_data.elf;
    235237        elf_segment_header_t *entry = area->backend_data.segment;
    236         uintptr_t base, start_anon;
    237         size_t i;
    238 
    239         ASSERT((page >= ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) &&
    240             (page < entry->p_vaddr + entry->p_memsz));
    241         i = (page - ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH;
    242         base = (uintptr_t) (((void *) elf) +
    243             ALIGN_DOWN(entry->p_offset, FRAME_SIZE));
     238        uintptr_t start_anon;
     239
     240        ASSERT(page_table_locked(area->as));
     241        ASSERT(mutex_locked(&area->lock));
     242
     243        ASSERT(page >= ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE));
     244        ASSERT(page < entry->p_vaddr + entry->p_memsz);
     245
    244246        start_anon = entry->p_vaddr + entry->p_filesz;
    245247
     
    257259                 * lower part is backed by the ELF image and the upper is
    258260                 * anonymous). In any case, a frame needs to be freed.
    259                  */ 
     261                 */
    260262                frame_free(frame);
    261263        }
     
    267269 * Otherwise only portions of the area that are not backed by the ELF image
    268270 * are put into the pagemap.
    269  *
    270  * The address space and address space area must be locked prior to the call.
    271271 *
    272272 * @param area          Address space area.
     
    278278        btree_node_t *leaf, *node;
    279279        uintptr_t start_anon = entry->p_vaddr + entry->p_filesz;
     280
     281        ASSERT(mutex_locked(&area->as->lock));
     282        ASSERT(mutex_locked(&area->lock));
    280283
    281284        /*
Note: See TracChangeset for help on using the changeset viewer.