Changeset 584 for trunk/kernel/syscalls/sys_exit.c
- Timestamp:
- Nov 1, 2018, 12:13:45 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_exit.c
r566 r584 38 38 int sys_exit( uint32_t status ) 39 39 { 40 reg_t save_sr; // required to enable IRQs41 42 40 xptr_t owner_xp; // extended pointer on owner process 43 41 cxy_t owner_cxy; // owner process cluster … … 60 58 tm_start = hal_get_cycles(); 61 59 if( DEBUG_SYS_EXIT < tm_start ) 62 printk("\n[DBG] %s : thread %x in process %xenter / status %x / cycle %d\n",63 __FUNCTION__, this->trdid, process->pid , status , (uint32_t)tm_start );60 printk("\n[DBG] %s : thread[%x,%x] enter / status %x / cycle %d\n", 61 __FUNCTION__, process->pid, this->trdid , status , (uint32_t)tm_start ); 64 62 #endif 65 63 … … 71 69 #if (DEBUG_SYS_EXIT & 1) 72 70 if( DEBUG_SYS_EXIT < tm_start ) 73 printk("\n[DBG] %s : thread %x in process %xget owner process in cluster %x\n",74 __FUNCTION__, this->trdid, process->pid, owner_cxy );71 printk("\n[DBG] %s : thread[%x,%x] get owner process in cluster %x\n", 72 __FUNCTION__, process->pid, this->trdid, owner_cxy ); 75 73 #endif 76 74 … … 85 83 #if (DEBUG_SYS_EXIT & 1) 86 84 if( DEBUG_SYS_EXIT < tm_start ) 87 printk("\n[DBG] %s : thread %x in process %xget parent process in cluster %x\n",88 __FUNCTION__, this->trdid, process->pid, parent_cxy );85 printk("\n[DBG] %s : thread[%x,%x] get parent process in cluster %x\n", 86 __FUNCTION__, process->pid, this->trdid, parent_cxy ); 89 87 #endif 90 88 … … 98 96 #if( DEBUG_SYS_EXIT & 1) 99 97 if( DEBUG_SYS_EXIT < tm_start ) 100 printk("\n[DBG] %s : thread %x in process %xdetached process from TXT\n",101 __FUNCTION__, this->trdid, process->pid );98 printk("\n[DBG] %s : thread[%x,%x] detached process from TXT\n", 99 __FUNCTION__, process->pid, this->trdid ); 102 100 #endif 103 101 104 102 // mark for delete all process threads in all clusters, 105 103 // but the main thread and this calling thread 106 hal_enable_irq( &save_sr );107 104 process_sigaction( process->pid , DELETE_ALL_THREADS ); 108 hal_restore_irq( save_sr );109 105 110 106 #if( DEBUG_SYS_EXIT & 1) 111 107 if( DEBUG_SYS_EXIT < tm_start ) 112 printk("\n[DBG] %s : thread %x in process %xdeleted all threads but itself\n",113 __FUNCTION__, this->trdid, process->pid );108 printk("\n[DBG] %s : thread[%x,%x] deleted all threads but itself\n", 109 __FUNCTION__, process->pid, this->trdid ); 114 110 #endif 115 111 … … 120 116 #if( DEBUG_SYS_EXIT & 1) 121 117 if( tm_start > DEBUG_SYS_EXIT ) 122 printk("\n[DBG] %s : thread %x in process %xmarked iself for delete\n",123 __FUNCTION__, this->trdid, process->pid );118 printk("\n[DBG] %s : thread[%x,%x] marked iself for delete\n", 119 __FUNCTION__, process->pid, this->trdid ); 124 120 #endif 125 121 thread_delete( XPTR( local_cxy , this ) , pid , true ); … … 131 127 #if( DEBUG_SYS_EXIT & 1) 132 128 if( tm_start > DEBUG_SYS_EXIT ) 133 printk("\n[DBG] %s : thread %x in process %xblocked main thread\n",134 __FUNCTION__, this->trdid, process->pid );129 printk("\n[DBG] %s : thread[%x,%x] blocked main thread\n", 130 __FUNCTION__, process->pid, this->trdid ); 135 131 #endif 136 132 … … 142 138 #if( DEBUG_SYS_EXIT & 1) 143 139 if( tm_start > DEBUG_SYS_EXIT ) 144 printk("\n[DBG] %s : thread %x in process %xset exit status %x in owner process\n",145 __FUNCTION__, this->trdid, process->pid, term_state );140 printk("\n[DBG] %s : thread[%x,%x] set exit status %x in owner process\n", 141 __FUNCTION__, process->pid, this->trdid, term_state ); 146 142 #endif 147 143 … … 151 147 #if( DEBUG_SYS_EXIT & 1) 152 148 if( tm_start > DEBUG_SYS_EXIT ) 153 printk("\n[DBG] %s : thread %x in process %xunblocked parent main thread in process %x\n",154 __FUNCTION__ , this->trdid, process->pid,149 printk("\n[DBG] %s : thread[%x,%x] unblocked parent main thread in process %x\n", 150 __FUNCTION__ , process->pid, this->trdid, 155 151 hal_remote_l32( XPTR( parent_cxy , &parent_ptr->pid) ) ); 156 152 #endif … … 161 157 tm_end = hal_get_cycles(); 162 158 if( DEBUG_SYS_EXIT < tm_end ) 163 printk("\n[DBG] %s : thread %x in process %xexit / status %x / cost = %d / cycle %d\n",164 __FUNCTION__, this->trdid, process->pid, status,159 printk("\n[DBG] %s : thread[%x,%x] exit / status %x / cost = %d / cycle %d\n", 160 __FUNCTION__, process->pid, this->trdid, status, 165 161 (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); 166 162 #endif
Note: See TracChangeset
for help on using the changeset viewer.