36 :
Rw11Rdma(pcntl, move(precb), move(postcb)),
80 uint16_t mode, uint32_t lba,
93 if (nwdone == 0)
return 0;
96 size_t nblk = (nwdone+bszwrd-1)/bszwrd;
97 size_t dsize = nblk*bszwrd;
99 std::vector<uint16_t> dbuf(dsize);
102 reinterpret_cast<uint8_t*
>(dbuf.data()), emsg);
103 if (!rc)
throw Rexception(
"Rw11RdmaDisk::WriteCheck()",
104 "VirtRead() failed: ", emsg);
106 uint16_t* pdsk = dbuf.data();
107 uint16_t* pmem =
fBuf.data();
108 for (
size_t i=0; i<nwdone; i++) {
109 if (*pdsk++ != *pmem++) {
125 os << bl << (text?text:
"--") <<
"Rw11RdmaDisk @ " <<
this << endl;
126 os << bl <<
" fBuf.size: " <<
RosPrintf(
fBuf.size(),
"d",5) << endl;
127 os << bl <<
" fpUnit: " <<
fpUnit << endl;
131 os << bl <<
" fFunc: " <<
fFunc << endl;
152 if (
fBuf.size() < tsize)
fBuf.resize(tsize);
166 reinterpret_cast<uint8_t*
>(
fBuf.data()), emsg);
167 if (!rc)
throw Rexception(
"Rw11RdmaDisk::PreRdmaHook()",
168 "VirtRead() failed: ", emsg);
177 if (nwdone == 0)
return;
181 size_t nblock = (nwdone+bszwrd-1)/bszwrd;
182 size_t npad = nblock*bszwrd - nwdone;
187 uint16_t* p =
fBuf.data()+nwdone;
188 for (
size_t i=0; i<npad; i++) *p++ = 0xdead;
193 reinterpret_cast<uint8_t*
>(
fBuf.data()), emsg);
194 if (!rc)
throw Rexception(
"Rw11RdmaDisk::PostRdmaHook()",
195 "VirtWrite() failed: ", emsg);
I/O appicator to generate fill characters.
void Inc(size_t ind, double val=1.)
FIXME_docs.
void Define(size_t ind, const std::string &name, const std::string &text)
FIXME_docs.
~Rw11RdmaDisk()
Destructor.
std::vector< uint16_t > fBuf
data buffer
Rw11UnitDisk * fpUnit
UnitDisk to read VirtDisk.
size_t fNWord
words to transfer
virtual void PreRdmaHook()
FIXME_docs.
size_t fNBlock
disk blocks to transfer
virtual void PostRdmaHook(size_t nwdone)
FIXME_docs.
void QueueDiskWrite(uint32_t addr, size_t size, uint16_t mode, uint32_t lba, Rw11UnitDisk *punit)
FIXME_docs.
void SetupDisk(size_t size, uint32_t lba, Rw11UnitDisk *punit, Rw11RdmaDisk::func func)
FIXME_docs.
@ kFuncWriteCheck
write check function
@ kFuncWrite
write function
@ kStatNWritePadded
padded disk write
@ kStatNWChkFail
write check failed
void QueueDiskWriteCheck(uint32_t addr, size_t size, uint16_t mode, uint32_t lba, Rw11UnitDisk *punit)
FIXME_docs.
Rw11RdmaDisk(Rw11Cntl *pcntl, precb_t &&precb, postcb_t &&postcb)
Constructor.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
size_t WriteCheck(size_t nwdone)
FIXME_docs.
void QueueDiskRead(uint32_t addr, size_t size, uint16_t mode, uint32_t lba, Rw11UnitDisk *punit)
FIXME_docs.
enum func fFunc
current function
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
std::function< void(int, size_t, RlinkCommandList &, size_t)> postcb_t
void QueueWMem(uint32_t addr, const uint16_t *block, size_t size, uint16_t mode)
FIXME_docs.
std::function< void(int, size_t, size_t, RlinkCommandList &)> precb_t
void QueueRMem(uint32_t addr, uint16_t *block, size_t size, uint16_t mode)
FIXME_docs.
bool VirtWrite(size_t lba, size_t nblk, const uint8_t *data, RerrMsg &emsg)
FIXME_docs.
size_t BlockSize() const
FIXME_docs.
bool VirtRead(size_t lba, size_t nblk, uint8_t *data, RerrMsg &emsg)
FIXME_docs.
RosPrintfS< bool > RosPrintf(bool value, const char *form=0, int width=0, int prec=0)
Creates a print object for the formatted output of a bool value.
Declaration of class ReventLoop.