From c27139c701e8e61056ebc2cf002c5aa129779c13 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Mon, 21 Jun 2004 00:58:30 -0400 Subject: start towards getting m5 endian compliant base/inifile.cc: Added mac os support and fixed a bug, on error we need to exit the child process not return base/intmath.hh: gcc on macos wanted a seperate function for the size_t type base/loader/elf_object.cc: I'm not sure why this works under linux because it seems to return the wrong value. base/stats/text.cc: added define/include for mac os x cpu/exec_context.hh: cpu/simple_cpu/simple_cpu.cc: added endian conversion code dev/alpha_console.cc: rather than accessing a charecter array of varying size depending on the access, lets actually do this properly. dev/alpha_console.hh: get rid of now nolonger used consoleData dev/disk_image.cc: We have to byte swap the data is some cases, added function to do that dev/ethertap.cc: added preproc directive for mac os --HG-- extra : convert_revision : 2b5685765cfa2844926d7397f363d2788e3d640a --- cpu/exec_context.hh | 9 +++++++-- cpu/simple_cpu/simple_cpu.cc | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'cpu') 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 @@ -305,7 +310,7 @@ class ExecContext } #endif - return mem->write(req, data); + return mem->write(req, (T)htoa(data)); } virtual bool misspeculating(); diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc index 617c91e68..655a5b3ea 100644 --- a/cpu/simple_cpu/simple_cpu.cc +++ b/cpu/simple_cpu/simple_cpu.cc @@ -701,6 +701,7 @@ SimpleCPU::tick() comInstEventQueue[0]->serviceEvents(numInst); // decode the instruction + inst = htoa(inst); StaticInstPtr si(inst); traceData = Trace::getInstRecord(curTick, xc, this, si, -- cgit v1.2.3