Rev 373 | Rev 375 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 373 | Rev 374 | ||
---|---|---|---|
Line 296... | Line 296... | ||
296 | ASSERT(start % FRAME_SIZE == 0); |
296 | ASSERT(start % FRAME_SIZE == 0); |
297 | ASSERT(size % FRAME_SIZE == 0); |
297 | ASSERT(size % FRAME_SIZE == 0); |
298 | 298 | ||
299 | cnt = size / FRAME_SIZE; |
299 | cnt = size / FRAME_SIZE; |
300 | 300 | ||
301 | z = (zone_t *) malloc(sizeof(zone_t)); |
301 | z = (zone_t *) early_malloc(sizeof(zone_t)); |
302 | if (z) { |
302 | if (z) { |
303 | link_initialize(&z->link); |
303 | link_initialize(&z->link); |
304 | spinlock_initialize(&z->lock); |
304 | spinlock_initialize(&z->lock); |
305 | 305 | ||
306 | z->base = start; |
306 | z->base = start; |
Line 309... | Line 309... | ||
309 | z->free_count = cnt; |
309 | z->free_count = cnt; |
310 | list_initialize(&z->free_head); |
310 | list_initialize(&z->free_head); |
311 | 311 | ||
312 | z->busy_count = 0; |
312 | z->busy_count = 0; |
313 | 313 | ||
314 | z->frames = (frame_t *) malloc(cnt * sizeof(frame_t)); |
314 | z->frames = (frame_t *) early_malloc(cnt * sizeof(frame_t)); |
315 | if (!z->frames) { |
315 | if (!z->frames) { |
316 | free(z); |
316 | free(z); |
317 | return NULL; |
317 | return NULL; |
318 | } |
318 | } |
319 | 319 |