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/common.c

    r189 r199  
    324324    return _physical_read_access( &(psched->current) );
    325325}
     326////////////////////////////////////////////////////////////////////////////
     327//    _set_current_task_id()
     328// This function returns the index of the currently running task.
     329////////////////////////////////////////////////////////////////////////////
     330void _set_current_task_id( unsigned int value )
     331{
     332    static_scheduler_t*         psched = (static_scheduler_t*)_get_sched();
     333    _physical_write_access( &(psched->current), value );
     334}
    326335///////////////////////////////////////////////////////////////////////////////
    327 //    _get_current_context_slot()
    328 // This function returns the global TTY index for the currently running task.
     336//    _get_context_slot()
     337// This function returns a slot content for the task defined by task_id.
    329338///////////////////////////////////////////////////////////////////////////////
    330 unsigned int _get_current_context_slot(unsigned int slot_id)
    331 {
    332     static_scheduler_t*         psched = (static_scheduler_t*)_get_sched();
    333     unsigned int                        current = _physical_read_access( &(psched->current) );
    334     return _physical_read_access( &(psched->context[current][slot_id]) );
    335 }
    336 /////////////////////////////////////////////i//////////////////////////////////
     339unsigned int _get_context_slot( unsigned int task_id,
     340                                unsigned int slot_id )
     341{
     342    static_scheduler_t*         psched = (static_scheduler_t*)_get_sched();
     343    return _physical_read_access( &(psched->context[task_id][slot_id]) );
     344}
     345///////////////////////////////////////////////////////////////////////////////
     346//    _set_context_slot()
     347// This function returns a slot content for the task defined by task_id.
     348///////////////////////////////////////////////////////////////////////////////
     349void _set_context_slot( unsigned int task_id,
     350                        unsigned int slot_id,
     351                        unsigned int value )
     352{
     353    static_scheduler_t*         psched = (static_scheduler_t*)_get_sched();
     354    _physical_write_access( &(psched->context[task_id][slot_id]), value );
     355}
     356////////////////////////////////////////////////////////////////////////////////
    337357//    _get_interrupt_vector_entry()
    338358// This function returns the interrupt_vector entry defined by argument index.
     
    342362    static_scheduler_t*         psched = (static_scheduler_t*)_get_sched();
    343363    return _physical_read_access( &(psched->interrupt_vector[index]) );
    344 }
    345 ////////////////////////////////////////////////////////////////////////////
    346 //    _set_current_task_id()
    347 // This function returns the index of the currently running task.
    348 ////////////////////////////////////////////////////////////////////////////
    349 void _set_current_task_id( unsigned int value )
    350 {
    351     static_scheduler_t*         psched = (static_scheduler_t*)_get_sched();
    352     _physical_write_access( &(psched->current), value );
    353364}
    354365
Note: See TracChangeset for help on using the changeset viewer.