Changeset 407 for trunk/kernel/kern/cluster.c
- Timestamp:
- Nov 7, 2017, 3:08:12 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/cluster.c
r406 r407 29 29 #include <hal_special.h> 30 30 #include <hal_ppm.h> 31 #include <remote_fifo.h> 31 32 #include <printk.h> 32 33 #include <errno.h> … … 77 78 // initialize cluster local parameters 78 79 cluster->cores_nr = info->cores_nr; 79 cluster->cores_in_kernel = 0;80 80 81 81 // initialize the lock protecting the embedded kcm allocator 82 82 spinlock_init( &cluster->kcm_lock ); 83 83 84 cluster_dmsg("\n[DMSG] %s for cluster %x enters\n",85 84 cluster_dmsg("\n[DBG] %s for cluster %x enters\n", 85 __FUNCTION__ , local_cxy ); 86 86 87 87 // initialises DQDT … … 102 102 } 103 103 104 cluster_dmsg("\n[DMSG] %s : PPM initialized in cluster %x at cycle %d\n",105 104 cluster_dmsg("\n[DBG] %s : PPM initialized in cluster %x at cycle %d\n", 105 __FUNCTION__ , local_cxy , hal_get_cycles() ); 106 106 107 107 // initialises embedded KHM 108 108 khm_init( &cluster->khm ); 109 109 110 cluster_dmsg("\n[D MSG] %s : KHM initialized in cluster %x at cycle %d\n",110 cluster_dmsg("\n[DBG] %s : KHM initialized in cluster %x at cycle %d\n", 111 111 __FUNCTION__ , local_cxy , hal_get_cycles() ); 112 112 … … 114 114 kcm_init( &cluster->kcm , KMEM_KCM ); 115 115 116 cluster_dmsg("\n[D MSG] %s : KCM initialized in cluster %x at cycle %d\n",116 cluster_dmsg("\n[DBG] %s : KCM initialized in cluster %x at cycle %d\n", 117 117 __FUNCTION__ , local_cxy , hal_get_cycles() ); 118 118 … … 125 125 } 126 126 127 cluster_dmsg("\n[DMSG] %s : cores initialized in cluster %x at cycle %d\n",128 127 cluster_dmsg("\n[DBG] %s : cores initialized in cluster %x at cycle %d\n", 128 __FUNCTION__ , local_cxy , hal_get_cycles() ); 129 129 130 130 // initialises RPC fifo 131 rpc_fifo_init( &cluster->rpc_fifo );131 local_fifo_init( &cluster->rpc_fifo ); 132 132 cluster->rpc_threads = 0; 133 133 134 cluster_dmsg("\n[DMSG] %s : RPC fifo inialized in cluster %x at cycle %d\n",135 134 cluster_dmsg("\n[DBG] %s : RPC fifo inialized in cluster %x at cycle %d\n", 135 __FUNCTION__ , local_cxy , hal_get_cycles() ); 136 136 137 137 // initialise pref_tbl[] in process manager … … 157 157 } 158 158 159 cluster_dmsg("\n[DMSG] %s Process Manager initialized in cluster %x at cycle %d\n",160 159 cluster_dmsg("\n[DBG] %s Process Manager initialized in cluster %x at cycle %d\n", 160 __FUNCTION__ , local_cxy , hal_get_cycles() ); 161 161 162 162 hal_fence(); … … 184 184 // Cores related functions 185 185 //////////////////////////////////////////////////////////////////////////////////// 186 187 ////////////////////////////////188 void cluster_core_kernel_enter()189 {190 cluster_t * cluster = LOCAL_CLUSTER;191 hal_atomic_add( &cluster->cores_in_kernel , 1 );192 }193 194 ///////////////////////////////195 void cluster_core_kernel_exit()196 {197 cluster_t * cluster = LOCAL_CLUSTER;198 hal_atomic_add( &cluster->cores_in_kernel , -1 );199 }200 186 201 187 ///////////////////////////////// … … 353 339 void cluster_process_local_link( process_t * process ) 354 340 { 341 uint32_t irq_state; 355 342 pmgr_t * pm = &LOCAL_CLUSTER->pmgr; 356 343 357 344 // get lock protecting the process manager local list 358 remote_spinlock_lock ( XPTR( local_cxy , &pm->local_lock ));345 remote_spinlock_lock_busy( XPTR( local_cxy , &pm->local_lock ) , & irq_state ); 359 346 360 347 xlist_add_first( XPTR( local_cxy , &pm->local_root ), … … 363 350 364 351 // release lock protecting the process manager local list 365 remote_spinlock_unlock ( XPTR( local_cxy , &pm->local_lock ));352 remote_spinlock_unlock_busy( XPTR( local_cxy , &pm->local_lock ) , irq_state ); 366 353 } 367 354 … … 369 356 void cluster_process_local_unlink( process_t * process ) 370 357 { 358 uint32_t irq_state; 371 359 pmgr_t * pm = &LOCAL_CLUSTER->pmgr; 372 360 373 361 // get lock protecting the process manager local list 374 remote_spinlock_lock ( XPTR( local_cxy , &pm->local_lock ));362 remote_spinlock_lock_busy( XPTR( local_cxy , &pm->local_lock ) , &irq_state ); 375 363 376 364 xlist_unlink( XPTR( local_cxy , &process->local_list ) ); … … 378 366 379 367 // release lock protecting the process manager local list 380 remote_spinlock_unlock ( XPTR( local_cxy , &pm->local_lock ));368 remote_spinlock_unlock_busy( XPTR( local_cxy , &pm->local_lock ) , irq_state ); 381 369 } 382 370 … … 384 372 void cluster_process_copies_link( process_t * process ) 385 373 { 374 uint32_t irq_state; 386 375 pmgr_t * pm = &LOCAL_CLUSTER->pmgr; 387 376 … … 401 390 402 391 // get lock protecting copies_list[lpid] 403 remote_spinlock_lock ( copies_lock);392 remote_spinlock_lock_busy( copies_lock , &irq_state ); 404 393 405 394 xlist_add_first( copies_root , copies_entry ); … … 407 396 408 397 // release lock protecting copies_list[lpid] 409 remote_spinlock_unlock ( copies_lock);398 remote_spinlock_unlock_busy( copies_lock , irq_state ); 410 399 } 411 400 … … 413 402 void cluster_process_copies_unlink( process_t * process ) 414 403 { 404 uint32_t irq_state; 415 405 pmgr_t * pm = &LOCAL_CLUSTER->pmgr; 416 406 … … 427 417 428 418 // get lock protecting copies_list[lpid] 429 remote_spinlock_lock ( copies_lock);419 remote_spinlock_lock_busy( copies_lock , &irq_state ); 430 420 431 421 xlist_unlink( copies_entry ); … … 433 423 434 424 // release lock protecting copies_list[lpid] 435 remote_spinlock_unlock ( copies_lock);425 remote_spinlock_unlock_busy( copies_lock , irq_state ); 436 426 } 437 427
Note: See TracChangeset
for help on using the changeset viewer.