Changeset 3ac69647 in mainline


Ignore:
Timestamp:
2011-04-17T19:25:16Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8f6c6264
Parents:
2c86f81
Message:

Factor out common code to elf_nonanon_pages_get().

File:
1 edited

Legend:

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

    r2c86f81 r3ac69647  
    7070};
    7171
    72 bool elf_create(as_area_t *area)
     72static size_t elf_nonanon_pages_get(as_area_t *area)
    7373{
    7474        elf_segment_header_t *entry = area->backend_data.segment;
     
    7676
    7777        if (entry->p_flags & PF_W)
    78                 nonanon_pages = 0;
     78                return 0;
     79
     80        return nonanon_pages;
     81}
     82
     83bool elf_create(as_area_t *area)
     84{
     85        size_t nonanon_pages = elf_nonanon_pages_get(area);
    7986
    8087        if (area->pages <= nonanon_pages)
     
    8693bool elf_resize(as_area_t *area, size_t new_pages)
    8794{
    88         elf_segment_header_t *entry = area->backend_data.segment;
    89         size_t nonanon_pages = ALIGN_DOWN(entry->p_filesz, PAGE_SIZE);
    90 
    91         if (entry->p_flags & PF_W)
    92                 nonanon_pages = 0;
     95        size_t nonanon_pages = elf_nonanon_pages_get(area);
    9396
    9497        if (new_pages > area->pages) {
     
    199202void elf_destroy(as_area_t *area)
    200203{
    201         elf_segment_header_t *entry = area->backend_data.segment;
    202         size_t nonanon_pages = ALIGN_DOWN(entry->p_filesz, PAGE_SIZE);
    203 
    204         if (entry->p_flags & PF_W)
    205                 nonanon_pages = 0;
     204        size_t nonanon_pages = elf_nonanon_pages_get(area);
    206205
    207206        if (area->pages > nonanon_pages)
Note: See TracChangeset for help on using the changeset viewer.