19 #pragma comment (lib, "Ws2_32.lib") 24 #include <epicsInterrupt.h> 26 #define DATABUF_H_INC_LEVEL2 27 #include <epicsExport.h> 31 mrmBufRx::mrmBufRx(
const std::string& n,
volatile void *b,
unsigned int qdepth,
unsigned int bsize)
33 ,base((volatile unsigned char *)b)
51 int key=epicsInterruptLock();
59 epicsInterruptUnlock(key);
78 callbackGetUser(vptr,cb);
81 epicsUInt32 sts=
READ32(
self.
base, DataBufCtrl);
96 epicsUInt8 *buf=
self.getFree(&bsize);
105 errlogPrintf(
"Received data buffer with size %u >= %u\n", rsize, bsize);
111 errlogPrintf(
"buffer %s: size=%u %08x %08x %08x %08x\n",
112 self.
name().c_str(), rsize,
120 for(
unsigned int i=0; i<rsize; i+=4) {
123 self.receive(buf, rsize);
127 WRITE32(
self.
base, DataBufCtrl, sts|DataBufCtrl_rx);
128 }
catch(std::exception& e) {
129 epicsPrintf(
"exception in mrmBufRx::drainbuf callback: %s\n", e.what());
static void drainbuf(CALLBACK *)
#define BITCLR(ord, len, base, offset, mask)
virtual void dataRxEnable(bool) OVERRIDE FINAL
#define READ32(base, offset)
#define BE_READ32(base, offset)
#define DataBufCtrl_len_mask
#define DataBufCtrl_sumerr
mrmBufRx(const std::string &, volatile void *base, unsigned int qdepth, unsigned int bsize=0)
const std::string & name() const
#define BITSET(ord, len, base, offset, mask)
volatile unsigned char *const base
#define WRITE32(base, offset, value)
virtual bool dataRxEnabled() const OVERRIDE FINAL