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

    r189 r199  
    162162{
    163163    unsigned int buffer     = value;
    164     unsigned int timer_id   = _get_current_context_slot(CTX_TIMER_ID);
     164    unsigned int task_id    = _get_current_task_id();
     165    unsigned int timer_id   = _get_context_slot(task_id, CTX_TIMER_ID);
    165166    unsigned int cluster_id = timer_id / (NB_PROCS_MAX + NB_TIMERS_MAX);
    166167    unsigned int local_id   = timer_id % (NB_PROCS_MAX + NB_TIMERS_MAX);
     
    190191                          unsigned int* buffer )
    191192{
    192     unsigned int timer_id   = _get_current_context_slot(CTX_TIMER_ID);
     193    unsigned int task_id    = _get_current_task_id();
     194    unsigned int timer_id   = _get_context_slot(task_id, CTX_TIMER_ID);
    193195    unsigned int cluster_id = timer_id / (NB_PROCS_MAX + NB_TIMERS_MAX);
    194196    unsigned int local_id   = timer_id % (NB_PROCS_MAX + NB_TIMERS_MAX);
     
    232234//      _tty_error()
    233235////////////////////////////////////////////////////////////////////////////////
    234 void _tty_error()
    235 {
    236     unsigned int task_id = _get_current_task_id();
     236void _tty_error( unsigned int task_id )
     237{
    237238    unsigned int proc_id = _procid();
    238239
     
    259260    unsigned int        nwritten;
    260261
    261     unsigned int        tty_id = _get_current_context_slot(CTX_TTY_ID);
     262    unsigned int task_id  = _get_current_task_id();
     263    unsigned int tty_id   = _get_context_slot(task_id, CTX_TTY_ID);
     264
    262265    if ( tty_id >= NB_TTYS )
    263266    {
    264         _tty_error();
     267        _tty_error( task_id );
    265268        return 0;
    266269    }
     
    291294                            unsigned int        length)
    292295{
    293     unsigned int        tty_id = _get_current_context_slot(CTX_TTY_ID);
     296    unsigned int task_id  = _get_current_task_id();
     297    unsigned int tty_id   = _get_context_slot(task_id, CTX_TTY_ID);
    294298
    295299    if ( tty_id >= NB_TTYS )
    296300    {
    297         _tty_error();
     301        _tty_error( task_id );
    298302        return 0;
    299303    }
     
    320324                        unsigned int    length)
    321325{
    322     unsigned int        tty_id = _get_current_context_slot(CTX_TTY_ID);
     326    unsigned int task_id  = _get_current_task_id();
     327    unsigned int tty_id   = _get_context_slot(task_id, CTX_TTY_ID);
     328
    323329    if ( tty_id >= NB_TTYS )
    324330    {
    325         _tty_error();
     331        _tty_error( task_id );
    326332        return 0;
    327333    }
     
    544550
    545551    // get user space page table virtual address
    546     unsigned int user_pt_vbase = _get_current_context_slot(CTX_PTAB_ID);
     552    unsigned int task_id       = _get_current_task_id();
     553    unsigned int user_pt_vbase = _get_context_slot( task_id, CTX_PTAB_ID );
    547554   
    548555    user_vpn_min = user_vaddr >> 12;
     
    815822
    816823    // get DMA channel and compute DMA vbase address
    817     unsigned int        dma_id     = _get_current_context_slot(CTX_FBDMA_ID);
     824    unsigned int        task_id    = _get_current_task_id();
     825    unsigned int        dma_id     = _get_context_slot( task_id, CTX_FBDMA_ID );
    818826    unsigned int    cluster_id = dma_id / NB_DMAS_MAX;
    819827    unsigned int    loc_id     = dma_id % NB_DMAS_MAX;
     
    830838
    831839    // get user space page table virtual address
    832     unsigned int        user_ptab = _get_current_context_slot(CTX_PTAB_ID);
     840    unsigned int        user_ptab = _get_context_slot( task_id, CTX_PTAB_ID );
    833841
    834842    // compute frame buffer pbase address
     
    985993unsigned int _fb_completed()
    986994{
    987     unsigned int dma_id = _get_current_context_slot(CTX_FBDMA_ID);
     995    unsigned int task_id = _get_current_task_id();
     996    unsigned int dma_id  = _get_context_slot( task_id, CTX_FBDMA_ID );
    988997
    989998    // busy waiting with a pseudo random delay between bus access
Note: See TracChangeset for help on using the changeset viewer.