Changeset 441 for trunk/kernel/kern
- Timestamp:
- May 9, 2018, 3:13:56 PM (7 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/process.c
r440 r441 1165 1165 cycle = (uint32_t)hal_get_cycles(); 1166 1166 if( DEBUG_PROCESS_MAKE_FORK < cycle ) 1167 printk("\n[DBG] %s : thread %x created child thread %x / cycle %d\n",1168 __FUNCTION__ , CURRENT_THREAD, thread, cycle );1167 printk("\n[DBG] %s : thread %x created child thread %x on core[%x,%d] / cycle %d\n", 1168 __FUNCTION__ , CURRENT_THREAD, thread, local_cxy, thread->core->lid, cycle ); 1169 1169 #endif 1170 1170 … … 1222 1222 { 1223 1223 char * path; // pathname to .elf file 1224 pid_t pid; // old_process PID /given to new_process1224 pid_t pid; // old_process PID, given to new_process 1225 1225 pid_t temp_pid; // temporary PID / given to old_process 1226 1226 process_t * old_process; // local pointer on old process … … 1231 1231 pthread_attr_t attr; // new thread attributes 1232 1232 lid_t lid; // selected core local index 1233 error_t error; 1234 1233 error_t error; // value returned by called functions 1234 1235 1235 // get old_thread / old_process / PID / parent_xp 1236 1236 old_thread = CURRENT_THREAD; … … 1240 1240 1241 1241 // get .elf pathname from exec_info 1242 path = exec_info->path;1242 path = exec_info->path; 1243 1243 1244 1244 // this function must be executed by a thread running in owner cluster … … 1261 1261 if( new_process == NULL ) 1262 1262 { 1263 printk("\n[ERROR] in %s : cannot allocate process descriptor in cluster %x\n", 1264 __FUNCTION__ , local_cxy ); 1263 printk("\n[ERROR] in %s : cannot allocate process for %s\n", __FUNCTION__ , path ); 1265 1264 return -1; 1266 1265 } … … 1297 1296 // register code & data vsegs as well as entry-point in new process VMM, 1298 1297 // and register extended pointer on .elf file in process descriptor 1299 if( elf_load_process( path , new_process ) ) 1298 error = elf_load_process( path , new_process ); 1299 1300 if( error ) 1300 1301 { 1301 printk("\n[ERROR] in %s : failed to access .elf file for path %s\n", 1302 __FUNCTION__ , path ); 1302 printk("\n[ERROR] in %s : failed to access <%s>\n", __FUNCTION__ , path ); 1303 process_txt_set_ownership( XPTR( local_cxy , old_process) ); 1304 process_txt_detach( XPTR( local_cxy , new_process) ); 1303 1305 process_destroy( new_process ); 1306 old_process->pid = pid; 1304 1307 return -1; 1305 1308 } … … 1328 1331 if( error ) 1329 1332 { 1330 printk("\n[ERROR] in %s : cannot create thread for process %x\n", 1331 __FUNCTION__ , new_process ); 1333 printk("\n[ERROR] in %s : cannot create thread for %s\n", __FUNCTION__ , path ); 1334 process_txt_set_ownership( XPTR( local_cxy , old_process) ); 1335 process_txt_detach( XPTR( local_cxy , new_process) ); 1332 1336 process_destroy( new_process ); 1337 old_process->pid = pid; 1333 1338 return -1; 1334 1339 } … … 1375 1380 cycle = (uint32_t)hal_get_cycles(); 1376 1381 if( DEBUG_PROCESS_MAKE_EXEC < cycle ) 1377 printk("\n[DBG] %s : old _thread %x blocked / new_thread %x activated / cycle %d\n",1382 printk("\n[DBG] %s : old thread %x blocked for delete / new thread %x activated / cycle %d\n", 1378 1383 __FUNCTION__ , old_thread , new_thread , cycle ); 1379 1384 #endif … … 1735 1740 remote_spinlock_unlock( lock_xp ); 1736 1741 1737 #if( DEBUG_PROCESS_TXT_ATTACH & 1 ) 1742 #if DEBUG_PROCESS_TXT_ATTACH 1743 cycle = (uint32_t)hal_get_cycles(); 1744 uint32_t txt_id = hal_remote_lw( XPTR( chdev_cxy , &chdev_ptr->channel ) ); 1738 1745 if( DEBUG_PROCESS_TXT_ATTACH < cycle ) 1739 { 1740 xptr_t root_xp = XPTR( chdev_cxy , &chdev_ptr->ext.txt.root ); 1741 xptr_t iter_xp; 1742 XLIST_FOREACH( root_xp , iter_xp ) 1743 { 1744 xptr_t current_xp = XLIST_ELEMENT( iter_xp , process_t , txt_list ); 1745 process_t * current_ptr = GET_PTR( current_xp ); 1746 1747 printk("\n[DBG] %s : attached_process %x (pid = %x)\n", 1748 __FUNCTION__, current_ptr, current_ptr->pid ); 1749 } 1750 } 1751 #endif 1752 1753 #if DEBUG_PROCESS_TXT_ATTACH 1754 cycle = (uint32_t)hal_get_cycles(); 1755 if( DEBUG_PROCESS_TXT_ATTACH < cycle ) 1756 printk("\n[DBG] %s : thread %x exit / process %x detached from TXT / cycle %d\n", 1757 __FUNCTION__, CURRENT_THREAD, process->pid, cycle ); 1746 printk("\n[DBG] %s : thread %x exit / process %x detached from TXT %d / cycle %d\n", 1747 __FUNCTION__, CURRENT_THREAD, process_pid, txt_id, cycle ); 1758 1748 #endif 1759 1749 … … 1842 1832 uint32_t cycle = (uint32_t)hal_get_cycles(); 1843 1833 if( DEBUG_PROCESS_TXT_ATTACH < cycle ) 1844 printk("\n[DBG] %s : thread %x enter / process %x / pid %x /cycle %d\n",1845 __FUNCTION__, CURRENT_THREAD, process_p tr, process_pid, cycle );1834 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n", 1835 __FUNCTION__, CURRENT_THREAD, process_pid, cycle ); 1846 1836 #endif 1847 1837 -
trunk/kernel/kern/process.h
r440 r441 510 510 * It is called only by the process_reference_init() function when creating a KSH process. 511 511 * It makes a kernel panic if no free TXT terminal is found. 512 * As a KSH process is never deleted, the allocated TXT terminal is never released. 512 * The allocated TXT terminal is only released if the KSH process is deleted, 513 * which is a rare and abnormal event. 513 514 ********************************************************************************************* 514 515 * @ return TXT terminal index if succes / kernel panic if no terminal found. -
trunk/kernel/kern/rpc.c
r440 r441 1666 1666 1667 1667 ///////////////////////////////////////////////////////////////////////////////////////// 1668 // [21] Marshaling functions attached to RPC_VMM_GET_ VSEG(blocking)1668 // [21] Marshaling functions attached to RPC_VMM_GET_PTE (blocking) 1669 1669 ///////////////////////////////////////////////////////////////////////////////////////// 1670 1670 … … 1689 1689 // initialise RPC descriptor header 1690 1690 rpc_desc_t rpc; 1691 rpc.index = RPC_VMM_GET_ VSEG;1691 rpc.index = RPC_VMM_GET_PTE; 1692 1692 rpc.blocking = true; 1693 1693 rpc.responses = 1; … … 1769 1769 // initialise RPC descriptor header 1770 1770 rpc_desc_t rpc; 1771 rpc.index = RPC_ THREAD_USER_CREATE;1771 rpc.index = RPC_KCM_ALLOC; 1772 1772 rpc.blocking = true; 1773 1773 rpc.responses = 1; … … 1819 1819 // initialise RPC descriptor header 1820 1820 rpc_desc_t rpc; 1821 rpc.index = RPC_ THREAD_USER_CREATE;1821 rpc.index = RPC_KCM_FREE; 1822 1822 rpc.blocking = true; 1823 1823 rpc.responses = 1;
Note: See TracChangeset
for help on using the changeset viewer.