Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/ra.c

    r41deb2a rf97f1e51  
    185185                return NULL;
    186186
    187         spinlock_initialize(&arena->lock, "arena_lock");
     187        irq_spinlock_initialize(&arena->lock, "arena_lock");
    188188        list_initialize(&arena->spans);
    189189
     
    209209
    210210        /* TODO: check for overlaps */
    211         spinlock_lock(&arena->lock);
     211        irq_spinlock_lock(&arena->lock, true);
    212212        list_append(&span->span_link, &arena->spans);
    213         spinlock_unlock(&arena->lock);
     213        irq_spinlock_unlock(&arena->lock, true);
    214214        return true;
    215215}
     
    390390        ASSERT(ispwr2(alignment));
    391391
    392         spinlock_lock(&arena->lock);
     392        irq_spinlock_lock(&arena->lock, true);
    393393        list_foreach(arena->spans, cur) {
    394394                ra_span_t *span = list_get_instance(cur, ra_span_t, span_link);
     
    398398                        break;
    399399        }
    400         spinlock_unlock(&arena->lock);
     400        irq_spinlock_unlock(&arena->lock, true);
    401401
    402402        return base;
     
    406406void ra_free(ra_arena_t *arena, uintptr_t base, size_t size)
    407407{
    408         spinlock_lock(&arena->lock);
     408        irq_spinlock_lock(&arena->lock, true);
    409409        list_foreach(arena->spans, cur) {
    410410                ra_span_t *span = list_get_instance(cur, ra_span_t, span_link);
     
    412412                if (iswithin(span->base, span->size, base, size)) {
    413413                        ra_span_free(span, base, size);
    414                         spinlock_unlock(&arena->lock);
     414                        irq_spinlock_unlock(&arena->lock, true);
    415415                        return;
    416416                }
    417417        }
    418         spinlock_unlock(&arena->lock);
     418        irq_spinlock_unlock(&arena->lock, true);
    419419
    420420        panic("Freeing to wrong arena (base=%" PRIxn ", size=%" PRIdn ").",
     
    424424void ra_init(void)
    425425{
    426         ra_segment_cache = slab_cache_create("segment_cache",
     426        ra_segment_cache = slab_cache_create("ra_segment_t",
    427427            sizeof(ra_segment_t), 0, NULL, NULL, SLAB_CACHE_MAGDEFERRED);
    428428}
Note: See TracChangeset for help on using the changeset viewer.