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

Go to the source code of this file.

Defines

#define DECL_MUTEX_VARS()
#define RAW_TEST_AND_SET(_RELOP_, _val)
#define RAW_SPINLOCK(_RELOP_, _val)
#define SET_HIT

Typedefs

typedef eaddr_t mutex_ea_t

Functions

static void _lock_init (eaddr_t ea)
static void _spin_lock (eaddr_t ea)

Define Documentation

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

Referenced by _lock_init(), _mutex_trylock(), _read_lock(), _read_trylock(), _read_unlock(), _spin_lock(), _write_lock(), _write_trylock(), and _write_unlock().

#define RAW_SPINLOCK (   _RELOP_,
  _val 
)
Value:
ea64.ull = ALIGN128_EA(ea);                                     \
    offset = OFFSET128_EA_U32(ea);                              \
    do {                                                        \
        MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);       \
        spu_readch(MFC_RdAtomicStat);                           \
        SET_HIT;                                                \
        status = 1;                                             \
        if (likely(buf[offset] _RELOP_ 0)) {                    \
            buf[offset] += _val;                                \
            MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD);    \
            status = spu_readch(MFC_RdAtomicStat);              \
        }                                                       \
    } while (status != 0);

Referenced by _read_lock(), _spin_lock(), and _write_lock().

#define RAW_TEST_AND_SET (   _RELOP_,
  _val 
)
Value:
ea64.ull = ALIGN128_EA(ea);                                     \
    offset = OFFSET128_EA_U32(ea);                              \
    do {                                                        \
        MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);       \
        spu_readch(MFC_RdAtomicStat);                           \
        SET_HIT;                                                \
        if (likely(buf[offset] _RELOP_ 0)) {                    \
            buf[offset] += _val;                                \
            MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD);    \
            status = spu_readch(MFC_RdAtomicStat);              \
            ret_val = 1;                                        \
        } else {                                                \
            MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD);    \
            spu_readch(MFC_RdAtomicStat);                       \
            status = ret_val = 0;                               \
            break;                                              \
        }                                                       \
    } while (status != 0)

Referenced by _mutex_trylock(), _read_trylock(), and _write_trylock().

#define SET_HIT

Typedef Documentation


Function Documentation

static void _lock_init ( eaddr_t  ea) [inline, static]
static void _spin_lock ( eaddr_t  ea) [inline, static]

References DECL_MUTEX_VARS, and RAW_SPINLOCK.

Referenced by _mutex_lock().