Changeset 567 for trunk/kernel/mm/kmem.c
- Timestamp:
- Oct 5, 2018, 12:01:52 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/kmem.c
r551 r567 3 3 * 4 4 * Authors Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Mohamed Lamine Karaoui (2015) 6 * Alain Greiner (2016) 5 * Alain Greiner (2016,2017,2018) 7 6 * 8 7 * Copyright (c) UPMC Sorbonne Universites … … 28 27 #include <hal_special.h> 29 28 #include <printk.h> 30 #include <spinlock.h> 31 #include <readlock.h> 29 #include <busylock.h> 32 30 #include <memcpy.h> 33 31 #include <khm.h> … … 51 49 #include <kmem.h> 52 50 53 /////////////////////////// 51 ///////////////////////////////// 54 52 void kmem_print_kcm_table( void ) 55 53 { … … 168 166 kcm_init( kcm , type ); 169 167 170 // register it i fthe KCM pointers Table168 // register it in the KCM pointers Table 171 169 cluster->kcm_tbl[type] = kcm; 172 170 … … 258 256 if( cluster->kcm_tbl[type] == NULL ) 259 257 { 260 spinlock_lock_busy( &cluster->kcm_lock, &irq_state ); 258 // get lock protecting local kcm_tbl[] array 259 busylock_acquire( &cluster->kcm_lock ); 260 261 // create missing KCM 261 262 error_t error = kmem_create_kcm( type ); 262 spinlock_unlock_busy( &cluster->kcm_lock, irq_state ); 263 if ( error ) return NULL; 263 264 // release lock protecting local kcm_tbl[] array 265 busylock_release( &cluster->kcm_lock ); 266 267 if ( error ) 268 { 269 printk("\n[ERROR] in %s : cannot create KCM type %d in cluster %x\n", 270 __FUNCTION__, type, local_cxy ); 271 return NULL; 272 } 264 273 } 265 274 … … 269 278 { 270 279 printk("\n[ERROR] in %s : failed for type %d / size %d in cluster %x\n", 271 280 __FUNCTION__ , type , size , local_cxy ); 272 281 return NULL; 273 282 }
Note: See TracChangeset
for help on using the changeset viewer.