Ignore:
File:
1 edited

Legend:

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

    r6785b88b rabf6c01  
    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);
    149143}
    150144
     
    157151as_t *as_create(unsigned int flags)
    158152{
    159         as_t *as = (as_t *) slab_alloc(as_cache, 0);
     153        as_t *as = (as_t *) slab_alloc(as_cache, FRAME_ATOMIC);
     154        if (!as)
     155                return NULL;
     156
    160157        (void) as_create_arch(as, 0);
    161158
     
    22432240 *
    22442241 */
    2245 void as_get_area_info(as_t *as, as_area_info_t **obuf, size_t *osize)
     2242as_area_info_t *as_get_area_info(as_t *as, size_t *osize)
    22462243{
    22472244        mutex_lock(&as->lock);
     
    22512248
    22522249        size_t isize = area_cnt * sizeof(as_area_info_t);
    2253         as_area_info_t *info = nfmalloc(isize);
     2250        as_area_info_t *info = malloc(isize);
     2251        if (!info) {
     2252                mutex_unlock(&as->lock);
     2253                return NULL;
     2254        }
    22542255
    22552256        /* Record area data. */
     
    22732274        mutex_unlock(&as->lock);
    22742275
    2275         *obuf = info;
    22762276        *osize = isize;
     2277        return info;
    22772278}
    22782279
Note: See TracChangeset for help on using the changeset viewer.