Ignore:
Timestamp:
Aug 9, 2012, 2:38:06 PM (12 years ago)
Author:
alain
Message:

Introducing the "idle" to improve the exit mechanism.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/sys/sys_handler.c

    r189 r199  
    7575void _exit()
    7676{
    77 /*
    7877    unsigned int date    = _proctime();
    79 
    8078    unsigned int proc_id = _procid();
    81 
    8279    unsigned int task_id = _get_current_task_id();
    8380
    8481     // print death message
    8582    _get_lock(&_tty_put_lock);
    86     _puts("\n\n!!! Exit task ");
    87     _putw( task_id );
     83    _puts("\n[GIET] Exit task ");
     84    _putd( task_id );
    8885    _puts(" on processor ");
    89     _putw( proc_id );
     86    _putd( proc_id );
    9087    _puts(" at cycle ");
    91     _putw( date );
     88    _putd( date );
    9289    _puts("\n\n");
    9390    _release_lock(&_tty_put_lock);
    94 */
    9591   
    96     /* infinite loop */
    97     while (1) asm volatile("nop");
     92    // goes to sleeping state
     93    _set_context_slot( task_id, CTX_RUN_ID, 0 );
     94   
     95    // deschedule
     96    _ctx_switch();
    9897}
    9998//////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.