summaryrefslogtreecommitdiff
path: root/cpu/exec_context.hh
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/exec_context.hh')
-rw-r--r--cpu/exec_context.hh9
1 files changed, 7 insertions, 2 deletions
diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh
index 08879b3b5..b47f5cd08 100644
--- a/cpu/exec_context.hh
+++ b/cpu/exec_context.hh
@@ -33,6 +33,7 @@
#include "mem/mem_req.hh"
#include "mem/functional_mem/functional_memory.hh"
#include "sim/serialize.hh"
+#include "targetarch/byte_swap.hh"
// forward declaration: see functional_memory.hh
class FunctionalMemory;
@@ -260,7 +261,11 @@ class ExecContext
cregs->lock_flag = true;
}
#endif
- return mem->read(req, data);
+
+ Fault error;
+ error = mem->read(req, data);
+ data = htoa(data);
+ return error;
}
template <class T>
@@ -309,7 +314,7 @@ class ExecContext
}
#endif
- return mem->write(req, data);
+ return mem->write(req, (T)htoa(data));
}
virtual bool misspeculating();