Subversion Repositories HelenOS

Rev

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

Rev 3207 Rev 3208
Line 263... Line 263...
263
    unsigned int i;
263
    unsigned int i;
264
    zone_t *z;
264
    zone_t *z;
265
    unsigned int hint = pzone ? *pzone : 0;
265
    unsigned int hint = pzone ? *pzone : 0;
266
   
266
   
267
    /* Mask off flags that are not applicable. */
267
    /* Mask off flags that are not applicable. */
268
    flags &= FRAME_LOW_16_GiB;
268
    flags &= FRAME_LOW_4_GiB;
269
 
269
 
270
    spinlock_lock(&zones.lock);
270
    spinlock_lock(&zones.lock);
271
    if (hint >= zones.count)
271
    if (hint >= zones.count)
272
        hint = 0;
272
        hint = 0;
273
    i = hint;
273
    i = hint;
Line 821... Line 821...
821
    spinlock_initialize(&z->lock, "zone_lock");
821
    spinlock_initialize(&z->lock, "zone_lock");
822
    z->base = start;
822
    z->base = start;
823
    z->count = count;
823
    z->count = count;
824
 
824
 
825
    /* Mask off flags that are calculated automatically. */
825
    /* Mask off flags that are calculated automatically. */
826
    flags &= ~FRAME_LOW_16_GiB;
826
    flags &= ~FRAME_LOW_4_GiB;
827
    /* Determine calculated flags. */
827
    /* Determine calculated flags. */
828
    if (z->base + count < (1ULL << (34 - FRAME_WIDTH))) /* 16 GiB */
828
    if (z->base + count < (1ULL << (32 - FRAME_WIDTH))) /* 4 GiB */
829
        flags |= FRAME_LOW_16_GiB;
829
        flags |= FRAME_LOW_4_GiB;
830
 
830
 
831
    z->flags = flags;
831
    z->flags = flags;
832
 
832
 
833
    z->free_count = count;
833
    z->free_count = count;
834
    z->busy_count = 0;
834
    z->busy_count = 0;