40using namespace std::placeholders;
186 std::bind(&
Rw11CntlRHRP::RdmaPreExecCB, this, _1, _2, _3, _4),
187 std::bind(&
Rw11CntlRHRP::RdmaPostExecCB, this, _1, _2, _3, _4))
190 for (
size_t i=0; i<
NUnit(); i++) {
225 "Bad state: started, no lam, not enable, not found");
274 uint16_t(1)<<
fLam,
this);
296 if (unit.
Type() !=
"off") {
322 uint16_t& aload, uint16_t& astart)
324 uint16_t kBOOT_START = 02000;
325 uint16_t bootcode[] = {
327 0012706, kBOOT_START,
328 0012700, uint16_t(unit),
330 0012761, 0000040, 0000010,
333 0012761, 0010000, 0000032,
334 0012761, 0177000, 0000002,
343 0012704, uint16_t(kBOOT_START+020),
350 code.insert(code.end(), std::begin(bootcode), std::end(bootcode));
352 astart = kBOOT_START+2;
363 os << bl << (text?text:
"--") <<
"Rw11CntlRHRP @ " <<
this << endl;
388 fRdma.
Dump(os, ind+2,
"fRdma: ", detail);
414 uint32_t addr = uint32_t(rpbae)<<16 | uint32_t(rpba);
420 uint32_t nwrd = (~uint32_t(rpwc)&0xffff) + 1;
424 throw Rexception(
"Rw11CntlRHRP::AttnHandler",
"Bad state: unum >= NUnit()");
430 uint32_t lba = unit.
Chs2Lba(ca,ta,sa);
435 static const char* fumnemo[32] =
436 {
"00 ",
"01 ",
"02 ",
"03 ",
"04 ",
"05 ",
"06 ",
"07 ",
437 "10 ",
"11 ",
"12 ",
"13 ",
"14 ",
"15 ",
"16 ",
"17 ",
438 "20 ",
"21 ",
"22 ",
"23 ",
"wc ",
"wch",
"26 ",
"27 ",
439 "wr ",
"wrh",
"32 ",
"33 ",
"rd ",
"rdh",
"36 ",
"37 "};
440 lmsg <<
"-I " <<
Name() <<
":"
441 <<
" fu=" << fumnemo[fu&037]
451 if (nwrd==65536) lmsg <<
" (0)";
else lmsg <<
RosPrintf(nwrd,
"d",5);
463 lmsg <<
"-E RHRP err "
472 bool ovr = lba + nblk > unit.
NBlock();
568 if (nwcok != ndone) {
579 if (clist.
Size() > ncmd) {
580 uint8_t ccode = clist[ncmd].Command();
581 uint16_t cdata = clist[ncmd].Data();
584 throw Rexception(
"Rw11CntlRHRP::RdmaPostExecCB",
585 "Bad state: Labo not found or missed abort");
586 if (cdata == 0)
return;
611 lmsg <<
"-I " <<
Name() <<
": err "
623 uint16_t rper1, uint16_t rpcs2)
633 uint16_t ba = addr & 0177776;
634 uint16_t bae = (addr>>16) & 077;
641 uint16_t wc =
fRd_rpwc + uint16_t(ndone);
660 if (rper1 || rpcs2) {
661 lmsg <<
"-I " <<
Name() <<
": err "
666 lmsg <<
"-I " <<
Name() << (rper1==0 ?
": ok " :
": err ")
size_t AddAttn()
FIXME_docs.
size_t Size() const
FIXME_docs.
size_t AddLabo()
FIXME_docs.
static const uint8_t kCmdLabo
command code list abort
void AddAttnHandler(attnhdl_t &&attnhdl, uint16_t mask, void *cdata=nullptr)
FIXME_docs.
void GetAttnInfo(AttnArgs &args, RlinkCommandList &clist)
FIXME_docs.
bool Exec(RlinkCommandList &clist, RerrMsg &emsg)
FIXME_docs.
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.
Implemenation (inline) of Rw11CntlBase.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
virtual size_t NUnit() const
FIXME_docs.
std::shared_ptr< Rw11UnitRHRP > fspUnit[NU]
static const uint16_t kRPCS1_B_BAE
virtual bool BootCode(size_t unit, std::vector< uint16_t > &code, uint16_t &aload, uint16_t &astart)
FIXME_docs.
static const uint16_t kFUNC_READ
func: read
uint16_t fRd_rpdc
Rdma: request rpdc.
static const uint16_t kRPCS1_M_TRE
static const uint16_t kRPCS1_V_RIDLY
static const uint16_t kProbeOff
probe address offset (rxcs2)
static const uint16_t kRPCS1_B_RIDLY
static const uint16_t kRPCS1_V_RUNIT
static const uint16_t kRPCS1_B_FUNC
static const uint16_t kRFUNC_WIDLY
rfunc: write idly
static const uint16_t kRPDA
RPDA reg offset.
static const uint16_t kRPDS_M_DPR
static const uint16_t kRPCS3_M_RSEEKDONE
static const uint16_t kRPDS_M_LBT
size_t fPC_rpcs3
PrimClist: rpcs3 index.
static const uint16_t kRPCS1_M_SC
uint16_t fRd_rpcs3
Rdma: request rpcs3.
static const bool kProbeRem
probr rem active
static const uint16_t kRPCS2_M_UNIT2
static const uint16_t kRPCS2_M_WCE
static const uint16_t kRPCS1_M_RATA
size_t fPC_rpba
PrimClist: rpba index.
static const uint16_t kRPDT
RPDT reg offset.
static const uint16_t kRPDS_M_ATA
static const uint16_t kRPDS_M_MOL
void RdmaPostExecCB(int stat, size_t ndone, RlinkCommandList &clist, size_t ncmd)
FIXME_docs.
static const uint16_t kRPDC
RPDC reg offset.
static const uint16_t kRPCS3_M_IE
static const uint16_t kRPBAE
RPBAE reg offset.
bool fRd_ovr
Rdma: overrun condition found.
static const uint16_t kRPCS1
RPCS1 reg offset.
static const uint16_t kRPER1_M_WLE
static const uint16_t kRPCS2_M_NEM
static const uint16_t kRPER1_M_ILF
static const uint16_t kRPER1_M_AOE
static const uint16_t kRPCS3
RPCS3 reg offset.
static const uint16_t kRPEC1
RPEC1 reg offset.
static const uint16_t kFUNC_WHD
func: write head&data
static const uint16_t kRPDC_B_CA
uint16_t fRd_rpda
Rdma: request rpda.
size_t fPC_cunit
PrimClist: copy unit.
static const uint16_t kRPDA_V_TA
static const uint16_t kFUNC_WRITE
func: write
static const int kLam
RHRP default lam.
static const uint16_t kRPCS1_M_RDY
static const uint16_t kRPCS1_V_BAE
static const uint16_t kRPDA_B_TA
virtual void Start()
FIXME_docs.
static const uint16_t kRPDS_M_DRY
static const uint16_t kRFUNC_DONE
rfunc: done (set rdy)
static const uint16_t kRPBA
RPBA reg offset.
static const uint16_t kRPCS2_B_UNIT
static const uint16_t kRPCS1_B_RUNIT
static const uint16_t kFUNC_WCHD
func: write chk head&data
static const uint16_t kRPCS2_M_PAT
static const uint16_t kRPCS2_M_OR
static const uint16_t kRFUNC_WUNIT
rfunc: write runit
~Rw11CntlRHRP()
Destructor.
static const bool kProbeInt
probe int active
static const uint16_t kRPDA_B_SA
uint16_t fRd_rpwc
Rdma: request rpwc.
static const uint16_t kRPMR1
RPMR1 reg offset.
static const uint16_t kRPCS2_M_NED
static const uint16_t kRPWC
RPWC reg offset.
static const uint16_t kRPCS3_M_RSEARDONE
static const uint16_t kRPLA
RPLA reg offset.
static const uint16_t kRPDS_M_VV
static const uint16_t kRxM14
MB reg 14 reg offset.
Rw11RdmaDisk fRdma
Rdma controller.
uint32_t fRd_nwrd
Rdma: current nwrd.
static const uint16_t kRPSN
RPSN reg offset.
void AddNormalExit(RlinkCommandList &clist, size_t ndone, uint16_t rper1=0, uint16_t rpcs2=0)
FIXME_docs.
static const uint16_t kRPCS2_M_RWCO
uint16_t fRd_fu
Rdma: request fu code.
static const uint16_t kRPER1_M_IAE
Rw11CntlRHRP()
Default constructor.
static const uint16_t kRPCS2_M_MXF
static const uint16_t kRPER1_M_RMR
uint16_t fRd_rpcs1
Rdma: request rpcs1.
static const uint16_t kRPDB
RPDB reg offset.
static const uint16_t kRPCS1_M_DVA
void Config(const std::string &name, uint16_t base, int lam)
FIXME_docs.
uint16_t fRd_rpbae
Rdma: request rpbae.
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
static const uint16_t kRPCS2_M_PGE
static const uint16_t kRPCS1_M_IE
size_t fPC_rpda
PrimClist: rpda index.
static const uint16_t kFUNC_RHD
func: read head&data
static const uint16_t kRFUNC_CUNIT
rfunc: copy funit->runit
uint16_t fRd_rpcs2
Rdma: request rpcs2.
static const uint16_t kIbaddr
RHRP default address.
static const uint16_t kRPDS_M_ERP
size_t fPC_rpcs1
PrimClist: rpcs1 index.
uint16_t fRd_rpds
Rdma: request rpds.
static const uint16_t kRPCS3_M_RPOREDONE
static const uint16_t kRxM15
MB reg 15 reg offset.
static const uint16_t kRPCS2_M_IR
static const uint16_t kRPCS1_V_FUNC
static const uint16_t kRPER1_M_UNS
static const uint16_t kRPCS1_M_GO
void AddErrorExit(RlinkCommandList &clist, uint16_t rper1)
FIXME_docs.
virtual void UnitSetup(size_t ind)
FIXME_docs.
static const uint16_t kRPCS2_M_CLR
static const uint16_t kRPDS
RPDS reg offset.
uint32_t fRd_addr
Rdma: current addr.
static const uint16_t kRPEC2
RPEC2 reg offset.
size_t fPC_rpcs2
PrimClist: rpcs2 index.
static const uint16_t kRPDS_M_OM
static const uint16_t kRPCS1_M_BAE
static const uint16_t kRPAS
RPAS reg offset.
static const uint16_t kRPCS3_M_RPACKDONE
size_t fPC_rpds
PrimClist: rpds index.
static const uint16_t kRPCS2_M_BAI
size_t fPC_rpbae
PrimClist: rpbae index.
static const uint16_t kRPOF
RPOF reg offset.
size_t fPC_rpwc
PrimClist: rpwc index.
void RdmaPreExecCB(int stat, size_t nwdone, size_t nwnext, RlinkCommandList &clist)
FIXME_docs.
uint32_t fRd_lba
Rdma: current lba.
size_t fPC_rpdc
PrimClist: rpdc index.
static const uint16_t kFUNC_WCD
func: write chk data
static const uint16_t kRPCS2
RPCS2 reg offset.
static const uint16_t kRxM13
MB reg 13 reg offset.
static const uint16_t kRPER1
RPER1 reg offset.
static const uint16_t kRPDS_M_WRL
int AttnHandler(RlinkServer::AttnArgs &args)
FIXME_docs.
uint16_t fRd_rpba
Rdma: request rpba.
int fLam
attn bit number (-1 of none)
uint32_t fTraceLevel
trace level; 0=off;1=cntl
RlinkCommandList fPrimClist
clist for attn primary info
uint16_t Base() const
FIXME_docs.
Rw11Probe fProbe
controller probe context
Rw11Cpu & Cpu() const
FIXME_docs.
void ConfigCntl(const std::string &name, uint16_t base, int lam, uint16_t probeoff, bool probeint, bool proberem)
FIXME_docs.
bool fStarted
true if Start() called
RlinkServer & Server() const
FIXME_docs.
const std::string & Name() const
FIXME_docs.
RlogFile & LogFile() const
FIXME_docs.
virtual void UnitSetupAll()
FIXME_docs.
uint16_t fBase
controller base address
void AllIAddrMapInsert(const std::string &name, uint16_t ibaddr)
FIXME_docs.
static const uint16_t kCPAH_M_22BIT
ena 22bit addressing
void ExecWibr(uint16_t ibaddr0, uint16_t data0, uint16_t ibaddr1=0, uint16_t data1=0, uint16_t ibaddr2=0, uint16_t data2=0)
FIXME_docs.
int AddWibr(RlinkCommandList &clist, uint16_t ibaddr, uint16_t data)
FIXME_docs.
int AddRibr(RlinkCommandList &clist, uint16_t ibaddr)
FIXME_docs.
void QueueDiskWrite(uint32_t addr, size_t size, uint16_t mode, uint32_t lba, Rw11UnitDisk *punit)
FIXME_docs.
void QueueDiskWriteCheck(uint32_t addr, size_t size, uint16_t mode, uint32_t lba, Rw11UnitDisk *punit)
FIXME_docs.
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.
bool IsActive() const
FIXME_docs.
@ kStatusBusyLast
last chunk to come
@ kStatusFailRdma
last rdma transfer failed
@ kStatusBusy
more chunks to come
size_t NCylinder() const
FIXME_docs.
bool WProt() const
FIXME_docs.
size_t NHead() const
FIXME_docs.
const std::string & Type() const
FIXME_docs.
uint32_t Chs2Lba(uint16_t cy, uint16_t hd, uint16_t se)
FIXME_docs.
size_t NBlock() const
FIXME_docs.
size_t NSector() const
FIXME_docs.
size_t BlockSize() const
FIXME_docs.
void Lba2Chs(uint32_t lba, uint16_t &cy, uint16_t &hd, uint16_t &se)
FIXME_docs.
uint32_t Nwrd2Nblk(uint32_t nwrd)
FIXME_docs.
void SetRpds(uint16_t rpds)
FIXME_docs.
uint16_t Rpds() const
FIXME_docs.
uint16_t Rpdt() const
FIXME_docs.
bool HasVirt() const
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.
bool Found() const
FIXME_docs.