diff options
Diffstat (limited to 'cpu/exec_context.hh')
-rw-r--r-- | cpu/exec_context.hh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh index 7be83539a..4f62fa6fa 100644 --- a/cpu/exec_context.hh +++ b/cpu/exec_context.hh @@ -32,6 +32,7 @@ #include "sim/host.hh" #include "mem/mem_req.hh" #include "sim/serialize.hh" +#include "targetarch/byte_swap.hh" // forward declaration: see functional_memory.hh class FunctionalMemory; @@ -256,7 +257,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> @@ -305,7 +310,7 @@ class ExecContext } #endif - return mem->write(req, data); + return mem->write(req, (T)htoa(data)); } virtual bool misspeculating(); |