Changeset 416 for trunk/kernel/syscalls/sys_exit.c
- Timestamp:
- Jan 4, 2018, 10:05:47 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_exit.c
r410 r416 1 1 /* 2 * sys_exit.c : Terminate the calling process.2 * sys_exit.c - Kernel function implementing the "exit" system call. 3 3 * 4 4 * Author Alain Greiner (2016,2017) … … 38 38 uint32_t save_sr; // required to enable IRQs 39 39 40 thread_t * this = CURRENT_THREAD; 41 pid_t pid = this->process->pid; 42 40 43 #if CONFIG_SYSCALL_DEBUG 41 44 uint64_t tm_start; 42 45 uint64_t tm_end; 43 46 tm_start = hal_get_cycles(); 47 printk("\n[DBG] %s : core[%x,%d] enter / process %x / status %x / cycle %d\n", 48 __FUNCTION__ , local_cxy , this->core->lid , pid , status , (uint32_t)tm_start ); 44 49 #endif 45 50 46 thread_t * this = CURRENT_THREAD;47 process_t * process = this->process;48 49 51 // get owner process cluster 50 cxy_t owner_cxy = CXY_FROM_PID( p rocess->pid );52 cxy_t owner_cxy = CXY_FROM_PID( pid ); 51 53 52 54 // enable IRQs … … 56 58 if( local_cxy == owner_cxy ) // owner is local 57 59 { 58 process_make_exit( p rocess, status );60 process_make_exit( pid , status ); 59 61 } 60 62 else // owner is remote 61 63 { 62 rpc_process_make_exit_client( owner_cxy, p rocess, status );64 rpc_process_make_exit_client( owner_cxy, pid , status ); 63 65 } 64 66 … … 70 72 #if CONFIG_SYSCALL_DEBUG 71 73 tm_end = hal_get_cycles(); 72 syscall_dmsg("\n[DBG] %s exit : core[%x,%d] / thread %x in process %x / cycle %d\n" 73 "process %x killed / cost = %d\n", 74 __FUNCTION__ , local_cxy , this->core->lid , this->trdid , this->process->pid , 75 tm_start , pid , (uint32_t)(tm_end - tm_start) ); 74 printk("\n[DBG] %s : core[%x,%d] exit / process %x / status %x / cost = %d\n", 75 __FUNCTION__ , local_cxy , this->core->lid , pid , status , (uint32_t)(tm_end - tm_start) ); 76 76 #endif 77 77
Note: See TracChangeset
for help on using the changeset viewer.