Changes in kernel/generic/src/lib/ra.c [41deb2a:f97f1e51] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/lib/ra.c
r41deb2a rf97f1e51 185 185 return NULL; 186 186 187 spinlock_initialize(&arena->lock, "arena_lock");187 irq_spinlock_initialize(&arena->lock, "arena_lock"); 188 188 list_initialize(&arena->spans); 189 189 … … 209 209 210 210 /* TODO: check for overlaps */ 211 spinlock_lock(&arena->lock);211 irq_spinlock_lock(&arena->lock, true); 212 212 list_append(&span->span_link, &arena->spans); 213 spinlock_unlock(&arena->lock);213 irq_spinlock_unlock(&arena->lock, true); 214 214 return true; 215 215 } … … 390 390 ASSERT(ispwr2(alignment)); 391 391 392 spinlock_lock(&arena->lock);392 irq_spinlock_lock(&arena->lock, true); 393 393 list_foreach(arena->spans, cur) { 394 394 ra_span_t *span = list_get_instance(cur, ra_span_t, span_link); … … 398 398 break; 399 399 } 400 spinlock_unlock(&arena->lock);400 irq_spinlock_unlock(&arena->lock, true); 401 401 402 402 return base; … … 406 406 void ra_free(ra_arena_t *arena, uintptr_t base, size_t size) 407 407 { 408 spinlock_lock(&arena->lock);408 irq_spinlock_lock(&arena->lock, true); 409 409 list_foreach(arena->spans, cur) { 410 410 ra_span_t *span = list_get_instance(cur, ra_span_t, span_link); … … 412 412 if (iswithin(span->base, span->size, base, size)) { 413 413 ra_span_free(span, base, size); 414 spinlock_unlock(&arena->lock);414 irq_spinlock_unlock(&arena->lock, true); 415 415 return; 416 416 } 417 417 } 418 spinlock_unlock(&arena->lock);418 irq_spinlock_unlock(&arena->lock, true); 419 419 420 420 panic("Freeing to wrong arena (base=%" PRIxn ", size=%" PRIdn ").", … … 424 424 void ra_init(void) 425 425 { 426 ra_segment_cache = slab_cache_create(" segment_cache",426 ra_segment_cache = slab_cache_create("ra_segment_t", 427 427 sizeof(ra_segment_t), 0, NULL, NULL, SLAB_CACHE_MAGDEFERRED); 428 428 }
Note:
See TracChangeset
for help on using the changeset viewer.