summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/base.hh1
-rw-r--r--cpu/cpu_exec_context.cc19
-rw-r--r--cpu/cpu_exec_context.hh1
-rw-r--r--cpu/simple/cpu.cc16
-rw-r--r--cpu/simple/cpu.hh5
5 files changed, 13 insertions, 29 deletions
diff --git a/cpu/base.hh b/cpu/base.hh
index 0866b49a7..79700c117 100644
--- a/cpu/base.hh
+++ b/cpu/base.hh
@@ -42,7 +42,6 @@ class System;
namespace Kernel { class Statistics; }
class BranchPred;
class ExecContext;
-class Port;
class BaseCPU : public SimObject
{
diff --git a/cpu/cpu_exec_context.cc b/cpu/cpu_exec_context.cc
index 79a4c00c6..0a3dc5675 100644
--- a/cpu/cpu_exec_context.cc
+++ b/cpu/cpu_exec_context.cc
@@ -28,6 +28,7 @@
#include <string>
+#include "arch/isa_traits.hh"
#include "cpu/base.hh"
#include "cpu/cpu_exec_context.hh"
#include "cpu/exec_context.hh"
@@ -269,22 +270,6 @@ CPUExecContext::regStats(const string &name)
void
CPUExecContext::copyArchRegs(ExecContext *xc)
{
- // First loop through the integer registers.
- for (int i = 0; i < TheISA::NumIntRegs; ++i) {
- setIntReg(i, xc->readIntReg(i));
- }
-
- // Then loop through the floating point registers.
- for (int i = 0; i < TheISA::NumFloatRegs; ++i) {
- setFloatRegBits(i, xc->readFloatRegBits(i));
- }
-
- // Copy misc. registers
- regs.miscRegs.copyMiscRegs(xc);
-
- // Lastly copy PC/NPC
- setPC(xc->readPC());
- setNextPC(xc->readNextPC());
- setNextNPC(xc->readNextNPC());
+ TheISA::copyRegs(xc, proxy);
}
diff --git a/cpu/cpu_exec_context.hh b/cpu/cpu_exec_context.hh
index 2a90e07d3..236619752 100644
--- a/cpu/cpu_exec_context.hh
+++ b/cpu/cpu_exec_context.hh
@@ -53,6 +53,7 @@ class MemoryController;
#else // !FULL_SYSTEM
#include "sim/process.hh"
+#include "mem/page_table.hh"
class TranslatingPort;
#endif // FULL_SYSTEM
diff --git a/cpu/simple/cpu.cc b/cpu/simple/cpu.cc
index b335944e9..ce690cd06 100644
--- a/cpu/simple/cpu.cc
+++ b/cpu/simple/cpu.cc
@@ -71,7 +71,7 @@
#include "arch/stacktrace.hh"
#include "arch/vtophys.hh"
#else // !FULL_SYSTEM
-#include "mem/memory.hh"
+#include "mem/mem_object.hh"
#endif // FULL_SYSTEM
using namespace std;
@@ -152,13 +152,13 @@ SimpleCPU::SimpleCPU(Params *p)
_status = Idle;
//Create Memory Ports (conect them up)
- p->mem->addPort("DCACHE");
- dcachePort.setPeer(p->mem->getPort("DCACHE"));
- (p->mem->getPort("DCACHE"))->setPeer(&dcachePort);
+ Port *mem_dport = p->mem->getPort();
+ dcachePort.setPeer(mem_dport);
+ mem_dport->setPeer(&dcachePort);
- p->mem->addPort("ICACHE");
- icachePort.setPeer(p->mem->getPort("ICACHE"));
- (p->mem->getPort("ICACHE"))->setPeer(&icachePort);
+ Port *mem_iport = p->mem->getPort();
+ icachePort.setPeer(mem_iport);
+ mem_iport->setPeer(&icachePort);
#if FULL_SYSTEM
cpuXC = new CPUExecContext(this, 0, p->system, p->itb, p->dtb, p->mem);
@@ -1128,7 +1128,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(SimpleCPU)
Param<int> cpu_id;
Param<Tick> profile;
#else
- SimObjectParam<Memory *> mem;
+ SimObjectParam<MemObject *> mem;
SimObjectParam<Process *> workload;
#endif // FULL_SYSTEM
diff --git a/cpu/simple/cpu.hh b/cpu/simple/cpu.hh
index c1cf7ce96..dc07027f9 100644
--- a/cpu/simple/cpu.hh
+++ b/cpu/simple/cpu.hh
@@ -46,7 +46,7 @@
class Processor;
class AlphaITB;
class AlphaDTB;
-class Memory;
+class MemObject;
class RemoteGDB;
class GDBListener;
@@ -58,7 +58,6 @@ class Process;
#endif // FULL_SYSTEM
class ExecContext;
-class MemInterface;
class Checkpoint;
namespace Trace {
@@ -182,7 +181,7 @@ class SimpleCPU : public BaseCPU
AlphaITB *itb;
AlphaDTB *dtb;
#else
- Memory *mem;
+ MemObject *mem;
Process *process;
#endif
};