87,12 → 87,12 |
* address space operations such as creating or locking page tables. |
*/ |
as_operations_t *as_operations = NULL; |
#endif |
|
/** |
* Slab for as_t objects. |
*/ |
static slab_cache_t *as_slab; |
#endif |
|
/** |
* This lock protects inactive_as_with_asid_head list. It must be acquired |
115,7 → 115,6 |
as_area_t *avoid_area); |
static void sh_info_remove_reference(share_info_t *sh_info); |
|
#ifndef __OBJC__ |
static int as_constructor(void *obj, int flags) |
{ |
as_t *as = (as_t *) obj; |
135,17 → 134,14 |
|
return as_destructor_arch(as); |
} |
#endif |
|
/** Initialize address space subsystem. */ |
void as_init(void) |
{ |
as_arch_init(); |
|
#ifndef __OBJC__ |
|
as_slab = slab_cache_create("as_slab", sizeof(as_t), 0, |
as_constructor, as_destructor, SLAB_CACHE_MAGDEFERRED); |
#endif |
|
AS_KERNEL = as_create(FLAG_AS_KERNEL); |
if (!AS_KERNEL) |
161,14 → 157,7 |
{ |
as_t *as; |
|
#ifdef __OBJC__ |
as = [as_t new]; |
link_initialize(&as->inactive_as_with_asid_link); |
mutex_initialize(&as->lock); |
(void) as_constructor_arch(as, flags); |
#else |
as = (as_t *) slab_alloc(as_slab, 0); |
#endif |
(void) as_create_arch(as, 0); |
|
btree_create(&as->as_area_btree); |
239,12 → 228,8 |
#endif |
|
interrupts_restore(ipl); |
|
#ifdef __OBJC__ |
[as free]; |
#else |
|
slab_free(as_slab, as); |
#endif |
} |
|
/** Create address space area of common attributes. |