Ignore:
File:
1 edited

Legend:

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

    rabf6c01 r6785b88b  
    141141        if (!AS_KERNEL)
    142142                panic("Cannot create kernel address space.");
     143
     144        /*
     145         * Make sure the kernel address space
     146         * reference count never drops to zero.
     147         */
     148        as_hold(AS_KERNEL);
    143149}
    144150
     
    151157as_t *as_create(unsigned int flags)
    152158{
    153         as_t *as = (as_t *) slab_alloc(as_cache, FRAME_ATOMIC);
    154         if (!as)
    155                 return NULL;
    156 
     159        as_t *as = (as_t *) slab_alloc(as_cache, 0);
    157160        (void) as_create_arch(as, 0);
    158161
     
    22402243 *
    22412244 */
    2242 as_area_info_t *as_get_area_info(as_t *as, size_t *osize)
     2245void as_get_area_info(as_t *as, as_area_info_t **obuf, size_t *osize)
    22432246{
    22442247        mutex_lock(&as->lock);
     
    22482251
    22492252        size_t isize = area_cnt * sizeof(as_area_info_t);
    2250         as_area_info_t *info = malloc(isize);
    2251         if (!info) {
    2252                 mutex_unlock(&as->lock);
    2253                 return NULL;
    2254         }
     2253        as_area_info_t *info = nfmalloc(isize);
    22552254
    22562255        /* Record area data. */
     
    22742273        mutex_unlock(&as->lock);
    22752274
     2275        *obuf = info;
    22762276        *osize = isize;
    2277         return info;
    22782277}
    22792278
Note: See TracChangeset for help on using the changeset viewer.