Ignore:
Timestamp:
Jul 18, 2015, 3:18:32 PM (9 years ago)
Author:
alain
Message:

Introduce two new atomic read-the-write functions, that can be used
to set or reset a bit field in a shared 32 bits word:

_atomic_or()
_atpmic_and()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_common/kernel_locks.h

    r523 r632  
    1313
    1414#include "hard_config.h"
     15
     16
     17//////////////////////////////////////////////////////////////////////////////
     18//      Atomic access functions using LL/SC instructions
     19//////////////////////////////////////////////////////////////////////////////
     20
     21extern unsigned int _atomic_increment( unsigned int* ptr,
     22                                       int  increment );
     23
     24extern void _atomic_or( unsigned int* ptr,
     25                        unsigned int  mask );
     26
     27extern void _atomic_and( unsigned int* ptr,
     28                         unsigned int  mask );
    1529
    1630//////////////////////////////////////////////////////////////////////////////
     
    3852    unsigned int padding[14];    // for 64 bytes alignment
    3953} spin_lock_t;
    40 
    41 extern unsigned int _atomic_increment( unsigned int* ptr,
    42                                        int  increment );
    4354
    4455extern void _spin_lock_init( spin_lock_t* lock );
Note: See TracChangeset for help on using the changeset viewer.