Changeset 683 for trunk/kernel/syscalls/sys_thread_wakeup.c
- Timestamp:
- Jan 13, 2021, 12:36:17 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_thread_wakeup.c
r637 r683 1 1 /* 2 * sys_thread_wakeup.c - wakeup indicated thread2 * sys_thread_wakeup.c - unblock indicated thread from the SLEEP condition 3 3 * 4 * Author Alain Greiner (2016,2017,2018,2019)4 * Author Alain Greiner (2016,2017,2018,2019,2020) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 27 27 #include <process.h> 28 28 #include <errno.h> 29 30 29 #include <syscalls.h> 31 30 … … 36 35 process_t * process = this->process; 37 36 38 #if (DEBUG_SYS_THREAD_WAKEUP || CONFIG_INSTRUMENTATION_SYSCALLS)39 uint64_ttm_start = hal_get_cycles();37 #if DEBUG_SYS_THREAD_WAKEUP || DEBUG_SYSCALLS_ERROR || CONFIG_INTRUMENTATION_SYSCALLS 38 cycle_t tm_start = hal_get_cycles(); 40 39 #endif 41 40 42 41 #if DEBUG_SYS_THREAD_WAKEUP 43 if( DEBUG_SYS_THREAD_WAKEUP < tm_start )44 printk("\n[%s] thread %x in processenter to activate thread %x / cycle %d\n",45 __FUNCTION__, this->trdid, process->pid, trdid, (uint32_t)tm_start );42 if( DEBUG_SYS_THREAD_WAKEUP < (uint32_t)tm_start ) 43 printk("\n[%s] thread[%x,%x] enter to activate thread %x / cycle %d\n", 44 __FUNCTION__, process->pid, this->trdid, trdid, (uint32_t)tm_start ); 46 45 #endif 47 46 … … 56 55 57 56 #if DEBUG_SYSCALLS_ERROR 58 printk("\n[ERROR] in %s : thread %x in process %x / illegal trdid argument %x\n", 59 __FUNCTION__, this->trdid, process->pid, trdid ); 57 if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 58 printk("\n[ERROR] in %s : thread[%x,%x] / illegal trdid argument %x\n", 59 __FUNCTION__, process->pid, this->trdid, trdid ); 60 60 #endif 61 61 this->errno = EINVAL; … … 70 70 71 71 #if DEBUG_SYSCALLS_ERROR 72 printk("\n[ERROR] in %s : thread %x in process %x cannot find thread %x/n", 73 __FUNCTION__ , this->trdid, process->pid, trdid ); 72 if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 73 printk("\n[ERROR] in %s : thread[%x,%x] / cannot find thread[%x,%x]\n", 74 __FUNCTION__, process->pid, this->trdid, process->pid, trdid ); 74 75 #endif 75 76 CURRENT_THREAD->errno = EINVAL; … … 77 78 } 78 79 80 // get target thread cluster and local pointer 81 thread_t * tgt_ptr = GET_PTR( thread_xp ); 82 cxy_t tgt_cxy = GET_CXY( thread_xp ); 83 84 // get state of the target thread alarm 85 bool_t linked = hal_remote_l32( XPTR( tgt_cxy , &tgt_ptr->alarm.linked ) ); 86 87 // delete the alarm if active 88 if( linked ) alarm_stop( thread_xp ); 89 79 90 // unblock target thread 80 thread_unblock( thread_xp , THREAD_BLOCKED_ GLOBAL);91 thread_unblock( thread_xp , THREAD_BLOCKED_SLEEP ); 81 92 82 93 #if (DEBUG_SYS_THREAD_WAKEUP || CONFIG_INSTRUMENTATION_SYSCALLS) … … 87 98 #if DEBUG_SYS_THREAD_WAKEUP 88 99 if( DEBUG_SYS_THREAD_WAKEUP < tm_end ) 89 printk("\n[%s] thread %x in process %x exit / thread %xactivated / cycle %d\n",90 __FUNCTION__ , this->trdid, process->pid, trdid, (uint32_t)tm_end );100 printk("\n[%s] thread[%x,%x] exit / thread[%x,%x] activated / cycle %d\n", 101 __FUNCTION__ , process->pid, this->trdid, process->pid, trdid, (uint32_t)tm_end ); 91 102 #endif 92 103
Note: See TracChangeset
for help on using the changeset viewer.