Changeset 445 for trunk/kernel/syscalls/sys_thread_yield.c
- Timestamp:
- May 29, 2018, 9:27:23 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_thread_yield.c
r421 r445 22 22 */ 23 23 24 #include <hal_types.h> 25 #include <hal_special.h> 24 26 #include <scheduler.h> 27 #include <thread.h> 25 28 26 29 int sys_thread_yield() 27 30 { 31 32 #if DEBUG_SYS_THREAD_YIELD 33 uint64_t tm_start; 34 uint64_t tm_end; 35 tm_start = hal_get_cycles(); 36 if( DEBUG_SYS_THREAD_YIELD < tm_start ) 37 printk("\n[DBG] %s : thread %x deschedule / process %x / cycle %d\n", 38 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, (uint32_t)tm_start ); 39 #endif 40 41 // deschedule 28 42 sched_yield("user request"); 43 44 #if DEBUG_SYS_THREAD_YIELD 45 tm_end = hal_get_cycles(); 46 if( DEBUG_SYS_THREAD_YIELD < tm_start ) 47 printk("\n[DBG] %s : thread %x resume / process %x / cycle %d\n", 48 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, (uint32_t)tm_end ); 49 #endif 50 29 51 return 0; 30 52 }
Note: See TracChangeset
for help on using the changeset viewer.