Changeset 567 for trunk/kernel/mm/kcm.c
- Timestamp:
- Oct 5, 2018, 12:01:52 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/kcm.c
r551 r567 1 1 /* 2 * kcm.c - Per cluster & per type Kernel Cache Manager access functions2 * kcm.c - Per cluster Kernel Cache Manager implementation. 3 3 * 4 4 * Author Ghassan Almaless (2008,2009,2010,2011,2012) … … 26 26 #include <hal_kernel_types.h> 27 27 #include <hal_special.h> 28 #include <busylock.h> 28 29 #include <list.h> 29 30 #include <printk.h> … … 36 37 #include <kcm.h> 37 38 39 38 40 ////////////////////////////////////////////////////////////////////////////////////// 39 41 // This static function returns pointer on an allocated block from an active page. … … 219 221 220 222 // initialize lock 221 spinlock_init( &kcm->lock);223 busylock_init( &kcm->lock , LOCK_KCM_STATE ); 222 224 223 225 // initialize KCM type … … 248 250 249 251 // get KCM lock 250 spinlock_lock( &kcm->lock );252 busylock_acquire( &kcm->lock ); 251 253 252 254 // release all free pages … … 278 280 279 281 // release KCM lock 280 spinlock_unlock( &kcm->lock );282 busylock_release( &kcm->lock ); 281 283 } 282 284 … … 288 290 289 291 // get lock 290 uint32_t irq_state; 291 spinlock_lock_busy( &kcm->lock, &irq_state ); 292 busylock_acquire( &kcm->lock ); 292 293 293 294 // get an active page … … 299 300 if( kcm_page == NULL ) 300 301 { 301 spinlock_unlock_busy( &kcm->lock, irq_state);302 busylock_release( &kcm->lock ); 302 303 return NULL; 303 304 } … … 319 320 320 321 // release lock 321 spinlock_unlock_busy( &kcm->lock, irq_state);322 busylock_release( &kcm->lock ); 322 323 323 324 return ptr; … … 336 337 337 338 // get lock 338 spinlock_lock( &kcm->lock );339 busylock_acquire( &kcm->lock ); 339 340 340 341 // release block … … 342 343 343 344 // release lock 344 spinlock_unlock( &kcm->lock );345 busylock_release( &kcm->lock ); 345 346 } 346 347
Note: See TracChangeset
for help on using the changeset viewer.