Ignore:
Timestamp:
Oct 1, 2015, 4:20:46 PM (9 years ago)
Author:
alain
Message:

Major release: Change the task model to implement the POSIX threads API.

  • The shell "exec" and "kill" commands can be used to activate/de-activate the applications.
  • The "pause", "resume", and "context" commands can be used to stop, restart, a single thtead or to display the thread context.

This version has been tested on the following multi-threaded applications,
that have been modified to use the POSIX threads:

  • classif
  • convol
  • transpose
  • gameoflife
  • raycast
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_kernel/exc_handler.c

    r629 r709  
    6161    unsigned int x          = cluster_xy >> Y_WIDTH;
    6262    unsigned int y          = cluster_xy & ((1<<Y_WIDTH)-1);
    63     unsigned int lpid       = gpid & ((1<<P_WIDTH)-1);
     63    unsigned int p          = gpid & ((1<<P_WIDTH)-1);
     64    unsigned int trdid      = _get_thread_trdid();
     65    unsigned int ltid       = _get_thread_ltid();
    6466
    65     unsigned int task       = _get_context_slot(CTX_LTID_ID);
    66 
     67    static_scheduler_t*  psched = (static_scheduler_t*)_get_sched();
    6768
    6869    const char * mips32_exc_str[] = { "strange unknown cause  ",
     
    7475                                      "reserved instruction   ",
    7576                                      "illegal coproc access  ",
    76                                       "arithmetic overflow    "};
     77                                      "arithmetic overflow    " };
    7778
    78     _printf("\n[GIET] Exception for task %d on processor[%d,%d,%d] at cycle %d\n"
     79    _printf("\n[GIET] Exception for thread %x on processor[%d,%d,%d] at cycle %d\n"
    7980            " - type      : %s\n"
    8081            " - EPC       : %x\n"
    8182            " - BVAR      : %x\n"
    82             "...Task desactivated\n",
    83             task, x, y, lpid, _get_proctime(),
     83            "...Thread desactivated\n",
     84            trdid , x , y , p , _get_proctime(),
    8485            mips32_exc_str[type], _get_epc(), _get_bvar() );
    8586
    86     // goes to sleeping state
    87     _set_context_slot( CTX_NORUN_ID , 1 );
     87    // register KILL signal
     88    _atomic_or( &psched->context[ltid].slot[CTX_SIGS_ID] , SIGS_MASK_KILL );
    8889
    89     // deschedule
     90    // deschedule calling thread
    9091    unsigned int save_sr; 
    9192    _it_disable( &save_sr );
Note: See TracChangeset for help on using the changeset viewer.