summaryrefslogtreecommitdiff
path: root/utils/regtools/qeditor/backend.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/regtools/qeditor/backend.h')
-rw-r--r--utils/regtools/qeditor/backend.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/regtools/qeditor/backend.h b/utils/regtools/qeditor/backend.h
index 64ba4c4922..2dba4e2b08 100644
--- a/utils/regtools/qeditor/backend.h
+++ b/utils/regtools/qeditor/backend.h
@@ -53,6 +53,8 @@ public:
53 * HW.dev.reg 53 * HW.dev.reg
54 * where <dev> is the device name (including index like APPUART1) 54 * where <dev> is the device name (including index like APPUART1)
55 * and <reg> is the register name (including index like PRIORITY29) */ 55 * and <reg> is the register name (including index like PRIORITY29) */
56 /* report whether backend is valid */
57 virtual bool IsValid() = 0;
56 /* report whether backend supports register access type */ 58 /* report whether backend supports register access type */
57 virtual bool SupportAccess(AccessType type) = 0; 59 virtual bool SupportAccess(AccessType type) = 0;
58 /* get SoC name */ 60 /* get SoC name */
@@ -83,6 +85,7 @@ class DummyIoBackend : public IoBackend
83public: 85public:
84 DummyIoBackend() {} 86 DummyIoBackend() {}
85 87
88 virtual bool IsValid() { return false; }
86 virtual bool SupportAccess(AccessType type) { Q_UNUSED(type); return false; } 89 virtual bool SupportAccess(AccessType type) { Q_UNUSED(type); return false; }
87 virtual QString GetSocName() { return ""; } 90 virtual QString GetSocName() { return ""; }
88 virtual bool ReadRegister(const QString& name, soc_word_t& value) 91 virtual bool ReadRegister(const QString& name, soc_word_t& value)
@@ -107,6 +110,7 @@ class FileIoBackend : public IoBackend
107public: 110public:
108 FileIoBackend(const QString& filename, const QString& soc_name = ""); 111 FileIoBackend(const QString& filename, const QString& soc_name = "");
109 112
113 virtual bool IsValid() { return m_valid; }
110 virtual bool SupportAccess(AccessType type) { return type == ByName; } 114 virtual bool SupportAccess(AccessType type) { return type == ByName; }
111 virtual QString GetSocName(); 115 virtual QString GetSocName();
112 virtual bool ReadRegister(const QString& name, soc_word_t& value); 116 virtual bool ReadRegister(const QString& name, soc_word_t& value);
@@ -126,6 +130,7 @@ protected:
126 QString m_soc; 130 QString m_soc;
127 bool m_readonly; 131 bool m_readonly;
128 bool m_dirty; 132 bool m_dirty;
133 bool m_valid;
129 QMap< QString, soc_word_t > m_map; 134 QMap< QString, soc_word_t > m_map;
130}; 135};
131 136
@@ -173,6 +178,7 @@ public:
173 HWStubIoBackend(HWStubDevice *dev); 178 HWStubIoBackend(HWStubDevice *dev);
174 virtual ~HWStubIoBackend(); 179 virtual ~HWStubIoBackend();
175 180
181 virtual bool IsValid() { return m_dev->IsValid(); }
176 virtual bool SupportAccess(AccessType type) { return type == ByAddress; } 182 virtual bool SupportAccess(AccessType type) { return type == ByAddress; }
177 virtual QString GetSocName(); 183 virtual QString GetSocName();
178 virtual bool ReadRegister(const QString& name, soc_word_t& value) 184 virtual bool ReadRegister(const QString& name, soc_word_t& value)