diff options
-rw-r--r-- | src/cpu/base.hh | 10 | ||||
-rw-r--r-- | src/cpu/thread_state.cc | 6 | ||||
-rw-r--r-- | src/mem/fs_translating_port_proxy.cc | 2 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/cpu/base.hh b/src/cpu/base.hh index 1ca1ca10c..00373a655 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -161,6 +161,16 @@ class BaseCPU : public ClockedObject virtual MasterPort &getDataPort() = 0; /** + * Returns a sendFunctional delegate for use with port proxies. + */ + virtual PortProxy::SendFunctionalFunc + getSendFunctional() + { + MasterPort &port = getDataPort(); + return [&port](PacketPtr pkt)->void { port.sendFunctional(pkt); }; + } + + /** * Purely virtual method that returns a reference to the instruction * port. All subclasses must implement this method. * diff --git a/src/cpu/thread_state.cc b/src/cpu/thread_state.cc index dc4a624a7..cb9a87ca8 100644 --- a/src/cpu/thread_state.cc +++ b/src/cpu/thread_state.cc @@ -109,15 +109,15 @@ ThreadState::initMemProxies(ThreadContext *tc) assert(physProxy == NULL); // This cannot be done in the constructor as the thread state // itself is created in the base cpu constructor and the - // getDataPort is a virtual function - physProxy = new PortProxy(baseCpu->getDataPort(), + // getSendFunctional is a virtual function + physProxy = new PortProxy(baseCpu->getSendFunctional(), baseCpu->cacheLineSize()); assert(virtProxy == NULL); virtProxy = new FSTranslatingPortProxy(tc); } else { assert(virtProxy == NULL); - virtProxy = new SETranslatingPortProxy(baseCpu->getDataPort(), + virtProxy = new SETranslatingPortProxy(baseCpu->getSendFunctional(), process, SETranslatingPortProxy::NextPage); } diff --git a/src/mem/fs_translating_port_proxy.cc b/src/mem/fs_translating_port_proxy.cc index d12af13af..2ef48b098 100644 --- a/src/mem/fs_translating_port_proxy.cc +++ b/src/mem/fs_translating_port_proxy.cc @@ -55,7 +55,7 @@ #include "sim/system.hh" FSTranslatingPortProxy::FSTranslatingPortProxy(ThreadContext *tc) - : PortProxy(tc->getCpuPtr()->getDataPort(), + : PortProxy(tc->getCpuPtr()->getSendFunctional(), tc->getSystemPtr()->cacheLineSize()), _tc(tc) { } |