Changeset 1295a1da in mainline
- Timestamp:
- 2012-05-06T17:27:16Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 25ebfbd
- Parents:
- caed0279
- Location:
- kernel/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/lib/ra.h
rcaed0279 r1295a1da 42 42 43 43 typedef struct { 44 SPINLOCK_DECLARE(lock);44 IRQ_SPINLOCK_DECLARE(lock); 45 45 list_t spans; /**< List of arena's spans. */ 46 46 } ra_arena_t; -
kernel/generic/src/lib/ra.c
rcaed0279 r1295a1da 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 ").",
Note:
See TracChangeset
for help on using the changeset viewer.