Changeset 610 for trunk/kernel/kern/process.c
- Timestamp:
- Dec 27, 2018, 7:38:58 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/process.c
r593 r610 95 95 xptr_t parent_xp ) 96 96 { 97 xptr_t process_xp; 97 98 cxy_t parent_cxy; 98 99 process_t * parent_ptr; … … 113 114 pid_t parent_pid; 114 115 116 // build extended pointer on this reference process 117 process_xp = XPTR( local_cxy , process ); 118 115 119 // get parent process cluster and local pointer 116 120 parent_cxy = GET_CXY( parent_xp ); … … 121 125 122 126 #if DEBUG_PROCESS_REFERENCE_INIT 127 thread_t * this = CURRENT_THREAD; 123 128 uint32_t cycle = (uint32_t)hal_get_cycles(); 124 if( DEBUG_PROCESS_REFERENCE_INIT )125 printk("\n[%s] thread %x in process %xenter to initalialize process %x / cycle %d\n",126 __FUNCTION__, CURRENT_THREAD->trdid, parent_pid , pid, cycle );127 #endif 128 129 // initialize PID, REF_XP, PARENT_XP, and STATE129 if( DEBUG_PROCESS_REFERENCE_INIT < cycle ) 130 printk("\n[%s] thread[%x,%x] enter to initalialize process %x / cycle %d\n", 131 __FUNCTION__, parent_pid, this->trdid, pid, cycle ); 132 #endif 133 134 // initialize pid, ref_xp, parent_xp, owner_xp, term_state fields 130 135 process->pid = pid; 131 136 process->ref_xp = XPTR( local_cxy , process ); … … 134 139 process->term_state = 0; 135 140 141 // initialize VFS root inode and CWD inode 142 process->vfs_root_xp = hal_remote_l64( XPTR( parent_cxy, &parent_ptr->vfs_root_xp ) ); 143 process->cwd_xp = hal_remote_l64( XPTR( parent_cxy, &parent_ptr->cwd_xp ) ); 144 136 145 // initialize vmm as empty 137 146 error = vmm_init( process ); … … 141 150 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) 142 151 cycle = (uint32_t)hal_get_cycles(); 143 if( DEBUG_PROCESS_REFERENCE_INIT )144 printk("\n[%s] thread %x in process %x/ vmm empty for process %x / cycle %d\n",145 __FUNCTION__, CURRENT_THREAD->trdid, parent_pid, pid, cycle );152 if( DEBUG_PROCESS_REFERENCE_INIT < cycle ) 153 printk("\n[%s] thread[%x,%x] / vmm empty for process %x / cycle %d\n", 154 __FUNCTION__, parent_pid, this->trdid, pid, cycle ); 146 155 #endif 147 156 … … 161 170 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) 162 171 cycle = (uint32_t)hal_get_cycles(); 163 if( DEBUG_PROCESS_REFERENCE_INIT )164 printk("\n[%s] thread %x in process %x/ process %x attached to TXT%d / cycle %d\n",165 __FUNCTION__, CURRENT_THREAD->trdid, parent_pid, pid, txt_id, cycle );172 if( DEBUG_PROCESS_REFERENCE_INIT < cycle ) 173 printk("\n[%s] thread[%x,%x] / process %x attached to TXT%d / cycle %d\n", 174 __FUNCTION__, parent_pid, this->trdid, pid, txt_id, cycle ); 166 175 #endif 167 176 // build path to TXT_RX[i] and TXT_TX[i] chdevs … … 170 179 171 180 // create stdin pseudo file 172 error = vfs_open( process,181 error = vfs_open( process->vfs_root_xp, 173 182 rx_path, 183 process_xp, 174 184 O_RDONLY, 175 185 0, // FIXME chmod … … 182 192 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) 183 193 cycle = (uint32_t)hal_get_cycles(); 184 if( DEBUG_PROCESS_REFERENCE_INIT )185 printk("\n[%s] thread %x in process %x/ stdin open for process %x / cycle %d\n",186 __FUNCTION__, CURRENT_THREAD->trdid, parent_pid, pid, cycle );194 if( DEBUG_PROCESS_REFERENCE_INIT < cycle ) 195 printk("\n[%s] thread[%x,%x] / stdin open for process %x / cycle %d\n", 196 __FUNCTION__, parent_pid, this->trdid, pid, cycle ); 187 197 #endif 188 198 189 199 // create stdout pseudo file 190 error = vfs_open( process,200 error = vfs_open( process->vfs_root_xp, 191 201 tx_path, 202 process_xp, 192 203 O_WRONLY, 193 204 0, // FIXME chmod … … 200 211 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) 201 212 cycle = (uint32_t)hal_get_cycles(); 202 if( DEBUG_PROCESS_REFERENCE_INIT )203 printk("\n[%s] thread %x in process %x/ stdout open for process %x / cycle %d\n",204 __FUNCTION__, CURRENT_THREAD->trdid, parent_pid, pid, cycle );213 if( DEBUG_PROCESS_REFERENCE_INIT < cycle ) 214 printk("\n[%s] thread[%x,%x] / stdout open for process %x / cycle %d\n", 215 __FUNCTION__, parent_pid, this->trdid, pid, cycle ); 205 216 #endif 206 217 207 218 // create stderr pseudo file 208 error = vfs_open( process,219 error = vfs_open( process->vfs_root_xp, 209 220 tx_path, 221 process_xp, 210 222 O_WRONLY, 211 223 0, // FIXME chmod … … 218 230 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) 219 231 cycle = (uint32_t)hal_get_cycles(); 220 if( DEBUG_PROCESS_REFERENCE_INIT )221 printk("\n[%s] thread %x in process %x/ stderr open for process %x / cycle %d\n",222 __FUNCTION__, CURRENT_THREAD->trdid, parent_pid, pid, cycle );232 if( DEBUG_PROCESS_REFERENCE_INIT < cycle ) 233 printk("\n[%s] thread[%x,%x] / stderr open for process %x / cycle %d\n", 234 __FUNCTION__, parent_pid, this->trdid, pid, cycle ); 223 235 #endif 224 236 … … 247 259 } 248 260 249 // initialize specific inodes root and cwd 250 process->vfs_root_xp = (xptr_t)hal_remote_l64( XPTR( parent_cxy, 251 &parent_ptr->vfs_root_xp ) ); 252 process->vfs_cwd_xp = (xptr_t)hal_remote_l64( XPTR( parent_cxy, 253 &parent_ptr->vfs_cwd_xp ) ); 254 vfs_inode_remote_up( process->vfs_root_xp ); 255 vfs_inode_remote_up( process->vfs_cwd_xp ); 256 257 remote_rwlock_init( XPTR( local_cxy , &process->cwd_lock ), LOCK_PROCESS_CWD ); 261 // initialize lock protecting CWD changes 262 remote_busylock_init( XPTR( local_cxy , &process->cwd_lock ), LOCK_PROCESS_CWD ); 258 263 259 264 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) 260 265 cycle = (uint32_t)hal_get_cycles(); 261 if( DEBUG_PROCESS_REFERENCE_INIT )262 printk("\n[%s] thread %x in process %x/ set fd_array for process %x / cycle %d\n",263 __FUNCTION__, CURRENT_THREAD->trdid, parent_pid, pid , cycle );266 if( DEBUG_PROCESS_REFERENCE_INIT < cycle ) 267 printk("\n[%s] thread[%x,%x] / set fd_array for process %x / cycle %d\n", 268 __FUNCTION__, parent_pid, this->trdid, pid , cycle ); 264 269 #endif 265 270 … … 300 305 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) 301 306 cycle = (uint32_t)hal_get_cycles(); 302 if( DEBUG_PROCESS_REFERENCE_INIT )303 printk("\n[%s] thread %x in process %xexit for process %x / cycle %d\n",304 __FUNCTION__, CURRENT_THREAD->trdid, parent_pid, pid, cycle );307 if( DEBUG_PROCESS_REFERENCE_INIT < cycle ) 308 printk("\n[%s] thread[%x,%x] exit for process %x / cycle %d\n", 309 __FUNCTION__, parent_pid, this->trdid, pid, cycle ); 305 310 #endif 306 311 … … 325 330 326 331 #if DEBUG_PROCESS_COPY_INIT 327 thread_t * this = CURRE T_THREAD;332 thread_t * this = CURRENT_THREAD; 328 333 uint32_t cycle = (uint32_t)hal_get_cycles(); 329 if( DEBUG_PROCESS_COPY_INIT )330 printk("\n[%s] thread %x in process %xenter for process %x / cycle %d\n",331 __FUNCTION__, this-> trdid, this->process->pid, local_process->pid, cycle );334 if( DEBUG_PROCESS_COPY_INIT < cycle ) 335 printk("\n[%s] thread[%x,%x] enter for process %x / cycle %d\n", 336 __FUNCTION__, this->process->pid, this->trdid, local_process->pid, cycle ); 332 337 #endif 333 338 … … 342 347 process_fd_init( local_process ); 343 348 344 // reset vfs_root_xp / vfs_bin_xp / vfs_cwd_xp fields349 // reset vfs_root_xp / vfs_bin_xp / cwd_xp fields 345 350 local_process->vfs_root_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->vfs_root_xp ) ); 346 351 local_process->vfs_bin_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->vfs_bin_xp ) ); 347 local_process-> vfs_cwd_xp= XPTR_NULL;352 local_process->cwd_xp = XPTR_NULL; 348 353 349 354 // reset children list root (not used in a process descriptor copy) … … 382 387 #if DEBUG_PROCESS_COPY_INIT 383 388 cycle = (uint32_t)hal_get_cycles(); 384 if( DEBUG_PROCESS_COPY_INIT )385 printk("\n[%s] thread %x in process %xexit for process %x / cycle %d\n",386 __FUNCTION__, this-> trdid, this->process->pid, local_process->pid, cycle );389 if( DEBUG_PROCESS_COPY_INIT < cycle ) 390 printk("\n[%s] thread[%x,%x] exit for process %x / cycle %d\n", 391 __FUNCTION__, this->process->pid, this->trdid, local_process->pid, cycle ); 387 392 #endif 388 393 … … 406 411 407 412 #if DEBUG_PROCESS_DESTROY 413 thread_t * this = CURRENT_THREAD; 408 414 uint32_t cycle = (uint32_t)hal_get_cycles(); 409 if( DEBUG_PROCESS_DESTROY )410 printk("\n[%s] thread %x in process %xenter for process %x in cluster %x / cycle %d\n",411 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, pid, local_cxy, cycle );415 if( DEBUG_PROCESS_DESTROY < cycle ) 416 printk("\n[%s] thread[%x,%x] enter for process %x in cluster %x / cycle %d\n", 417 __FUNCTION__, this->process->pid, this->trdid, pid, local_cxy, cycle ); 412 418 #endif 413 419 … … 446 452 if( process->vfs_bin_xp != XPTR_NULL ) vfs_file_count_down( process->vfs_bin_xp ); 447 453 if( process->vfs_root_xp != XPTR_NULL ) vfs_file_count_down( process->vfs_root_xp ); 448 if( process-> vfs_cwd_xp != XPTR_NULL ) vfs_file_count_down( process->vfs_cwd_xp );454 if( process->cwd_xp != XPTR_NULL ) vfs_file_count_down( process->cwd_xp ); 449 455 450 456 // Destroy VMM … … 456 462 #if DEBUG_PROCESS_DESTROY 457 463 cycle = (uint32_t)hal_get_cycles(); 458 if( DEBUG_PROCESS_DESTROY )459 printk("\n[%s] thread %x in process %xexit / process %x in cluster %x / cycle %d\n",460 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, pid, local_cxy, cycle );464 if( DEBUG_PROCESS_DESTROY < cycle ) 465 printk("\n[%s] thread[%x,%x] exit / process %x in cluster %x / cycle %d\n", 466 __FUNCTION__, this->process->pid, this->trdid, pid, local_cxy, cycle ); 461 467 #endif 462 468 … … 561 567 process_ptr = GET_PTR( process_xp ); 562 568 563 // printk("\n@@@ in %s : process_cxy %x / process_ptr %x / pid %x\n",564 // __FUNCTION__, process_cxy, process_ptr, hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) ) );565 566 569 if( process_cxy == local_cxy ) // process copy is local 567 570 { … … 652 655 assert( (LPID_FROM_PID( process->pid ) != 0 ), "target process must be an user process" ); 653 656 654 // get target process cluster657 // get target process owner cluster 655 658 owner_cxy = CXY_FROM_PID( process->pid ); 656 659 … … 697 700 while( 1 ) 698 701 { 699 // exit when all scheduler ackno ledges received702 // exit when all scheduler acknowledges received 700 703 if ( ack_count == 0 ) break; 701 704 … … 927 930 uint32_t fd; 928 931 932 // initialize lock 929 933 remote_queuelock_init( XPTR( local_cxy , &process->fd_array.lock ), LOCK_PROCESS_FDARRAY ); 930 934 935 // initialize number of open files 931 936 process->fd_array.current = 0; 932 937 … … 937 942 } 938 943 } 939 ///////////////////////////////////////////////// 940 error_t process_fd_register( process_t * process,944 //////////////////////////////////////////////////// 945 error_t process_fd_register( xptr_t process_xp, 941 946 xptr_t file_xp, 942 947 uint32_t * fdid ) … … 944 949 bool_t found; 945 950 uint32_t id; 946 uint32_t count;947 951 xptr_t xp; 948 952 949 953 // get reference process cluster and local pointer 950 xptr_t ref_xp = process->ref_xp; 951 process_t * ref_ptr = GET_PTR( ref_xp ); 952 cxy_t ref_cxy = GET_CXY( ref_xp ); 954 process_t * process_ptr = GET_PTR( process_xp ); 955 cxy_t process_cxy = GET_CXY( process_xp ); 956 957 // check client process is reference process 958 assert( (process_xp == hal_remote_l64( XPTR( process_cxy , &process_ptr->ref_xp ) ) ), 959 "client process must be reference process\n" ); 960 961 #if DEBUG_PROCESS_FD_REGISTER 962 thread_t * this = CURRENT_THREAD; 963 uint32_t cycle = (uint32_t)hal_get_cycles(); 964 pid_t pid = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid) ); 965 if( DEBUG_PROCESS_FD_REGISTER < cycle ) 966 printk("\n[%s] thread[%x,%x] enter for process %x / cycle %d\n", 967 __FUNCTION__, this->process->pid, this->trdid, pid, cycle ); 968 #endif 969 970 // build extended pointer on lock protecting reference fd_array 971 xptr_t lock_xp = XPTR( process_cxy , &process_ptr->fd_array.lock ); 953 972 954 973 // take lock protecting reference fd_array 955 remote_queuelock_acquire( XPTR( ref_cxy , &ref_ptr->fd_array.lock ));974 remote_queuelock_acquire( lock_xp ); 956 975 957 976 found = false; … … 959 978 for ( id = 0; id < CONFIG_PROCESS_FILE_MAX_NR ; id++ ) 960 979 { 961 xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->fd_array.array[id] ) );980 xp = hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[id] ) ); 962 981 if ( xp == XPTR_NULL ) 963 982 { 964 983 // update reference fd_array 965 hal_remote_s64( XPTR( ref_cxy , &ref_ptr->fd_array.array[id] ) , file_xp ); 966 count = hal_remote_l32( XPTR( ref_cxy , &ref_ptr->fd_array.current ) ) + 1; 967 hal_remote_s32( XPTR( ref_cxy , &ref_ptr->fd_array.current ) , count ); 968 969 // update local fd_array copy if required 970 if( ref_cxy != local_cxy ) 971 { 972 process->fd_array.array[id] = file_xp; 973 process->fd_array.current = count; 974 } 984 hal_remote_s64( XPTR( process_cxy , &process_ptr->fd_array.array[id] ) , file_xp ); 985 hal_remote_atomic_add( XPTR( process_cxy , &process_ptr->fd_array.current ) , 1 ); 975 986 976 987 // exit … … 981 992 } 982 993 983 // release lock protecting reference fd_array 984 remote_queuelock_release( XPTR( ref_cxy , &ref_ptr->fd_array.lock ) ); 994 // release lock protecting fd_array 995 remote_queuelock_release( lock_xp ); 996 997 #if DEBUG_PROCESS_FD_REGISTER 998 cycle = (uint32_t)hal_get_cycles(); 999 if( DEBUG_PROCESS_FD_REGISTER < cycle ) 1000 printk("\n[%s] thread[%x,%x] exit for process %x / fdid %d / cycle %d\n", 1001 __FUNCTION__, this->process->pid, this->trdid, pid, id, cycle ); 1002 #endif 985 1003 986 1004 if ( !found ) return -1; 987 1005 else return 0; 988 } 1006 1007 } // end process_fd_register() 989 1008 990 1009 //////////////////////////////////////////////// … … 1119 1138 // returns trdid 1120 1139 *trdid = TRDID( local_cxy , ltid ); 1121 1122 // if( LPID_FROM_PID( process->pid ) == 0 )1123 // printk("\n@@@ %s : allocate ltid %d for a thread %s in cluster %x\n",1124 // __FUNCTION__, ltid, thread_type_str( thread->type), local_cxy );1125 1126 1140 } 1127 1141 … … 1158 1172 process->th_tbl[ltid] = NULL; 1159 1173 process->th_nr = count-1; 1160 1161 // if( LPID_FROM_PID( process->pid ) == 0 )1162 // printk("\n@@@ %s : release ltid %d for a thread %s in cluster %x\n",1163 // __FUNCTION__, ltid, thread_type_str( thread->type), local_cxy );1164 1174 1165 1175 // release lock protecting th_tbl … … 1363 1373 process_t * process; // local pointer on this process 1364 1374 pid_t pid; // this process identifier 1375 xptr_t ref_xp; // reference process for this process 1365 1376 error_t error; // value returned by called functions 1366 1377 char * path; // path to .elf file … … 1370 1381 char ** args_pointers; // array of pointers on main thread arguments 1371 1382 1372 // get thread, process & PID1383 // get thread, process, pid and ref_xp 1373 1384 thread = CURRENT_THREAD; 1374 1385 process = thread->process; 1375 1386 pid = process->pid; 1387 ref_xp = process->ref_xp; 1376 1388 1377 1389 // get relevant infos from exec_info … … 1390 1402 file_xp = XPTR_NULL; 1391 1403 file_id = 0xFFFFFFFF; 1392 error = vfs_open( process ,1404 error = vfs_open( process->vfs_root_xp, 1393 1405 path, 1406 ref_xp, 1394 1407 O_RDONLY, 1395 1408 0, … … 1543 1556 #endif 1544 1557 1545 } // end process_zero_ init()1558 } // end process_zero_create() 1546 1559 1547 1560 //////////////////////////////// … … 1558 1571 1559 1572 #if DEBUG_PROCESS_INIT_CREATE 1573 thread_t * this = CURRENT_THREAD; 1560 1574 uint32_t cycle = (uint32_t)hal_get_cycles(); 1561 1575 if( DEBUG_PROCESS_INIT_CREATE < cycle ) 1562 printk("\n[%s] thread %x in process %xenter / cycle %d\n",1563 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, cycle );1576 printk("\n[%s] thread[%x,%x] enter / cycle %d\n", 1577 __FUNCTION__, this->process->pid, this->trdid, cycle ); 1564 1578 #endif 1565 1579 … … 1571 1585 "no memory for process descriptor in cluster %x\n", local_cxy ); 1572 1586 1587 // set the CWD and VFS_ROOT fields in process descriptor 1588 process->cwd_xp = process_zero.vfs_root_xp; 1589 process->vfs_root_xp = process_zero.vfs_root_xp; 1590 1573 1591 // get PID from local cluster 1574 1592 error = cluster_pid_alloc( process , &pid ); … … 1589 1607 #if(DEBUG_PROCESS_INIT_CREATE & 1) 1590 1608 if( DEBUG_PROCESS_INIT_CREATE < cycle ) 1591 printk("\n[%s] thread %x in process %xinitialized process descriptor\n",1592 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid );1609 printk("\n[%s] thread[%x,%x] initialized process descriptor\n", 1610 __FUNCTION__, this->process->pid, this->trdid ); 1593 1611 #endif 1594 1612 … … 1596 1614 file_xp = XPTR_NULL; 1597 1615 file_id = -1; 1598 error = vfs_open( process ,1616 error = vfs_open( process->vfs_root_xp, 1599 1617 CONFIG_PROCESS_INIT_PATH, 1618 XPTR( local_cxy , process ), 1600 1619 O_RDONLY, 1601 1620 0, … … 1608 1627 #if(DEBUG_PROCESS_INIT_CREATE & 1) 1609 1628 if( DEBUG_PROCESS_INIT_CREATE < cycle ) 1610 printk("\n[%s] thread %x in process %xopen .elf file decriptor\n",1611 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid );1629 printk("\n[%s] thread[%x,%x] open .elf file decriptor\n", 1630 __FUNCTION__, this->process->pid, this->trdid ); 1612 1631 #endif 1613 1632 … … 1621 1640 #if(DEBUG_PROCESS_INIT_CREATE & 1) 1622 1641 if( DEBUG_PROCESS_INIT_CREATE < cycle ) 1623 printk("\n[%s] thread %x in process %xregistered code/data vsegs in VMM\n",1624 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid );1642 printk("\n[%s] thread[%x,%x] registered code/data vsegs in VMM\n", 1643 __FUNCTION__, this->process->pid, this->trdid ); 1625 1644 #endif 1626 1645 … … 1641 1660 #if(DEBUG_PROCESS_INIT_CREATE & 1) 1642 1661 if( DEBUG_PROCESS_INIT_CREATE < cycle ) 1643 printk("\n[%s] thread %x in process %xregistered init process in parent\n",1644 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid );1662 printk("\n[%s] thread[%x,%x] registered init process in parent\n", 1663 __FUNCTION__, this->process->pid, this->trdid ); 1645 1664 #endif 1646 1665 … … 1668 1687 #if(DEBUG_PROCESS_INIT_CREATE & 1) 1669 1688 if( DEBUG_PROCESS_INIT_CREATE < cycle ) 1670 printk("\n[%s] thread %x in process %xcreated main thread\n",1671 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid );1689 printk("\n[%s] thread[%x,%x] created main thread\n", 1690 __FUNCTION__, this->process->pid, this->trdid ); 1672 1691 #endif 1673 1692 … … 1680 1699 cycle = (uint32_t)hal_get_cycles(); 1681 1700 if( DEBUG_PROCESS_INIT_CREATE < cycle ) 1682 printk("\n[%s] thread %x in process %xexit / cycle %d\n",1683 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, cycle );1701 printk("\n[%s] thread[%x,%x] exit / cycle %d\n", 1702 __FUNCTION__, this->process->pid, this->trdid, cycle ); 1684 1703 #endif 1685 1704 … … 1865 1884 1866 1885 #if DEBUG_PROCESS_TXT 1886 thread_t * this = CURRENT_THREAD; 1867 1887 uint32_t cycle = (uint32_t)hal_get_cycles(); 1868 1888 if( DEBUG_PROCESS_TXT < cycle ) 1869 printk("\n[%s] thread %x in process %x attached process %x to TXT %d / cycle %d\n", 1870 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, 1871 process->pid, txt_id , cycle ); 1889 printk("\n[%s] thread[%x,%x] attached process %x to TXT %d / cycle %d\n", 1890 __FUNCTION__, this->process->pid, this->trdid, process->pid, txt_id , cycle ); 1872 1891 #endif 1873 1892 … … 1919 1938 1920 1939 #if DEBUG_PROCESS_TXT 1940 thread_t * this = CURRENT_THREAD; 1921 1941 uint32_t cycle = (uint32_t)hal_get_cycles(); 1922 1942 uint32_t txt_id = hal_remote_l32( XPTR( chdev_cxy , &chdev_ptr->channel ) ); 1923 1943 if( DEBUG_PROCESS_TXT < cycle ) 1924 printk("\n[%s] thread %x in process %x detached process %x from TXT %d / cycle %d\n", 1925 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, 1926 process_pid, txt_id, cycle ); 1944 printk("\n[%s] thread[%x,%x] detached process %x from TXT %d / cycle %d\n", 1945 __FUNCTION__, this->process->pid, this->trdid, process_pid, txt_id, cycle ); 1927 1946 #endif 1928 1947 … … 1961 1980 1962 1981 #if DEBUG_PROCESS_TXT 1982 thread_t * this = CURRENT_THREAD; 1963 1983 uint32_t cycle = (uint32_t)hal_get_cycles(); 1964 1984 uint32_t txt_id = hal_remote_l32( XPTR( txt_cxy , &txt_ptr->channel ) ); 1965 1985 if( DEBUG_PROCESS_TXT < cycle ) 1966 printk("\n[%s] thread %x in process %xgive TXT %d to process %x / cycle %d\n",1967 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, txt_id, process_pid, cycle );1986 printk("\n[%s] thread[%x,%x] give TXT %d to process %x / cycle %d\n", 1987 __FUNCTION__, this->process->pid, this->trdid, txt_id, process_pid, cycle ); 1968 1988 #endif 1969 1989 … … 1990 2010 1991 2011 #if DEBUG_PROCESS_TXT 1992 uint32_t cycle; 2012 thread_t * this = CURRENT_THREAD; 2013 uint32_t cycle; 1993 2014 #endif 1994 2015 … … 2042 2063 2043 2064 #if DEBUG_PROCESS_TXT 2044 cycle 2065 cycle = (uint32_t)hal_get_cycles(); 2045 2066 uint32_t ksh_pid = hal_remote_l32( XPTR( current_cxy , ¤t_ptr->pid ) ); 2046 2067 if( DEBUG_PROCESS_TXT < cycle ) 2047 printk("\n[%s] thread %x in process %xrelease TXT %d to KSH %x / cycle %d\n",2048 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, txt_id, ksh_pid, cycle );2068 printk("\n[%s] thread[%x,%x] release TXT %d to KSH %x / cycle %d\n", 2069 __FUNCTION__, this->process->pid, this->trdid, txt_id, ksh_pid, cycle ); 2049 2070 process_txt_display( txt_id ); 2050 2071 #endif … … 2079 2100 2080 2101 #if DEBUG_PROCESS_TXT 2081 cycle 2102 cycle = (uint32_t)hal_get_cycles(); 2082 2103 uint32_t new_pid = hal_remote_l32( XPTR( current_cxy , ¤t_ptr->pid ) ); 2083 2104 if( DEBUG_PROCESS_TXT < cycle ) 2084 printk("\n[%s] thread %x in process %xrelease TXT %d to process %x / cycle %d\n",2085 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, txt_id, new_pid, cycle );2105 printk("\n[%s] thread[%x,%x] release TXT %d to process %x / cycle %d\n", 2106 __FUNCTION__,this->process->pid, this->trdid, txt_id, new_pid, cycle ); 2086 2107 process_txt_display( txt_id ); 2087 2108 #endif … … 2099 2120 cycle = (uint32_t)hal_get_cycles(); 2100 2121 if( DEBUG_PROCESS_TXT < cycle ) 2101 printk("\n[%s] thread %x in process %xrelease TXT %d to nobody / cycle %d\n",2102 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, txt_id, cycle );2122 printk("\n[%s] thread[%x,%x] release TXT %d to nobody / cycle %d\n", 2123 __FUNCTION__, this->process->pid, this->trdid, txt_id, cycle ); 2103 2124 process_txt_display( txt_id ); 2104 2125 #endif … … 2113 2134 if( DEBUG_PROCESS_TXT < cycle ) 2114 2135 printk("\n[%s] thread %x in process %d does nothing (not TXT owner) / cycle %d\n", 2115 __FUNCTION__, CURRENT_THREAD->trdid, process_pid, cycle );2136 __FUNCTION__, this->trdid, process_pid, cycle ); 2116 2137 process_txt_display( txt_id ); 2117 2138 #endif
Note: See TracChangeset
for help on using the changeset viewer.