Changeset 551
- Timestamp:
- Sep 21, 2018, 10:24:34 PM (6 years ago)
- Location:
- trunk/kernel
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/scheduler.c
r500 r551 78 78 79 79 // take lock protecting sheduler lists 80 spinlock_lock( &sched->lock ); 80 uint32_t irq_state; 81 spinlock_lock_busy( &sched->lock, &irq_state ); 81 82 82 83 if( type == THREAD_USER ) … … 95 96 // release lock 96 97 hal_fence(); 97 spinlock_unlock ( &sched->lock);98 spinlock_unlock_busy( &sched->lock, irq_state); 98 99 99 100 } // end sched_register_thread() -
trunk/kernel/mm/kcm.c
r492 r551 288 288 289 289 // get lock 290 spinlock_lock( &kcm->lock ); 290 uint32_t irq_state; 291 spinlock_lock_busy( &kcm->lock, &irq_state ); 291 292 292 293 // get an active page … … 298 299 if( kcm_page == NULL ) 299 300 { 300 spinlock_unlock ( &kcm->lock);301 spinlock_unlock_busy( &kcm->lock, irq_state ); 301 302 return NULL; 302 303 } … … 318 319 319 320 // release lock 320 spinlock_unlock ( &kcm->lock);321 spinlock_unlock_busy( &kcm->lock, irq_state ); 321 322 322 323 return ptr; -
trunk/kernel/mm/khm.c
r492 r551 78 78 79 79 // get lock protecting heap 80 spinlock_lock( &khm->lock ); 80 uint32_t irq_state; 81 spinlock_lock_busy( &khm->lock, &irq_state ); 81 82 82 83 // define a starting block to scan existing blocks … … 92 93 if( (intptr_t)current >= (khm->base + khm->size) ) // heap full 93 94 { 94 spinlock_unlock (&khm->lock);95 spinlock_unlock_busy(&khm->lock, irq_state ); 95 96 96 97 printk("\n[ERROR] in %s : failed to allocate block of size %d\n", … … 122 123 123 124 // release lock protecting heap 124 spinlock_unlock ( &khm->lock);125 spinlock_unlock_busy( &khm->lock, irq_state ); 125 126 126 127 return (char*)current + sizeof(khm_block_t); -
trunk/kernel/mm/kmem.c
r492 r551 192 192 uint32_t size; // ln( pages ) if PPM / bytes if KHM / unused if KCM 193 193 void * ptr; // memory buffer if KHM or KCM / page descriptor if PPM 194 uint32_t irq_state; 194 195 195 196 … … 257 258 if( cluster->kcm_tbl[type] == NULL ) 258 259 { 259 spinlock_lock ( &cluster->kcm_lock);260 spinlock_lock_busy( &cluster->kcm_lock, &irq_state ); 260 261 error_t error = kmem_create_kcm( type ); 261 spinlock_unlock ( &cluster->kcm_lock);262 spinlock_unlock_busy( &cluster->kcm_lock, irq_state ); 262 263 if ( error ) return NULL; 263 264 } -
trunk/kernel/mm/ppm.c
r492 r551 200 200 page_t * remaining_block; 201 201 uint32_t current_size; 202 202 203 203 #if DEBUG_PPM_ALLOC_PAGES 204 204 uint32_t cycle = (uint32_t)hal_get_cycles(); … … 221 221 222 222 // take lock protecting free lists 223 spinlock_lock( &ppm->free_lock ); 223 uint32_t irq_state; 224 spinlock_lock_busy( &ppm->free_lock, &irq_state ); 224 225 225 226 // find a free block equal or larger to requested size … … 237 238 { 238 239 // release lock protecting free lists 239 spinlock_unlock ( &ppm->free_lock);240 spinlock_unlock_busy( &ppm->free_lock, irq_state ); 240 241 241 242 #if DEBUG_PPM_ALLOC_PAGES … … 273 274 274 275 // release lock protecting free lists 275 spinlock_unlock ( &ppm->free_lock);276 spinlock_unlock_busy( &ppm->free_lock, irq_state ); 276 277 277 278 #if DEBUG_PPM_ALLOC_PAGES
Note: See TracChangeset
for help on using the changeset viewer.