Changeset 492 for trunk/kernel/kern/process.c
- Timestamp:
- Aug 22, 2018, 11:55:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/process.c
r485 r492 132 132 // initialize vmm as empty 133 133 error = vmm_init( process ); 134 assert( (error == 0) , __FUNCTION__ ,"cannot initialize VMM\n" );134 assert( (error == 0) , "cannot initialize VMM\n" ); 135 135 136 136 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) … … 175 175 &stdin_id ); 176 176 177 assert( (error == 0) , __FUNCTION__ ,"cannot open stdin pseudo file" );178 assert( (stdin_id == 0) , __FUNCTION__ ,"stdin index must be 0" );177 assert( (error == 0) , "cannot open stdin pseudo file" ); 178 assert( (stdin_id == 0) , "stdin index must be 0" ); 179 179 180 180 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) … … 193 193 &stdout_id ); 194 194 195 assert( (error == 0) , __FUNCTION__ ,"cannot open stdout pseudo file" );196 assert( (stdout_id == 1) , __FUNCTION__ ,"stdout index must be 1" );195 assert( (error == 0) , "cannot open stdout pseudo file" ); 196 assert( (stdout_id == 1) , "stdout index must be 1" ); 197 197 198 198 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) … … 211 211 &stderr_id ); 212 212 213 assert( (error == 0) , __FUNCTION__ ,"cannot open stderr pseudo file" );214 assert( (stderr_id == 2) , __FUNCTION__ ,"stderr index must be 2" );213 assert( (error == 0) , "cannot open stderr pseudo file" ); 214 assert( (stderr_id == 2) , "stderr index must be 2" ); 215 215 216 216 #if (DEBUG_PROCESS_REFERENCE_INIT & 1) … … 330 330 // reset local process vmm 331 331 error = vmm_init( local_process ); 332 assert( (error == 0) , __FUNCTION__ ,"cannot initialize VMM\n");332 assert( (error == 0) , "cannot initialize VMM\n"); 333 333 334 334 // reset process file descriptors array … … 393 393 pid_t pid = process->pid; 394 394 395 assert( (process->th_nr == 0) , __FUNCTION__ ,395 assert( (process->th_nr == 0) , 396 396 "process %x in cluster %x has still active threads", pid , local_cxy ); 397 397 … … 511 511 assert( ((type == DELETE_ALL_THREADS ) || 512 512 (type == BLOCK_ALL_THREADS ) || 513 (type == UNBLOCK_ALL_THREADS )), __FUNCTION__ ,"illegal action type" );513 (type == UNBLOCK_ALL_THREADS )), "illegal action type" ); 514 514 515 515 … … 843 843 xptr_t ref_xp = cluster_get_reference_process_from_pid( pid ); 844 844 845 assert( (ref_xp != XPTR_NULL) , __FUNCTION__ ,"illegal pid\n" );845 assert( (ref_xp != XPTR_NULL) , "illegal pid\n" ); 846 846 847 847 // allocate memory for local process descriptor … … 1046 1046 1047 1047 1048 assert( (process != NULL) , __FUNCTION__ ,"process argument is NULL" );1049 1050 assert( (thread != NULL) , __FUNCTION__ ,"thread argument is NULL" );1048 assert( (process != NULL) , "process argument is NULL" ); 1049 1050 assert( (thread != NULL) , "thread argument is NULL" ); 1051 1051 1052 1052 // take lock protecting th_tbl, depending on thread type: … … 1089 1089 uint32_t count; // number of threads in local process descriptor 1090 1090 1091 assert( (thread != NULL) , __FUNCTION__ ,"thread argument is NULL" );1091 assert( (thread != NULL) , "thread argument is NULL" ); 1092 1092 1093 1093 process_t * process = thread->process; … … 1101 1101 count = process->th_nr; 1102 1102 1103 assert( (count > 0) , __FUNCTION__ ,"process th_nr cannot be 0\n" );1103 assert( (count > 0) , "process th_nr cannot be 0\n" ); 1104 1104 1105 1105 // remove thread from th_tbl[] … … 1140 1140 ref_xp = hal_remote_lwd( XPTR( parent_process_cxy , &parent_process_ptr->ref_xp ) ); 1141 1141 1142 assert( (parent_process_xp == ref_xp ) , __FUNCTION__ ,1142 assert( (parent_process_xp == ref_xp ) , 1143 1143 "parent process must be the reference process\n" ); 1144 1144 … … 1243 1243 1244 1244 // check main thread LTID 1245 assert( (LTID_FROM_TRDID(thread->trdid) == 0) , __FUNCTION__ ,1245 assert( (LTID_FROM_TRDID(thread->trdid) == 0) , 1246 1246 "main thread must have LTID == 0\n" ); 1247 1247 … … 1421 1421 } 1422 1422 1423 assert( false, __FUNCTION__,"we should not execute this code");1423 assert( false, "we should not execute this code"); 1424 1424 1425 1425 return 0; … … 1491 1491 process = process_alloc(); 1492 1492 1493 assert( (process != NULL), __FUNCTION__,1493 assert( (process != NULL), 1494 1494 "no memory for process descriptor in cluster %x\n", local_cxy ); 1495 1495 … … 1497 1497 error = cluster_pid_alloc( process , &pid ); 1498 1498 1499 assert( (error == 0), __FUNCTION__,1499 assert( (error == 0), 1500 1500 "cannot allocate PID in cluster %x\n", local_cxy ); 1501 1501 1502 assert( (pid == 1) , __FUNCTION__,1502 assert( (pid == 1) , 1503 1503 "process INIT must be first process in cluster 0\n" ); 1504 1504 … … 1518 1518 &file_id ); 1519 1519 1520 assert( (error == 0), __FUNCTION__,1520 assert( (error == 0), 1521 1521 "failed to open file <%s>\n", CONFIG_PROCESS_INIT_PATH ); 1522 1522 … … 1525 1525 error = elf_load_process( file_xp , process ); 1526 1526 1527 assert( (error == 0), __FUNCTION__,1527 assert( (error == 0), 1528 1528 "cannot access .elf file <%s>\n", CONFIG_PROCESS_INIT_PATH ); 1529 1529 … … 1553 1553 &thread ); 1554 1554 1555 assert( (error == 0), __FUNCTION__,1555 assert( (error == 0), 1556 1556 "cannot create main thread for <%s>\n", CONFIG_PROCESS_INIT_PATH ); 1557 1557 1558 assert( (thread->trdid == 0), __FUNCTION__,1558 assert( (thread->trdid == 0), 1559 1559 "main thread must have index 0 for <%s>\n", CONFIG_PROCESS_INIT_PATH ); 1560 1560 … … 1631 1631 txt_file_xp = hal_remote_lwd( XPTR( owner_cxy , &owner_ptr->fd_array.array[0] ) ); 1632 1632 1633 assert( (txt_file_xp != XPTR_NULL) , __FUNCTION__ ,1633 assert( (txt_file_xp != XPTR_NULL) , 1634 1634 "process must be attached to one TXT terminal\n" ); 1635 1635 … … 1695 1695 } 1696 1696 1697 assert( false , __FUNCTION__ ,"no free TXT terminal found" );1697 assert( false , "no free TXT terminal found" ); 1698 1698 1699 1699 return -1; … … 1712 1712 1713 1713 // check process is in owner cluster 1714 assert( (CXY_FROM_PID( process->pid ) == local_cxy) , __FUNCTION__ ,1714 assert( (CXY_FROM_PID( process->pid ) == local_cxy) , 1715 1715 "process descriptor not in owner cluster" ); 1716 1716 1717 1717 // check terminal index 1718 1718 assert( (txt_id < LOCAL_CLUSTER->nb_txt_channels) , 1719 __FUNCTION__ ,"illegal TXT terminal index" );1719 "illegal TXT terminal index" ); 1720 1720 1721 1721 // get pointers on TXT_RX[txt_id] chdev … … 1761 1761 // check process descriptor in owner cluster 1762 1762 process_pid = hal_remote_lw( XPTR( process_cxy , &process_ptr->pid ) ); 1763 assert( (CXY_FROM_PID( process_pid ) == process_cxy ) , __FUNCTION__ ,1763 assert( (CXY_FROM_PID( process_pid ) == process_cxy ) , 1764 1764 "process descriptor not in owner cluster" ); 1765 1765 … … 1811 1811 1812 1812 // check owner cluster 1813 assert( (process_cxy == CXY_FROM_PID( process_pid )) , __FUNCTION__,1813 assert( (process_cxy == CXY_FROM_PID( process_pid )) , 1814 1814 "process descriptor not in owner cluster\n" ); 1815 1815 … … 1864 1864 1865 1865 // check owner cluster 1866 assert( (process_cxy == CXY_FROM_PID( process_pid )) , __FUNCTION__,1866 assert( (process_cxy == CXY_FROM_PID( process_pid )) , 1867 1867 "process descriptor not in owner cluster\n" ); 1868 1868 … … 1922 1922 1923 1923 // PANIC if KSH not found 1924 assert( false , __FUNCTION__ , "KSH process not found for TXT %d" );1924 assert( false , "KSH process not found for TXT %d" ); 1925 1925 1926 1926 return; … … 1995 1995 // check owner cluster 1996 1996 pid_t process_pid = hal_remote_lw( XPTR( process_cxy , &process_ptr->pid ) ); 1997 assert( (process_cxy == CXY_FROM_PID( process_pid )) , __FUNCTION__,1997 assert( (process_cxy == CXY_FROM_PID( process_pid )) , 1998 1998 "process descriptor not in owner cluster\n" ); 1999 1999 … … 2041 2041 2042 2042 assert( (txt_id < LOCAL_CLUSTER->nb_txt_channels) , 2043 __FUNCTION__ ,"illegal TXT terminal index" );2043 "illegal TXT terminal index" ); 2044 2044 2045 2045 // get pointers on TXT0 chdev
Note: See TracChangeset
for help on using the changeset viewer.