w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
Rw11CntlRK11.hpp
Go to the documentation of this file.
1// $Id: Rw11CntlRK11.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-06-07 1160 2.0.2 RdmaStats() not longer const
8// 2017-04-02 865 2.0.1 Dump(): add detail arg
9// 2015-01-03 627 2.0 use Rw11RdmaDisk
10// 2014-12-29 623 1.1 adopt to Rlink V4 attn logic
11// 2014-06-14 562 1.0.1 Add stats definitions
12// 2013-04-20 508 1.0 Initial version
13// 2013-02-10 485 0.1 First draft
14// ---------------------------------------------------------------------------
15
16
21#ifndef included_Retro_Rw11CntlRK11
22#define included_Retro_Rw11CntlRK11 1
23
24#include "Rw11CntlBase.hpp"
25#include "Rw11UnitRK11.hpp"
26#include "Rw11RdmaDisk.hpp"
27
28namespace Retro {
29
30 class Rw11CntlRK11 : public Rw11CntlBase<Rw11UnitRK11,8> {
31 public:
32
35
36 void Config(const std::string& name, uint16_t base, int lam);
37
38 virtual void Start();
39
40 virtual bool BootCode(size_t unit, std::vector<uint16_t>& code,
41 uint16_t& aload, uint16_t& astart);
42
43 virtual void UnitSetup(size_t ind);
44
45 void SetChunkSize(size_t chunk);
46 size_t ChunkSize() const;
47
49
50 virtual void Dump(std::ostream& os, int ind=0, const char* text=0,
51 int detail=0) const;
52
53 // some constants (also defined in cpp)
54 static const uint16_t kIbaddr = 0177400;
55 static const int kLam = 4;
56
57 static const uint16_t kRKDS = 000;
58 static const uint16_t kRKER = 002;
59 static const uint16_t kRKCS = 004;
60 static const uint16_t kRKWC = 006;
61 static const uint16_t kRKBA = 010;
62 static const uint16_t kRKDA = 012;
63 static const uint16_t kRKMR = 014;
64
65 static const uint16_t kProbeOff = kRKCS;
66 static const bool kProbeInt = true;
67 static const bool kProbeRem = true;
68
69 static const uint16_t kRKDS_M_ID = 0160000;
70 static const uint16_t kRKDS_V_ID = 13;
71 static const uint16_t kRKDS_B_ID = 0007;
72 static const uint16_t kRKDS_M_HDEN = kWBit11;
73 static const uint16_t kRKDS_M_DRU = kWBit10;
74 static const uint16_t kRKDS_M_SIN = kWBit09;
75 static const uint16_t kRKDS_M_SOK = kWBit08;
76 static const uint16_t kRKDS_M_DRY = kWBit07;
77 static const uint16_t kRKDS_M_ADRY = kWBit06;
78 static const uint16_t kRKDS_M_WPS = kWBit05;
79 static const uint16_t kRKDS_B_SC = 0017;
80
81 static const uint16_t kRKER_M_DRE = kWBit15;
82 static const uint16_t kRKER_M_OVR = kWBit14;
83 static const uint16_t kRKER_M_WLO = kWBit13;
84 static const uint16_t kRKER_M_PGE = kWBit11;
85 static const uint16_t kRKER_M_NXM = kWBit10;
86 static const uint16_t kRKER_M_NXD = kWBit07;
87 static const uint16_t kRKER_M_NXC = kWBit06;
88 static const uint16_t kRKER_M_NXS = kWBit05;
89 static const uint16_t kRKER_M_CSE = kWBit01;
90 static const uint16_t kRKER_M_WCE = kWBit00;
91
92 static const uint16_t kRKCS_M_MAINT= kWBit12;
93 static const uint16_t kRKCS_M_IBA = kWBit11;
94 static const uint16_t kRKCS_M_FMT = kWBit10;
95 static const uint16_t kRKCS_M_RWA = kWBit09;
96 static const uint16_t kRKCS_M_SSE = kWBit08;
97 static const uint16_t kRKCS_M_RDY = kWBit07;
98 static const uint16_t kRKCS_M_MEX = 000060;
99 static const uint16_t kRKCS_V_MEX = 4;
100 static const uint16_t kRKCS_B_MEX = 0003;
101 static const uint16_t kRKCS_V_FUNC = 1;
102 static const uint16_t kRKCS_B_FUNC = 0007;
103 static const uint16_t kRKCS_M_GO = kWBit00;
104
105 static const uint16_t kFUNC_CRESET = 0;
106 static const uint16_t kFUNC_WRITE = 1;
107 static const uint16_t kFUNC_READ = 2;
108 static const uint16_t kFUNC_WCHK = 3;
109 static const uint16_t kFUNC_SEEK = 4;
110 static const uint16_t kFUNC_RCHK = 5;
111 static const uint16_t kFUNC_DRESET = 6;
112 static const uint16_t kFUNC_WLOCK = 7;
113
114 static const uint16_t kRKDA_M_DRSEL= 0160000;
115 static const uint16_t kRKDA_V_DRSEL= 13;
116 static const uint16_t kRKDA_B_DRSEL= 0007;
117 static const uint16_t kRKDA_M_CYL = 0017740;
118 static const uint16_t kRKDA_V_CYL = 5;
119 static const uint16_t kRKDA_B_CYL = 0377;
120 static const uint16_t kRKDA_M_SUR = 0000020;
121 static const uint16_t kRKDA_V_SUR = 4;
122 static const uint16_t kRKDA_B_SUR = 0001;
123 static const uint16_t kRKDA_B_SC = 0017;
124
125 static const uint16_t kRKMR_M_RID = 0160000;
126 static const uint16_t kRKMR_V_RID = 13;
127 static const uint16_t kRKMR_M_CRDONE= kWBit11;
128 static const uint16_t kRKMR_M_SBCLR = kWBit10;
129 static const uint16_t kRKMR_M_CRESET= kWBit09;
130 static const uint16_t kRKMR_M_FDONE = kWBit08;
131
132 // statistics counter indices
133 enum stats {
143 };
144
145 protected:
147 void RdmaPreExecCB(int stat, size_t nwdone, size_t nwnext,
148 RlinkCommandList& clist);
149 void RdmaPostExecCB(int stat, size_t ndone,
150 RlinkCommandList& clist, size_t ncmd);
151 void LogRker(uint16_t rker);
152 void AddErrorExit(RlinkCommandList& clist, uint16_t rker);
153 void AddNormalExit(RlinkCommandList& clist, size_t ndone,
154 uint16_t rker=0);
155
156 protected:
157 size_t fPC_rkwc;
158 size_t fPC_rkba;
159 size_t fPC_rkda;
160 size_t fPC_rkmr;
161 size_t fPC_rkcs;
162
163 uint16_t fRd_rkcs;
164 uint16_t fRd_rkda;
165 uint32_t fRd_addr;
166 uint32_t fRd_lba;
167 uint32_t fRd_nwrd;
168 uint16_t fRd_fu;
169 bool fRd_ovr;
171 };
172
173} // end namespace Retro
174
175#include "Rw11CntlRK11.ipp"
176
177#endif
static const uint16_t kWBit14
Definition: Rbits.hpp:46
static const uint16_t kWBit06
Definition: Rbits.hpp:38
static const uint16_t kWBit12
Definition: Rbits.hpp:44
static const uint16_t kWBit01
Definition: Rbits.hpp:33
static const uint16_t kWBit15
Definition: Rbits.hpp:47
static const uint16_t kWBit08
Definition: Rbits.hpp:40
static const uint16_t kWBit09
Definition: Rbits.hpp:41
static const uint16_t kWBit00
Definition: Rbits.hpp:32
static const uint16_t kWBit13
Definition: Rbits.hpp:45
static const uint16_t kWBit11
Definition: Rbits.hpp:43
static const uint16_t kWBit07
Definition: Rbits.hpp:39
static const uint16_t kWBit10
Definition: Rbits.hpp:42
static const uint16_t kWBit05
Definition: Rbits.hpp:37
FIXME_docs.
Definition: Rstats.hpp:28
Implemenation (inline) of Rw11CntlBase.
static const uint16_t kRKDA_M_SUR
static const uint16_t kFUNC_CRESET
Rstats & RdmaStats()
FIXME_docs.
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.
size_t ChunkSize() const
FIXME_docs.
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
void SetChunkSize(size_t chunk)
FIXME_docs.
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.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47