summaryrefslogtreecommitdiff
path: root/src/cpu/simple_thread.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-11-01 19:00:59 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-11-01 19:00:59 -0500
commitb565660c42cbf8f9ec9442cd6c0b7d488c7816af (patch)
treeaa977395b10e164190efdd5106da54a57bc23b44 /src/cpu/simple_thread.cc
parent8dbab9f701150cf93d33f2a21d6b556507f3d617 (diff)
parent9ef8bf74c7ab3d34889e804cb4b1e365da090d0b (diff)
downloadgem5-b565660c42cbf8f9ec9442cd6c0b7d488c7816af.tar.xz
Merge zizzer.eecs.umich.edu:/bk/newmem/
into zeep.eecs.umich.edu:/home/gblack/m5/newmemmemops --HG-- extra : convert_revision : c2f7398a0d14dd11108579bb243ada7420285a22
Diffstat (limited to 'src/cpu/simple_thread.cc')
-rw-r--r--src/cpu/simple_thread.cc38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc
index 95018ff8c..d4e5f8230 100644
--- a/src/cpu/simple_thread.cc
+++ b/src/cpu/simple_thread.cc
@@ -62,7 +62,7 @@ using namespace std;
SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
TheISA::ITB *_itb, TheISA::DTB *_dtb,
bool use_kernel_stats)
- : ThreadState(-1, _thread_num), cpu(_cpu), system(_sys), itb(_itb),
+ : ThreadState(_cpu, -1, _thread_num), cpu(_cpu), system(_sys), itb(_itb),
dtb(_dtb)
{
@@ -106,19 +106,10 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
}
#else
SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num,
- Process *_process, int _asid, MemObject* memobj)
- : ThreadState(-1, _thread_num, _process, _asid, memobj),
+ Process *_process, int _asid)
+ : ThreadState(_cpu, -1, _thread_num, _process, _asid),
cpu(_cpu)
{
- /* Use this port to for syscall emulation writes to memory. */
- Port *mem_port;
- port = new TranslatingPort(csprintf("%s-%d-funcport",
- cpu->name(), tid),
- process->pTable, false);
- mem_port = memobj->getPort("functional");
- mem_port->setPeer(port);
- port->setPeer(mem_port);
-
regs.clear();
tc = new ProxyThreadContext<SimpleThread>(this);
}
@@ -127,9 +118,9 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num,
SimpleThread::SimpleThread()
#if FULL_SYSTEM
- : ThreadState(-1, -1)
+ : ThreadState(NULL, -1, -1)
#else
- : ThreadState(-1, -1, NULL, -1, NULL)
+ : ThreadState(NULL, -1, -1, NULL, -1)
#endif
{
tc = new ProxyThreadContext<SimpleThread>(this);
@@ -332,6 +323,25 @@ SimpleThread::delVirtPort(VirtualPort *vp)
}
}
+#else
+TranslatingPort *
+SimpleThread::getMemPort()
+{
+ if (port != NULL)
+ return port;
+
+ /* Use this port to for syscall emulation writes to memory. */
+ Port *dcache_port;
+ port = new TranslatingPort(csprintf("%s-%d-funcport",
+ cpu->name(), tid),
+ process->pTable, false);
+ dcache_port = cpu->getPort("dcache_port");
+ assert(dcache_port != NULL);
+ dcache_port = dcache_port->getPeer();
+// mem_port->setPeer(port);
+ port->setPeer(dcache_port);
+ return port;
+}
#endif