42using namespace std::placeholders;
153 std::bind(&
Rw11CntlRK11::RdmaPreExecCB, this, _1, _2, _3, _4),
154 std::bind(&
Rw11CntlRK11::RdmaPostExecCB, this, _1, _2, _3, _4))
157 for (
size_t i=0; i<
NUnit(); i++) {
193 "Bad state: started, no lam, not enable, not found");
219 uint16_t(1)<<
fLam,
this);
251 uint16_t& aload, uint16_t& astart)
253 uint16_t kBOOT_START = 02000;
254 uint16_t bootcode[] = {
256 0012706, kBOOT_START,
257 0012700, uint16_t(unit),
272 0012704, uint16_t(kBOOT_START+020),
281 code.insert(code.end(), std::begin(bootcode), std::end(bootcode));
283 astart = kBOOT_START+2;
294 os << bl << (text?text:
"--") <<
"Rw11CntlRK11 @ " <<
this << endl;
295 os << bl <<
" fPC_rkwc: " <<
fPC_rkwc << endl;
296 os << bl <<
" fPC_rkba: " <<
fPC_rkba << endl;
297 os << bl <<
" fPC_rkda: " <<
fPC_rkda << endl;
298 os << bl <<
" fPC_rkmr: " <<
fPC_rkmr << endl;
299 os << bl <<
" fPC_rkcs: " <<
fPC_rkcs << endl;
300 os << bl <<
" fRd_rkcs: " <<
fRd_rkcs << endl;
301 os << bl <<
" fRd_rkda: " <<
fRd_rkda << endl;
302 os << bl <<
" fRd_addr: " <<
fRd_addr << endl;
303 os << bl <<
" fRd_lba: " <<
fRd_lba << endl;
304 os << bl <<
" fRd_nwrd: " <<
fRd_nwrd << endl;
305 os << bl <<
" fRd_fu: " <<
fRd_fu << endl;
307 fRdma.
Dump(os, ind+2,
"fRdma: ", detail);
334 uint32_t addr = uint32_t(mex)<<16 | uint32_t(rkba);
337 uint32_t nwrd = (~uint32_t(rkwc)&0xffff) + 1;
341 lmsg <<
"-I " <<
Name() <<
":"
343 <<
" go=0, spurious attn, dropped";
349 throw Rexception(
"Rw11CntlRK11::AttnHandler",
"Bad state: dr > NUnit()");
355 uint32_t lba = unit.
Chs2Lba(cy,hd,se);
359 uint16_t rkds = unit.
Rkds();
363 static const char* fumnemo[8] = {
"cr",
"w ",
"r ",
"wc",
"sk",
"rc",
"dr",
"wl"};
365 lmsg <<
"-I " <<
Name() <<
":"
369 <<
" fu=" << fumnemo[fu&0x7]
381 lmsg <<
"-E " <<
Name() <<
": err"
413 bool ovr = lba + nblk > unit.
NBlock();
541 if (nwcok != ndone) {
553 if (clist.
Size() > ncmd) {
554 uint8_t ccode = clist[ncmd].Command();
555 uint16_t cdata = clist[ncmd].Data();
557 throw Rexception(
"Rw11CntlRK11::RdmaPostExecCB",
558 "Bad state: Labo not found or missed abort");
559 if (cdata == 0)
return;
576 lmsg <<
"-E " <<
Name() <<
": er=" <<
RosPrintBvi(rker,8) <<
" ERROR ABORT";
607 uint16_t ba = addr & 0177776;
608 uint16_t mex = (addr>>16) & 03;
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< Rw11UnitRK11 > fspUnit[NU]
static const uint16_t kRKDA_M_SUR
static const uint16_t kFUNC_CRESET
static const uint16_t kRKER_M_CSE
static const uint16_t kRKER_M_OVR
static const bool kProbeInt
probe int active
bool fRd_ovr
Rdma: overrun condition found.
void Config(const std::string &name, uint16_t base, int lam)
FIXME_docs.
static const uint16_t kRKDS_M_WPS
WPS: write protect.
static const uint16_t kRKDS_M_ID
ID: drive number.
static const uint16_t kRKMR_V_RID
static const uint16_t kRKMR_M_SBCLR
Rw11CntlRK11()
Default constructor.
static const uint16_t kRKCS_M_MAINT
uint16_t fRd_fu
Rdma: request fu code.
static const uint16_t kRKDS_M_DRY
DRY: drive ready.
static const uint16_t kRKER_M_WCE
virtual void UnitSetup(size_t ind)
FIXME_docs.
static const uint16_t kFUNC_WLOCK
static const uint16_t kRKER_M_NXC
static const uint16_t kRKBA
RKBA reg offset.
static const uint16_t kRKDS_B_ID
static const uint16_t kFUNC_RCHK
size_t fPC_rkwc
PrimClist: rkwc index.
static const uint16_t kRKER_M_PGE
void RdmaPreExecCB(int stat, size_t nwdone, size_t nwnext, RlinkCommandList &clist)
FIXME_docs.
static const uint16_t kRKDA_B_SC
static const uint16_t kRKMR
RKMR reg offset.
void LogRker(uint16_t rker)
FIXME_docs.
static const uint16_t kRKDA
RKDA reg offset.
static const uint16_t kRKDA_V_SUR
static const uint16_t kRKDS_M_SIN
SIN: seek incomplete.
void RdmaPostExecCB(int stat, size_t ndone, RlinkCommandList &clist, size_t ncmd)
FIXME_docs.
static const uint16_t kRKCS_M_FMT
static const uint16_t kRKMR_M_CRESET
static const bool kProbeRem
probr rem active
static const uint16_t kRKWC
RKWC reg offset.
size_t fPC_rkmr
PrimClist: rkmr index.
static const uint16_t kRKDS_M_ADRY
ADRY: access ready.
@ kStatNFuncWlock
func WLOCK
@ kStatNFuncDreset
func DRESET
@ kStatNFuncWrite
func WRITE
@ kStatNFuncRead
func READ
@ kStatNFuncRchk
func RCHK
@ kStatNFuncCreset
func CRESET
@ kStatNFuncSeek
func SEEK
@ kStatNFuncWchk
func WCHK
static const uint16_t kRKMR_M_CRDONE
static const int kLam
RK11 default lam.
static const uint16_t kRKDA_M_CYL
static const uint16_t kRKER_M_DRE
static const uint16_t kRKDS_M_DRU
DRU: drive unsafe.
static const uint16_t kRKDS_V_ID
static const uint16_t kRKCS_M_IBA
static const uint16_t kRKDS_M_HDEN
HDEN: high density drv.
static const uint16_t kRKMR_M_RID
size_t fPC_rkba
PrimClist: rkba index.
uint32_t fRd_addr
Rdma: current addr.
static const uint16_t kRKCS_V_MEX
int AttnHandler(RlinkServer::AttnArgs &args)
FIXME_docs.
static const uint16_t kRKCS_B_FUNC
static const uint16_t kRKCS_M_MEX
uint32_t fRd_nwrd
Rdma: current nwrd.
static const uint16_t kRKCS_B_MEX
static const uint16_t kRKDA_B_CYL
static const uint16_t kRKDA_V_DRSEL
static const uint16_t kRKCS_M_RDY
static const uint16_t kRKDA_V_CYL
static const uint16_t kRKCS
RKCS reg offset.
~Rw11CntlRK11()
Destructor.
static const uint16_t kRKER
RKER reg offset.
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
virtual void Start()
FIXME_docs.
static const uint16_t kRKER_M_NXD
void AddNormalExit(RlinkCommandList &clist, size_t ndone, uint16_t rker=0)
FIXME_docs.
static const uint16_t kFUNC_SEEK
uint32_t fRd_lba
Rdma: current lba.
uint16_t fRd_rkcs
Rdma: request rkcs.
static const uint16_t kFUNC_DRESET
static const uint16_t kRKDA_B_SUR
static const uint16_t kRKER_M_WLO
static const uint16_t kRKDA_M_DRSEL
static const uint16_t kFUNC_WRITE
static const uint16_t kProbeOff
probe address offset (rkcs)
void AddErrorExit(RlinkCommandList &clist, uint16_t rker)
FIXME_docs.
static const uint16_t kRKCS_M_RWA
static const uint16_t kRKCS_V_FUNC
static const uint16_t kIbaddr
RK11 default address.
uint16_t fRd_rkda
Rdma: request rkda.
static const uint16_t kRKCS_M_GO
static const uint16_t kRKER_M_NXM
static const uint16_t kRKDA_B_DRSEL
static const uint16_t kRKDS
RKDS reg offset.
static const uint16_t kRKDS_B_SC
SC: sector counter.
static const uint16_t kRKMR_M_FDONE
virtual void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
static const uint16_t kRKCS_M_SSE
size_t fPC_rkda
PrimClist: rkda index.
static const uint16_t kFUNC_WCHK
static const uint16_t kRKER_M_NXS
static const uint16_t kRKDS_M_SOK
SOK: sector counter OK.
Rw11RdmaDisk fRdma
Rdma controller.
size_t fPC_rkcs
PrimClist: rkcs index.
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.
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.
static const uint16_t kCPAH_M_UBM22
ubmap+22bit
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.
void SetWProt(bool wprot)
FIXME_docs.
bool WProt() 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 SetRkds(uint16_t rkds)
FIXME_docs.
uint16_t Rkds() 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.