Changeset 415 for trunk/kernel/kern
- Timestamp:
- Dec 22, 2017, 1:16:59 PM (7 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/printk.h
r409 r415 331 331 #endif 332 332 333 #if CONFIG_SIG NAL_DEBUG334 #define sig nal_dmsg(...) if(hal_time_stamp() > CONFIG_SIGNAL_DEBUG) printk(__VA_ARGS__)335 #else 336 #define sig nal_dmsg(...)333 #if CONFIG_SIGACTION_DEBUG 334 #define sigaction_dmsg(...) if(hal_time_stamp() > CONFIG_SIGACTION_DEBUG) printk(__VA_ARGS__) 335 #else 336 #define sigaction_dmsg(...) 337 337 #endif 338 338 -
trunk/kernel/kern/process.c
r409 r415 125 125 uint32_t stdout_id; 126 126 uint32_t stderr_id; 127 error_t error; 127 128 128 129 process_dmsg("\n[DBG] %s : core[%x,%d] enters for process %x / ppid = %x\n", … … 139 140 140 141 // initialize vmm as empty 141 vmm_init( process ); 142 error = vmm_init( process ); 143 assert( (error == 0) , __FUNCTION__ , "cannot initialize VMM\n" ); 144 142 145 143 146 process_dmsg("\n[DBG] %s : core[%x,%d] / vmm empty for process %x\n", … … 259 262 xptr_t reference_process_xp ) 260 263 { 264 error_t error; 265 261 266 // get reference process cluster and local pointer 262 267 cxy_t ref_cxy = GET_CXY( reference_process_xp ); … … 272 277 273 278 // reset local process vmm 274 vmm_init( local_process ); 279 error = vmm_init( local_process ); 280 assert( (error == 0) , __FUNCTION__ , "cannot initialize VMM\n"); 275 281 276 282 // reset process file descriptors array … … 309 315 // register new process descriptor in owner cluster manager copies_list 310 316 cluster_process_copies_link( local_process ); 311 312 // initialize signal manager TODO [AG]313 317 314 318 hal_fence(); … … 397 401 process_t * process_ptr; // local pointer on process copy 398 402 399 sig nal_dmsg("\n[DBG] %s : enter for signal %s to process %x in cluster %x\n",403 sigaction_dmsg("\n[DBG] %s : enter for signal %s to process %x in cluster %x\n", 400 404 __FUNCTION__ , process_action_str( action_type ) , process , local_cxy ); 401 405 … … 432 436 process_ptr = (process_t *)GET_PTR( process_xp ); 433 437 434 printk("\n @@@%s : process = %x / pid = %x / ppid = %x\n",438 sigaction_dmsg("\n[DBG] %s : process = %x / pid = %x / ppid = %x\n", 435 439 __FUNCTION__ , process_ptr , process_ptr->pid , process_ptr->ppid ); 436 440 … … 449 453 sched_yield("BLOCKED on RPC"); 450 454 451 sig nal_dmsg("\n[DBG] %s : exit for signal %s to process %x in cluster %x\n",455 sigaction_dmsg("\n[DBG] %s : exit for signal %s to process %x in cluster %x\n", 452 456 __FUNCTION__ , process_action_str( action_type ) , process , local_cxy ); 453 457 … … 471 475 killer = CURRENT_THREAD; 472 476 473 sig nal_dmsg("\n[DBG] %s : enter for process %x in cluster %x\n",477 sigaction_dmsg("\n[DBG] %s : enter for process %x in cluster %x\n", 474 478 __FUNCTION__ , process->pid , local_cxy ); 475 479 … … 532 536 } 533 537 534 sig nal_dmsg("\n[DBG] %s : exit for process %x in cluster %x / %d threads blocked\n",538 sigaction_dmsg("\n[DBG] %s : exit for process %x in cluster %x / %d threads blocked\n", 535 539 __FUNCTION__ , process->pid , local_cxy , count ); 536 540 … … 553 557 killer = CURRENT_THREAD; 554 558 555 sig nal_dmsg("\n[DBG] %s : enter for process %x in cluster %x\n",559 sigaction_dmsg("\n[DBG] %s : enter for process %x in cluster %x\n", 556 560 __FUNCTION__ , process->pid , local_cxy ); 557 561 … … 586 590 } 587 591 588 sig nal_dmsg("\n[DBG] %s : exit for process %x in cluster %x / %d threads blocked\n",592 sigaction_dmsg("\n[DBG] %s : exit for process %x in cluster %x / %d threads blocked\n", 589 593 __FUNCTION__ , process->pid , local_cxy , req_count ); 590 594 … … 607 611 pid = process->pid; 608 612 609 sig nal_dmsg("\n[DBG] %s : enter for process %x in cluster %x at cycle %d\n",613 sigaction_dmsg("\n[DBG] %s : enter for process %x in cluster %x at cycle %d\n", 610 614 __FUNCTION__ , pid , local_cxy , (uint32_t)hal_get_cycles() ); 611 615 … … 648 652 } 649 653 650 sig nal_dmsg("\n[DBG] %s : exit for process %x in cluster %x at cycle %d\n",654 sigaction_dmsg("\n[DBG] %s : exit for process %x in cluster %x at cycle %d\n", 651 655 __FUNCTION__ , pid , local_cxy , (uint32_t)hal_get_cycles() ); 652 656 … … 1181 1185 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid ); 1182 1186 1183 // re-initialize VMM 1184 vmm_init( process ); 1187 // initialize VMM 1188 error = vmm_init( process ); 1189 { 1190 printk("\n[ERROR] in %s : cannot initialize VMM for process %x / path = %s\n", 1191 __FUNCTION__, pid , path ); 1192 process_destroy( process ); 1193 return -1; 1194 } 1195 1196 if( error ) 1185 1197 1186 1198 // register "code" and "data" vsegs as well as entry-point and vfs_bin_xp 1187 1199 // in VMM, using information contained in the elf file. 1188 if( elf_load_process( path , process ) ) 1200 error = elf_load_process( path , process ); 1201 1202 if( error ) 1189 1203 { 1190 1204 printk("\n[ERROR] in %s : failed to access .elf file for process %x / path = %s\n", -
trunk/kernel/kern/process.h
r409 r415 59 59 enum process_sigactions 60 60 { 61 BLOCK_ALL_THREADS ,62 UNBLOCK_ALL_THREADS ,63 DELETE_ALL_THREADS ,61 BLOCK_ALL_THREADS = 11, 62 UNBLOCK_ALL_THREADS = 22, 63 DELETE_ALL_THREADS = 33, 64 64 }; 65 65 -
trunk/kernel/kern/rpc.c
r409 r415 106 106 rpc->lid = core->lid; 107 107 108 printk("\n @@@ enter %s : rpc_desc_cxy = %x / rpc_desc_ptr = %x / index = %d / &index = %x\n", 109 __FUNCTION__ , local_cxy , rpc , rpc->index , &rpc->index); 110 108 111 // build an extended pointer on the RPC descriptor 109 112 xptr_t desc_xp = XPTR( local_cxy , rpc ); … … 176 179 } 177 180 181 printk("\n @@@ exit %s : rpc_desc_cxy = %x / rpc_desc_ptr = %x / index = %d / &index = %x\n", 182 __FUNCTION__ , local_cxy , rpc , rpc->index , &rpc->index); 183 178 184 } // end rpc_send() 179 185 … … 245 251 } 246 252 253 //@@@ 254 sched_display( 0 ); 255 //@@@ 256 247 257 grpc_dmsg("\n[DBG] %s : core[%x,%d] / interrupted thread %s deschedules / cycle %d\n", 248 258 __FUNCTION__, local_cxy, core->lid, thread_type_str(this->type), hal_time_stamp() ); … … 300 310 while( 1 ) // internal loop 301 311 { 312 302 313 empty = local_fifo_get_item( rpc_fifo , (uint64_t *)&desc_xp ); 303 314 … … 311 322 index = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->index ) ); 312 323 324 printk("\n @@@ in %s : rpc_desc_cxy = %x / rpc_desc_ptr = %x / index = %d / &index = %x\n", 325 __FUNCTION__ , desc_cxy , desc_ptr , index , &desc_ptr->index ); 326 313 327 grpc_dmsg("\n[DBG] %s : core[%x,%d] / RPC thread %x / starts rpc %d / cycle %d\n", 314 __FUNCTION__ , local_cxy , this->core->lid , this->trdid , index , hal_time_stamp() );328 __FUNCTION__ , local_cxy , this->core->lid , this->trdid , index , (uint32_t)hal_get_cycles() ); 315 329 316 330 // call the relevant server function … … 980 994 981 995 ///////////////////////////////////////////////////////////////////////////////////////// 982 // [9] Marshaling functions attached to RPC_PROCESS_KILL(multicast / non blocking)996 // [9] Marshaling functions attached to RPC_PROCESS_SIGACTION (multicast / non blocking) 983 997 ///////////////////////////////////////////////////////////////////////////////////////// 984 998 … … 990 1004 xptr_t client_xp ) // in 991 1005 { 992 sig nal_dmsg("\n[DBG] %s : enter for %s/ thread %x on core[%x,%d] / cycle %d\n",993 __FUNCTION__ , process_action_str( sigaction ) , CURRENT_THREAD ,1006 sigaction_dmsg("\n[DBG] %s : enter for %s (%d) / thread %x on core[%x,%d] / cycle %d\n", 1007 __FUNCTION__ , process_action_str( sigaction ) , sigaction , CURRENT_THREAD , 994 1008 local_cxy , CURRENT_THREAD->core->lid , hal_time_stamp() ); 995 1009 … … 1007 1021 rpc_send( cxy , &rpc , false ); 1008 1022 1009 sig nal_dmsg("\n[DBG] %s : exit for %s/ thread %x on core[%x,%d] / cycle %d\n",1010 __FUNCTION__ , process_action_str( sigaction ) , CURRENT_THREAD ,1023 sigaction_dmsg("\n[DBG] %s : exit for %s (%d) / thread %x on core[%x,%d] / cycle %d\n", 1024 __FUNCTION__ , process_action_str( sigaction ) , sigaction , CURRENT_THREAD , 1011 1025 local_cxy , CURRENT_THREAD->core->lid , hal_time_stamp() ); 1012 1026 } … … 1030 1044 client_xp = (xptr_t) hal_remote_lwd( XPTR( client_cxy , &desc->args[3] ) ); 1031 1045 1032 sig nal_dmsg("\n[DBG] %s : enter for %s/ thread %x on core[%x,%d] / cycle %d\n",1033 __FUNCTION__ , process_action_str( action ) , CURRENT_THREAD ,1046 sigaction_dmsg("\n[DBG] %s : enter for %s (%d) / thread %x on core[%x,%d] / cycle %d\n", 1047 __FUNCTION__ , process_action_str( action ) , action , CURRENT_THREAD , 1034 1048 local_cxy , CURRENT_THREAD->core->lid , hal_time_stamp() ); 1035 1049 … … 1039 1053 else if (action == UNBLOCK_ALL_THREADS ) process_unblock( process , rsp_xp , client_xp ); 1040 1054 1041 sig nal_dmsg("\n[DBG] %s : exit for %s/ thread %x on core[%x,%d] / cycle %d\n",1042 __FUNCTION__ , process_action_str( action ) , CURRENT_THREAD ,1055 sigaction_dmsg("\n[DBG] %s : exit for %s (%d) / thread %x on core[%x,%d] / cycle %d\n", 1056 __FUNCTION__ , process_action_str( action ) , action , CURRENT_THREAD , 1043 1057 local_cxy , CURRENT_THREAD->core->lid , hal_time_stamp() ); 1044 1058 }
Note: See TracChangeset
for help on using the changeset viewer.