Ignore:
Timestamp:
May 29, 2018, 9:27:23 AM (6 years ago)
Author:
alain
Message:

Restructure the mini_libc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_thread_yield.c

    r421 r445  
    2222 */
    2323
     24#include <hal_types.h>
     25#include <hal_special.h>
    2426#include <scheduler.h>
     27#include <thread.h>
    2528
    2629int sys_thread_yield()
    2730{
     31 
     32#if DEBUG_SYS_THREAD_YIELD
     33uint64_t     tm_start;
     34uint64_t     tm_end;
     35tm_start = hal_get_cycles();
     36if( DEBUG_SYS_THREAD_YIELD < tm_start )
     37printk("\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
    2842        sched_yield("user request");
     43
     44#if DEBUG_SYS_THREAD_YIELD
     45tm_end = hal_get_cycles();
     46if( DEBUG_SYS_THREAD_YIELD < tm_start )
     47printk("\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
    2951        return 0;
    3052}
Note: See TracChangeset for help on using the changeset viewer.