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_common/kernel_locks.c

    r632 r709  
    7070        : "r" (ptr), "r" (mask)
    7171        : "$10", "$11", "$12", "memory" );
     72}
     73
     74/////////////////////////////////////////////////////
     75unsigned int _atomic_test_and_set( unsigned int* ptr,
     76                                   unsigned int  value )
     77{
     78    unsigned int ret = 1;
     79
     80    asm volatile (
     81        "ori  %0,    $0,     1         \n"   /* default : ret <= 1       */
     82        "move $10,   %1                \n"   /* $10 <= ptr               */
     83        "move $11,   %2                \n"   /* $11 <= value             */
     84        "ll   $12,   0($10)            \n"   /* $12 <= *ptr              */
     85        "bne  $12,   $0,     1515f     \n"   /* return 1 if non zero     */
     86        "sc   $11,   0($10)            \n"   /* *ptr <= $12              */
     87        "beqz $11,           1515f     \n"   /* return 1 if failure      */
     88        "ori  %0,    $0,     0         \n"   /* success : ret <= 0       */
     89        "1515:                         \n"   
     90        : "=r" (ret)
     91        : "r" (ptr), "r" (value)
     92        : "$10", "$11", "$12", "memory" );
     93
     94    return ret;
    7295}
    7396
Note: See TracChangeset for help on using the changeset viewer.