Make the cached virtPort have a thread context so it can do everything that a newly created one can.

This commit is contained in:
Ali Saidi 2008-07-01 10:24:16 -04:00
parent 9bd0bfe559
commit 50e3e50e1a
7 changed files with 13 additions and 13 deletions

View file

@ -788,7 +788,7 @@ FullO3CPU<Impl>::updateMemPorts()
// Update all ThreadContext's memory ports (Functional/Virtual
// Ports)
for (int i = 0; i < thread.size(); ++i)
thread[i]->connectMemPorts();
thread[i]->connectMemPorts(thread[i]->getTC());
}
#endif

View file

@ -98,7 +98,7 @@ class O3ThreadContext : public ThreadContext
void delVirtPort(VirtualPort *vp);
virtual void connectMemPorts() { thread->connectMemPorts(); }
virtual void connectMemPorts(ThreadContext *tc) { thread->connectMemPorts(tc); }
#else
virtual TranslatingPort *getMemPort() { return thread->getMemPort(); }

View file

@ -148,7 +148,7 @@ AtomicSimpleCPU::DcachePort::setPeer(Port *port)
#if FULL_SYSTEM
// Update the ThreadContext's memory ports (Functional/Virtual
// Ports)
cpu->tcBase()->connectMemPorts();
cpu->tcBase()->connectMemPorts(cpu->tcBase());
#endif
}

View file

@ -766,7 +766,7 @@ TimingSimpleCPU::DcachePort::setPeer(Port *port)
#if FULL_SYSTEM
// Update the ThreadContext's memory ports (Functional/Virtual
// Ports)
cpu->tcBase()->connectMemPorts();
cpu->tcBase()->connectMemPorts(cpu->tcBase());
#endif
}

View file

@ -134,7 +134,7 @@ class ThreadContext
virtual void delVirtPort(VirtualPort *vp) = 0;
virtual void connectMemPorts() = 0;
virtual void connectMemPorts(ThreadContext *tc) = 0;
#else
virtual TranslatingPort *getMemPort() = 0;
@ -325,7 +325,7 @@ class ProxyThreadContext : public ThreadContext
void delVirtPort(VirtualPort *vp) { return actualTC->delVirtPort(vp); }
void connectMemPorts() { actualTC->connectMemPorts(); }
void connectMemPorts(ThreadContext *tc) { actualTC->connectMemPorts(tc); }
#else
TranslatingPort *getMemPort() { return actualTC->getMemPort(); }

View file

@ -113,10 +113,10 @@ ThreadState::unserialize(Checkpoint *cp, const std::string &section)
#if FULL_SYSTEM
void
ThreadState::connectMemPorts()
ThreadState::connectMemPorts(ThreadContext *tc)
{
connectPhysPort();
connectVirtPort();
connectVirtPort(tc);
}
void
@ -134,7 +134,7 @@ ThreadState::connectPhysPort()
}
void
ThreadState::connectVirtPort()
ThreadState::connectVirtPort(ThreadContext *tc)
{
// @todo: For now this disregards any older port that may have
// already existed. Fix this memory leak once the bus port IDs
@ -143,7 +143,7 @@ ThreadState::connectVirtPort()
virtPort->removeConn();
else
virtPort = new VirtualPort(csprintf("%s-%d-vport",
baseCpu->name(), tid));
baseCpu->name(), tid), tc);
connectToMemFunc(virtPort);
}

View file

@ -91,11 +91,11 @@ struct ThreadState {
Tick readLastSuspend() { return lastSuspend; }
#if FULL_SYSTEM
void connectMemPorts();
void connectMemPorts(ThreadContext *tc);
void connectPhysPort();
void connectVirtPort();
void connectVirtPort(ThreadContext *tc);
void dumpFuncProfile();
@ -201,7 +201,7 @@ struct ThreadState {
FunctionalPort *physPort;
/** A functional port, outgoing only, for functional accesse to virtual
* addresses. That doen't require execution context information */
* addresses. */
VirtualPort *virtPort;
#else
TranslatingPort *port;