Changeset c23502d in mainline for generic/src/mm/as.c


Ignore:
Timestamp:
2006-03-15T23:54:19Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2d5a54f3
Parents:
649799a
Message:

Support only anonymous address space areas.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/mm/as.c

    r649799a rc23502d  
    120120 *
    121121 * @param as Target address space.
    122  * @param type Type of area.
     122 * @param flags Flags of the area.
    123123 * @param size Size of area in multiples of PAGE_SIZE.
    124124 * @param base Base address of area.
     
    126126 * @return Address space area on success or NULL on failure.
    127127 */
    128 as_area_t *as_area_create(as_t *as, as_area_type_t type, size_t size, __address base)
     128as_area_t *as_area_create(as_t *as, int flags, size_t size, __address base)
    129129{
    130130        ipl_t ipl;
     
    146146       
    147147        link_initialize(&a->link);                     
    148         a->type = type;
     148        a->flags = flags;
    149149        a->size = size;
    150150        a->base = base;
     
    327327        int flags;
    328328
    329         switch (a->type) {
    330                 case AS_AREA_TEXT:
    331                         flags = PAGE_EXEC | PAGE_READ | PAGE_USER | PAGE_PRESENT | PAGE_CACHEABLE;
    332                         break;
    333                 case AS_AREA_DATA:
    334                 case AS_AREA_STACK:
    335                         flags = PAGE_READ | PAGE_WRITE | PAGE_USER | PAGE_PRESENT | PAGE_CACHEABLE;
    336                         break;
    337                 default:
    338                         panic("unexpected as_area_type_t %d", a->type);
    339         }
     329        flags = PAGE_USER | PAGE_PRESENT | PAGE_CACHEABLE;
     330       
     331        if (a->flags & AS_AREA_READ)
     332                flags |= PAGE_READ;
     333               
     334        if (a->flags & AS_AREA_WRITE)
     335                flags |= PAGE_WRITE;
     336       
     337        if (a->flags & AS_AREA_EXEC)
     338                flags |= PAGE_EXEC;
    340339       
    341340        return flags;
Note: See TracChangeset for help on using the changeset viewer.