/kernel/trunk/generic/src/mm/slab.c |
---|
756,6 → 756,10 |
spinlock_unlock(&slab_cache_lock); |
} |
#ifdef CONFIG_DEBUG |
static int _slab_initialized = 0; |
#endif |
void slab_cache_init(void) |
{ |
int i, size; |
788,6 → 792,9 |
size, 0, |
NULL,NULL,0); |
} |
#ifdef CONFIG_DEBUG |
_slab_initialized = 1; |
#endif |
} |
/**************************************/ |
795,7 → 802,8 |
void * kalloc(unsigned int size, int flags) |
{ |
int idx; |
ASSERT(_slab_initialized); |
ASSERT( size && size <= (1 << SLAB_MAX_MALLOC_W)); |
if (size < (1 << SLAB_MIN_MALLOC_W)) |
/kernel/trunk/generic/src/mm/as.c |
---|
65,7 → 65,7 |
void as_init(void) |
{ |
as_arch_init(); |
AS_KERNEL = as_create(FLAG_AS_KERNEL); |
AS_KERNEL = as_create(FLAG_AS_KERNEL | FLAG_AS_EARLYMALLOC); |
if (!AS_KERNEL) |
panic("can't create kernel address space\n"); |
} |
78,7 → 78,10 |
{ |
as_t *as; |
as = (as_t *) early_malloc(sizeof(as_t)); |
if (flags & FLAG_AS_EARLYMALLOC) |
as = (as_t *) early_malloc(sizeof(as_t)); |
else |
as = (as_t *) malloc(sizeof(as_t)); |
if (as) { |
list_initialize(&as->as_with_asid_link); |
spinlock_initialize(&as->lock, "as_lock"); |