Subversion Repositories HelenOS

Rev

Rev 3104 | Rev 3222 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3104 Rev 3186
Line 124... Line 124...
124
{
124
{
125
    as_t *as = (as_t *) obj;
125
    as_t *as = (as_t *) obj;
126
    int rc;
126
    int rc;
127
 
127
 
128
    link_initialize(&as->inactive_as_with_asid_link);
128
    link_initialize(&as->inactive_as_with_asid_link);
129
    mutex_initialize(&as->lock);   
129
    mutex_initialize(&as->lock, MUTEX_PASSIVE);
130
   
130
   
131
    rc = as_constructor_arch(as, flags);
131
    rc = as_constructor_arch(as, flags);
132
   
132
   
133
    return rc;
133
    return rc;
134
}
134
}
Line 166... Line 166...
166
    as_t *as;
166
    as_t *as;
167
 
167
 
168
#ifdef __OBJC__
168
#ifdef __OBJC__
169
    as = [as_t new];
169
    as = [as_t new];
170
    link_initialize(&as->inactive_as_with_asid_link);
170
    link_initialize(&as->inactive_as_with_asid_link);
171
    mutex_initialize(&as->lock);   
171
    mutex_initialize(&as->lock, MUTEX_PASSIVE);
172
    (void) as_constructor_arch(as, flags);
172
    (void) as_constructor_arch(as, flags);
173
#else
173
#else
174
    as = (as_t *) slab_alloc(as_slab, 0);
174
    as = (as_t *) slab_alloc(as_slab, 0);
175
#endif
175
#endif
176
    (void) as_create_arch(as, 0);
176
    (void) as_create_arch(as, 0);
Line 310... Line 310...
310
        return NULL;
310
        return NULL;
311
    }
311
    }
312
   
312
   
313
    a = (as_area_t *) malloc(sizeof(as_area_t), 0);
313
    a = (as_area_t *) malloc(sizeof(as_area_t), 0);
314
 
314
 
315
    mutex_initialize(&a->lock);
315
    mutex_initialize(&a->lock, MUTEX_PASSIVE);
316
   
316
   
317
    a->as = as;
317
    a->as = as;
318
    a->flags = flags;
318
    a->flags = flags;
319
    a->attributes = attrs;
319
    a->attributes = attrs;
320
    a->pages = SIZE2FRAMES(size);
320
    a->pages = SIZE2FRAMES(size);
Line 692... Line 692...
692
     * Then it will be safe to unlock it.
692
     * Then it will be safe to unlock it.
693
     */
693
     */
694
    sh_info = src_area->sh_info;
694
    sh_info = src_area->sh_info;
695
    if (!sh_info) {
695
    if (!sh_info) {
696
        sh_info = (share_info_t *) malloc(sizeof(share_info_t), 0);
696
        sh_info = (share_info_t *) malloc(sizeof(share_info_t), 0);
697
        mutex_initialize(&sh_info->lock);
697
        mutex_initialize(&sh_info->lock, MUTEX_PASSIVE);
698
        sh_info->refcount = 2;
698
        sh_info->refcount = 2;
699
        btree_create(&sh_info->pagemap);
699
        btree_create(&sh_info->pagemap);
700
        src_area->sh_info = sh_info;
700
        src_area->sh_info = sh_info;
701
        /*
701
        /*
702
         * Call the backend to setup sharing.
702
         * Call the backend to setup sharing.