Changeset 469 for trunk/kernel/kern
- Timestamp:
- Aug 20, 2018, 1:04:16 PM (6 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/printk.c
r459 r469 407 407 408 408 // call nolock_printk to print core, function_name, and cycle 409 nolock_printk("\n[PANIC] on core[%x,%d] in %sat cycle %d : " ,410 local_cxy, CURRENT_THREAD->core->lid, function_name, (uint32_t)hal_get_cycles() );409 nolock_printk("\n[PANIC] in %s => core[%x,%d] blocked at cycle %d : " , 410 function_name, local_cxy, CURRENT_THREAD->core->lid, (uint32_t)hal_get_cycles() ); 411 411 412 412 // call kernel_printf on TXT0, in busy waiting to print format -
trunk/kernel/kern/process.c
r459 r469 1163 1163 } 1164 1164 1165 #if DEBUG_PROCESS_MAKE_FORK1165 #if( DEBUG_PROCESS_MAKE_FORK & 1 ) 1166 1166 cycle = (uint32_t)hal_get_cycles(); 1167 1167 if( DEBUG_PROCESS_MAKE_FORK < cycle ) … … 1240 1240 "main thread must have LTID == 0\n" ); 1241 1241 1242 #if( DEBUG_PROCESS_MAKE_FORK & 1 ) 1242 //#if( DEBUG_PROCESS_MAKE_FORK & 1 ) 1243 #if DEBUG_PROCESS_MAKE_FORK 1243 1244 cycle = (uint32_t)hal_get_cycles(); 1244 1245 if( DEBUG_PROCESS_MAKE_FORK < cycle ) 1245 printk("\n[DBG] %s : thread %x in process %x created main thread %x on core[%x,%d] / cycle %d\n", 1246 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, 1247 thread, local_cxy, thread->core->lid, cycle ); 1246 printk("\n[DBG] %s : thread %x in process %x created main thread %x / cycle %d\n", 1247 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, thread, cycle ); 1248 1248 #endif 1249 1249 … … 1342 1342 1343 1343 #if (DEBUG_PROCESS_MAKE_EXEC & 1) 1344 cycle = (uint32_t)hal_get_cycles(); 1344 1345 if( DEBUG_PROCESS_MAKE_EXEC < cycle ) 1345 printk("\n[DBG] %s : open file <%s>\n", __FUNCTION__, path ); 1346 printk("\n[DBG] %s : thread %x in process %x opened file <%s> / cycle %d\n", 1347 __FUNCTION__, thread->trdid, pid, path, cycle ); 1346 1348 #endif 1347 1349 … … 1349 1351 process_sigaction( pid , DELETE_ALL_THREADS ); 1350 1352 1353 #if (DEBUG_PROCESS_MAKE_EXEC & 1) 1354 cycle = (uint32_t)hal_get_cycles(); 1355 if( DEBUG_PROCESS_MAKE_EXEC < cycle ) 1356 printk("\n[DBG] %s : thread %x in process %x deleted all threads / cycle %d\n", 1357 __FUNCTION__, thread->trdid, pid, cycle ); 1358 #endif 1359 1351 1360 // reset local process VMM 1352 1361 vmm_destroy( process ); … … 1355 1364 cycle = (uint32_t)hal_get_cycles(); 1356 1365 if( DEBUG_PROCESS_MAKE_EXEC < cycle ) 1357 printk("\n[DBG] %s : thread %x in process %x /reset VMM / cycle %d\n",1366 printk("\n[DBG] %s : thread %x in process %x reset VMM / cycle %d\n", 1358 1367 __FUNCTION__, thread->trdid, pid, cycle ); 1359 1368 #endif … … 1400 1409 if( error ) 1401 1410 { 1402 printk("\n[ERROR] in %s : cannot resetmain thread for %s\n", __FUNCTION__ , path );1411 printk("\n[ERROR] in %s : cannot update main thread for %s\n", __FUNCTION__ , path ); 1403 1412 vfs_close( file_xp , file_id ); 1404 1413 // FIXME restore old process VMM -
trunk/kernel/kern/scheduler.c
r462 r469 63 63 list_root_init( &sched->k_root ); 64 64 65 // init spinlock 66 spinlock_init( &sched->lock ); 67 65 68 sched->req_ack_pending = false; // no pending request 66 69 sched->trace = false; // context switches trace desactivated -
trunk/kernel/kern/thread.c
r457 r469 86 86 // return pointer on new thread descriptor 87 87 xptr_t base_xp = ppm_page2base( XPTR(local_cxy , page ) ); 88 return (thread_t *)GET_PTR( base_xp );88 return GET_PTR( base_xp ); 89 89 90 90 } // end thread_alloc() … … 419 419 uint32_t cycle = (uint32_t)hal_get_cycles(); 420 420 if( DEBUG_THREAD_USER_FORK < cycle ) 421 printk("\n[DBG] %s : thread %x enter / child_process %x / cycle %d\n",422 __FUNCTION__, CURRENT_THREAD , child_process->pid, cycle );421 printk("\n[DBG] %s : thread %x in process %x enter / child_process %x / cycle %d\n", 422 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, child_process->pid, cycle ); 423 423 #endif 424 424 … … 428 428 // get cluster and local pointer on parent thread descriptor 429 429 parent_cxy = GET_CXY( parent_thread_xp ); 430 parent_ptr = (thread_t *)GET_PTR( parent_thread_xp );430 parent_ptr = GET_PTR( parent_thread_xp ); 431 431 432 432 // get relevant fields from parent thread … … 538 538 if( mapped ) 539 539 { 540 // get pointers on the page descriptor 540 541 xptr_t page_xp = ppm_ppn2page( ppn ); 541 542 cxy_t page_cxy = GET_CXY( page_xp ); 542 page_t * page_ptr = (page_t *)GET_PTR( page_xp ); 543 page_t * page_ptr = GET_PTR( page_xp ); 544 545 // get extended pointers on forks and lock fields 546 xptr_t forks_xp = XPTR( page_cxy , &page_ptr->forks ); 547 xptr_t lock_xp = XPTR( page_cxy , &page_ptr->lock ); 548 549 // increment the forks counter 550 remote_spinlock_lock( lock_xp ); 543 551 hal_remote_atomic_add( XPTR( page_cxy , &page_ptr->forks ) , 1 ); 552 remote_spinlock_unlock( lock_xp ); 544 553 545 554 #if (DEBUG_THREAD_USER_FORK & 1) 546 555 cycle = (uint32_t)hal_get_cycles(); 547 556 if( DEBUG_THREAD_USER_FORK < cycle ) 548 printk("\n[DBG] %s : thread %x copied stack PTE to child GPT : vpn %x\n", 549 __FUNCTION__, CURRENT_THREAD, vpn ); 557 printk("\n[DBG] %s : thread %x in process %x copied one PTE to child GPT : vpn %x / forks %d\n", 558 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, vpn, 559 hal_remote_lw( XPTR( page_cxy , &page_ptr->forks) ) ); 550 560 #endif 551 561 … … 561 571 cycle = (uint32_t)hal_get_cycles(); 562 572 if( DEBUG_THREAD_USER_FORK < cycle ) 563 printk("\n[DBG] %s : thread %x exit / child_process %x/ child_thread %x / cycle %d\n",564 __FUNCTION__, CURRENT_THREAD , child_process->pid, child_ptr, cycle );573 printk("\n[DBG] %s : thread %x in process %x exit / child_thread %x / cycle %d\n", 574 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, child_ptr, cycle ); 565 575 #endif 566 576 … … 631 641 } 632 642 633 // update user stack in stackdescriptor643 // update user stack in thread descriptor 634 644 thread->u_stack_base = vseg->min; 635 645 thread->u_stack_size = vseg->max - vseg->min; … … 1172 1182 { 1173 1183 target_process_xp = XLIST_ELEMENT( iter , process_t , local_list ); 1174 target_process_ptr = (process_t *)GET_PTR( target_process_xp );1184 target_process_ptr = GET_PTR( target_process_xp ); 1175 1185 target_process_pid = hal_remote_lw( XPTR( target_cxy , &target_process_ptr->pid ) ); 1176 1186 if( target_process_pid == pid )
Note: See TracChangeset
for help on using the changeset viewer.