GNU Radio 3.3.0 C++ API
atomic.h File Reference
#include <sync_utils.h>
#include <spu_mfcio.h>
Include dependency graph for spu_source/atomic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define DECL_ATOMIC_VARS()
#define ATOMIC_OP(__v, __val, __replace, __final_val)

Typedefs

typedef unsigned long long atomic_ea_t

Define Documentation

#define ATOMIC_OP (   __v,
  __val,
  __replace,
  __final_val 
)
Value:
{                                                               \
    char __tmp[256];                                            \
    char *_tmp = (char *) ALIGN(__tmp, 128);                    \
    volatile s32 *_buf = (volatile s32 *) &_tmp[0];             \
    u32 _size = 128, _tagid = 0;                                \
    s32 _status, _ret_val;                                      \
    u32 _offset;                                                \
    addr64 _ea64;                                               \
                                                                \
    _ea64.ull = ALIGN128_EA(__v);                               \
    _offset = OFFSET128_EA_U32(__v);                            \
    do {                                                        \
        MFC_DMA(_buf, _ea64, _size, _tagid, MFC_GETLLAR_CMD);   \
        spu_readch (MFC_RdAtomicStat);                          \
                                                                \
        _ret_val = _buf[_offset];                                \
        _buf[_offset] = (__replace) ? __val : _ret_val + __val;    \
        MFC_DMA(_buf, _ea64, _size, _tagid, MFC_PUTLLC_CMD);    \
        _status = spu_readch(MFC_RdAtomicStat);                  \
    } while (_status != 0);                                     \
                                                                \
    __final_val = _ret_val;                                     \
}

Referenced by _atomic_add(), _atomic_add_return(), _atomic_dec(), _atomic_dec_and_test(), _atomic_dec_return(), _atomic_inc(), _atomic_inc_return(), _atomic_set(), _atomic_sub(), _atomic_sub_and_test(), _atomic_sub_return(), and _mutex_unlock().

#define DECL_ATOMIC_VARS ( )
Value:
char _tmp[256];                                         \
    char *tmp = (char *) ALIGN(_tmp, 128);              \
    volatile s32 *buf = (volatile s32 *) &tmp[0];       \
    u32 size = 128, tagid = 0;                          \
    s32 ret_val;                                        \
    u32 offset;                                         \
    addr64 ea64

Referenced by _atomic_dec_if_positive(), and _atomic_read().


Typedef Documentation

typedef unsigned long long atomic_ea_t