Changeset 457 for trunk/kernel/syscalls/sys_exit.c
- Timestamp:
- Aug 2, 2018, 11:47:13 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_exit.c
r446 r457 23 23 24 24 #include <kernel_config.h> 25 #include <hal_ types.h>25 #include <hal_kernel_types.h> 26 26 #include <hal_irqmask.h> 27 27 #include <errno.h> … … 59 59 tm_start = hal_get_cycles(); 60 60 if( DEBUG_SYS_EXIT < tm_start ) 61 printk("\n[DBG] %s : thread %x enter / process %x/ status %x / cycle %d\n",62 __FUNCTION__ , this,pid , status , (uint32_t)tm_start );61 printk("\n[DBG] %s : thread %x in process %x enter / status %x / cycle %d\n", 62 __FUNCTION__, this->trdid, process->pid , status , (uint32_t)tm_start ); 63 63 #endif 64 64 … … 70 70 #if (DEBUG_SYS_EXIT & 1) 71 71 if( DEBUG_SYS_EXIT < tm_start ) 72 printk("\n[DBG] %s : thread %x get owner process %x in cluster %x\n",73 __FUNCTION__ , this, owner_ptr, owner_cxy );72 printk("\n[DBG] %s : thread %x in process %x get owner process %x in cluster %x\n", 73 __FUNCTION__, this->trdid, process->pid, owner_ptr, owner_cxy ); 74 74 #endif 75 75 76 // get pointer on the process main thread76 // get local pointer on the process main thread 77 77 main_ptr = hal_remote_lpt( XPTR( owner_cxy , &owner_ptr->th_tbl[0] ) ); 78 78 … … 84 84 #if (DEBUG_SYS_EXIT & 1) 85 85 if( DEBUG_SYS_EXIT < tm_start ) 86 printk("\n[DBG] %s : thread %x get parent process %x in cluster %x\n",87 __FUNCTION__ , this, parent_ptr, parent_cxy );86 printk("\n[DBG] %s : thread %x in process %x get parent process %x in cluster %x\n", 87 __FUNCTION__, this->trdid, process->pid, parent_ptr, parent_cxy ); 88 88 #endif 89 89 … … 99 99 100 100 #if( DEBUG_SYS_EXIT & 1) 101 if( tm_start > DEBUG_SYS_EXIT)102 printk("\n[DBG] %s : thread %x removed process %x from TXT list\n",103 __FUNCTION__ , this,pid );101 if( DEBUG_SYS_EXIT < tm_start ) 102 printk("\n[DBG] %s : thread %x in process %x detached process from TXT\n", 103 __FUNCTION__, this->trdid, process->pid ); 104 104 #endif 105 105 … … 107 107 // but the main thread and this calling thread 108 108 hal_enable_irq( &save_sr ); 109 process_sigaction( p id , DELETE_ALL_THREADS );109 process_sigaction( process->pid , DELETE_ALL_THREADS ); 110 110 hal_restore_irq( save_sr ); 111 111 112 112 #if( DEBUG_SYS_EXIT & 1) 113 if( tm_start > DEBUG_SYS_EXIT)114 printk("\n[DBG] %s : thread %x deleted threads for process %x\n",115 __FUNCTION__ , this,pid );113 if( DEBUG_SYS_EXIT < tm_start ) 114 printk("\n[DBG] %s : thread %x in process %x deleted all threads but itself\n", 115 __FUNCTION__, this->trdid, process->pid ); 116 116 #endif 117 117 … … 122 122 #if( DEBUG_SYS_EXIT & 1) 123 123 if( tm_start > DEBUG_SYS_EXIT ) 124 printk("\n[DBG] %s : calling thread %x marked iself for delete in process %x\n",125 __FUNCTION__ , this,pid );124 printk("\n[DBG] %s : thread %x in process %x marked iself for delete\n", 125 __FUNCTION__, this->trdid, process->pid ); 126 126 #endif 127 127 thread_delete( XPTR( local_cxy , this ) , pid , true ); … … 133 133 #if( DEBUG_SYS_EXIT & 1) 134 134 if( tm_start > DEBUG_SYS_EXIT ) 135 printk("\n[DBG] %s : thread %x blocked main thread for process %x\n",136 __FUNCTION__, this ,pid );135 printk("\n[DBG] %s : thread %x in process %x blocked main thread\n", 136 __FUNCTION__, this->trdid, process->pid ); 137 137 #endif 138 138 … … 144 144 #if( DEBUG_SYS_EXIT & 1) 145 145 if( tm_start > DEBUG_SYS_EXIT ) 146 printk("\n[DBG] %s : thread %x set exit status in process %x / term_state %x\n",147 __FUNCTION__ , this,pid, term_state );146 printk("\n[DBG] %s : thread %x in process %x set exit status %x in owner process\n", 147 __FUNCTION__, this->trdid, process->pid, term_state ); 148 148 #endif 149 149 150 // take the children lock andunblock the parent process main thread150 // unblock the parent process main thread 151 151 remote_spinlock_lock( children_lock_xp ); 152 152 thread_unblock( parent_main_xp , THREAD_BLOCKED_WAIT ); … … 155 155 #if( DEBUG_SYS_EXIT & 1) 156 156 if( tm_start > DEBUG_SYS_EXIT ) 157 printk("\n[DBG] %s : thread %x in cluster %x unblock parent main thread %x in cluster %x\n", 158 __FUNCTION__ , this, local_cxy, parent_main_ptr, parent_cxy ); 157 printk("\n[DBG] %s : thread %x in process %x unblock parent main thread in process %x\n", 158 __FUNCTION__ , this->trdid, process->pid, 159 hal_remote_lw( XPTR( parent_cxy , &parent_ptr->pid) ) ); 159 160 #endif 160 161 … … 164 165 tm_end = hal_get_cycles(); 165 166 if( DEBUG_SYS_EXIT < tm_end ) 166 printk("\n[DBG] %s : thread %x exit / process %x / status %x / cost = %d / cycle %d\n", 167 __FUNCTION__, this, pid, status, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); 167 printk("\n[DBG] %s : thread %x in process %x exit / status %x / cost = %d / cycle %d\n", 168 __FUNCTION__, this->trdid, process->pid, status, 169 (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); 168 170 #endif 169 171
Note: See TracChangeset
for help on using the changeset viewer.