aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-12-12 20:40:40 +0100
committerKarel Kočí <cynerd@email.cz>2017-12-12 20:40:40 +0100
commit44ba6f6121977e938432cfa5db340f5457ac344a (patch)
tree08ff07ba507d67648f5d18350b64c22d565227ef
parent535fe1cab28a630e311bcf82778f6d14f35c3ed0 (diff)
downloadqtmips-44ba6f6121977e938432cfa5db340f5457ac344a.tar.gz
qtmips-44ba6f6121977e938432cfa5db340f5457ac344a.tar.bz2
qtmips-44ba6f6121977e938432cfa5db340f5457ac344a.zip
Add AC_NONE to MemoryAccess::AccessControl
-rw-r--r--qtmips_machine/memory.cpp4
-rw-r--r--qtmips_machine/memory.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/qtmips_machine/memory.cpp b/qtmips_machine/memory.cpp
index fd1dbb4..3d711cc 100644
--- a/qtmips_machine/memory.cpp
+++ b/qtmips_machine/memory.cpp
@@ -57,6 +57,8 @@ std::uint32_t MemoryAccess::read_word(std::uint32_t offset) {
void MemoryAccess::write_ctl(enum MemoryAccess::AccessControl ctl, std::uint32_t offset, std::uint32_t value) {
switch (ctl) {
+ case AC_NONE:
+ break;
case AC_BYTE:
case AC_BYTE_UNSIGNED:
this->write_byte(offset, value);
@@ -75,6 +77,8 @@ void MemoryAccess::write_ctl(enum MemoryAccess::AccessControl ctl, std::uint32_t
std::uint32_t MemoryAccess::read_ctl(enum MemoryAccess::AccessControl ctl, std::uint32_t offset) {
switch (ctl) {
+ case AC_NONE:
+ return 0;
case AC_BYTE:
{
std::uint8_t b = this->read_byte(offset);
diff --git a/qtmips_machine/memory.h b/qtmips_machine/memory.h
index 90fda1b..7b14855 100644
--- a/qtmips_machine/memory.h
+++ b/qtmips_machine/memory.h
@@ -19,6 +19,7 @@ public:
std::uint32_t read_word(std::uint32_t offset);
enum AccessControl {
+ AC_NONE,
AC_BYTE,
AC_HALFWORD,
AC_WORD,