Changeset 624 for trunk/kernel/kern/process.c
- Timestamp:
- Mar 12, 2019, 1:37:38 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/process.c
r623 r624 1209 1209 1210 1210 // check th_nr value 1211 assert( (count > 0) , "process th_nr cannot be 0 \n" );1211 assert( (count > 0) , "process th_nr cannot be 0" ); 1212 1212 1213 1213 // remove thread from th_tbl[] … … 1249 1249 // check parent process is the reference process 1250 1250 assert( (parent_process_xp == ref_xp ) , 1251 "parent process must be the reference process \n" );1251 "parent process must be the reference process" ); 1252 1252 1253 1253 #if DEBUG_PROCESS_MAKE_FORK … … 1352 1352 // check main thread LTID 1353 1353 assert( (LTID_FROM_TRDID(thread->trdid) == 0) , 1354 "main thread must have LTID == 0 \n" );1354 "main thread must have LTID == 0" ); 1355 1355 1356 1356 #if( DEBUG_PROCESS_MAKE_FORK & 1 ) … … 1552 1552 #endif 1553 1553 1554 // get pointer on VMM 1555 vmm_t * vmm = &process->vmm; 1556 1554 1557 // get PID from local cluster manager for this kernel process 1555 1558 error = cluster_pid_alloc( process , &pid ); … … 1571 1574 process->term_state = 0; 1572 1575 1573 // initialise kernel GPT and VSL, depending on architecture 1574 hal_vmm_kernel_init( info ); 1576 // initilise VSL as empty 1577 vmm->vsegs_nr = 0; 1578 xlist_root_init( XPTR( local_cxy , &vmm->vsegs_root ) ); 1579 remote_rwlock_init( XPTR( local_cxy , &vmm->vsegs_lock ) , LOCK_VMM_VSL ); 1580 1581 // initialise GPT as empty 1582 error = hal_gpt_create( &vmm->gpt ); 1583 1584 if( error ) 1585 { 1586 printk("\n[PANIC] in %s : cannot create empty GPT\n", __FUNCTION__ ); 1587 hal_core_sleep(); 1588 } 1589 1590 // initialize GPT lock 1591 remote_rwlock_init( XPTR( local_cxy , &vmm->gpt_lock ) , LOCK_VMM_GPT ); 1592 1593 // create kernel vsegs in GPT and VSL, as required by the hardware architecture 1594 error = hal_vmm_kernel_init( info ); 1595 1596 if( error ) 1597 { 1598 printk("\n[PANIC] in %s : cannot create kernel vsegs in VMM\n", __FUNCTION__ ); 1599 hal_core_sleep(); 1600 } 1575 1601 1576 1602 // reset th_tbl[] array and associated fields … … 1629 1655 // check memory allocator 1630 1656 assert( (process != NULL), 1631 "no memory for process descriptor in cluster %x \n", local_cxy );1657 "no memory for process descriptor in cluster %x", local_cxy ); 1632 1658 1633 1659 // set the CWD and VFS_ROOT fields in process descriptor … … 1640 1666 // check PID allocator 1641 1667 assert( (error == 0), 1642 "cannot allocate PID in cluster %x \n", local_cxy );1668 "cannot allocate PID in cluster %x", local_cxy ); 1643 1669 1644 1670 // check PID value 1645 1671 assert( (pid == 1) , 1646 "process INIT must be first process in cluster 0 \n" );1672 "process INIT must be first process in cluster 0" ); 1647 1673 1648 1674 // initialize process descriptor / parent is local process_zero … … 1669 1695 1670 1696 assert( (error == 0), 1671 "failed to open file <%s> \n", CONFIG_PROCESS_INIT_PATH );1697 "failed to open file <%s>", CONFIG_PROCESS_INIT_PATH ); 1672 1698 1673 1699 #if(DEBUG_PROCESS_INIT_CREATE & 1) … … 1682 1708 1683 1709 assert( (error == 0), 1684 "cannot access .elf file <%s> \n", CONFIG_PROCESS_INIT_PATH );1710 "cannot access .elf file <%s>", CONFIG_PROCESS_INIT_PATH ); 1685 1711 1686 1712 #if(DEBUG_PROCESS_INIT_CREATE & 1) … … 1726 1752 1727 1753 assert( (error == 0), 1728 "cannot create main thread for <%s> \n", CONFIG_PROCESS_INIT_PATH );1754 "cannot create main thread for <%s>", CONFIG_PROCESS_INIT_PATH ); 1729 1755 1730 1756 assert( (thread->trdid == 0), 1731 "main thread must have index 0 for <%s> \n", CONFIG_PROCESS_INIT_PATH );1757 "main thread must have index 0 for <%s>", CONFIG_PROCESS_INIT_PATH ); 1732 1758 1733 1759 #if(DEBUG_PROCESS_INIT_CREATE & 1) … … 1816 1842 1817 1843 assert( (txt_file_xp != XPTR_NULL) , 1818 "process must be attached to one TXT terminal \n" );1844 "process must be attached to one TXT terminal" ); 1819 1845 1820 1846 // get TXT_RX chdev pointers … … 2012 2038 // check owner cluster 2013 2039 assert( (process_cxy == CXY_FROM_PID( process_pid )) , 2014 "process descriptor not in owner cluster \n" );2040 "process descriptor not in owner cluster" ); 2015 2041 2016 2042 // get extended pointer on stdin pseudo file … … 2067 2093 // check owner cluster 2068 2094 assert( (process_cxy == CXY_FROM_PID( process_pid )) , 2069 "process descriptor not in owner cluster \n" );2095 "process descriptor not in owner cluster" ); 2070 2096 2071 2097 // get extended pointer on stdin pseudo file … … 2198 2224 pid_t process_pid = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) ); 2199 2225 assert( (process_cxy == CXY_FROM_PID( process_pid )) , 2200 "process descriptor not in owner cluster \n" );2226 "process descriptor not in owner cluster" ); 2201 2227 2202 2228 // get extended pointer on stdin pseudo file
Note: See TracChangeset
for help on using the changeset viewer.