Changeset 551 for trunk/kernel/mm/khm.c


Ignore:
Timestamp:
Sep 21, 2018, 10:24:34 PM (3 years ago)
Author:
nicolas.van.phan@…
Message:

Make locks before IDLE Init busy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/khm.c

    r492 r551  
    7878
    7979        // get lock protecting heap
    80         spinlock_lock( &khm->lock );
     80        uint32_t       irq_state;
     81        spinlock_lock_busy( &khm->lock, &irq_state );
    8182
    8283        // define a starting block to scan existing blocks
     
    9293                if( (intptr_t)current >= (khm->base + khm->size) )  // heap full
    9394                {
    94                         spinlock_unlock(&khm->lock);
     95                        spinlock_unlock_busy(&khm->lock, irq_state );
    9596
    9697                        printk("\n[ERROR] in %s : failed to allocate block of size %d\n",
     
    122123
    123124        // release lock protecting heap
    124         spinlock_unlock( &khm->lock );
     125        spinlock_unlock_busy( &khm->lock, irq_state );
    125126
    126127        return (char*)current + sizeof(khm_block_t);
Note: See TracChangeset for help on using the changeset viewer.