Subversion Repositories HelenOS

Rev

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

Rev 1227 Rev 1233
Line 135... Line 135...
135
    as_area_t *a;
135
    as_area_t *a;
136
   
136
   
137
    if (base % PAGE_SIZE)
137
    if (base % PAGE_SIZE)
138
        return NULL;
138
        return NULL;
139
 
139
 
-
 
140
    if (!size)
-
 
141
        return NULL;
-
 
142
 
140
    /* Writeable executable areas are not supported. */
143
    /* Writeable executable areas are not supported. */
141
    if ((flags & AS_AREA_EXEC) && (flags & AS_AREA_WRITE))
144
    if ((flags & AS_AREA_EXEC) && (flags & AS_AREA_WRITE))
142
        return NULL;
145
        return NULL;
143
   
146
   
144
    ipl = interrupts_disable();
147
    ipl = interrupts_disable();
Line 459... Line 462...
459
        interrupts_restore(ipl);
462
        interrupts_restore(ipl);
460
        return (__address) -1;
463
        return (__address) -1;
461
    }
464
    }
462
 
465
 
463
    pages = SIZE2FRAMES((address - area->base) + size);
466
    pages = SIZE2FRAMES((address - area->base) + size);
-
 
467
    if (!pages) {
-
 
468
        /*
-
 
469
         * Zero size address space areas are not allowed.
-
 
470
         */
-
 
471
        spinlock_unlock(&area->lock);
-
 
472
        spinlock_unlock(&as->lock);
-
 
473
        interrupts_restore(ipl);
-
 
474
        return (__address) -1;
-
 
475
    }
-
 
476
   
464
    if (pages < area->pages) {
477
    if (pages < area->pages) {
465
        int i;
478
        int i;
466
 
479
 
467
        /*
480
        /*
468
         * Shrinking the area.
481
         * Shrinking the area.