vp = tc->getVirtPort();
vp->writeHtoG(addr, (uint32_t)((cpuFreq / intrFreq) * 0.9988));
- tc->delVirtPort(vp);
}
}
if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_comm", addr))
panic("thread info not compiled into kernel\n");
name_off = vp->readGtoH<int32_t>(addr);
-
- tc->delVirtPort(vp);
}
Addr
vp = tc->getVirtPort();
tsk = vp->readGtoH<Addr>(base + task_off);
- tc->delVirtPort(vp);
return tsk;
}
vp = tc->getVirtPort();
pd = vp->readGtoH<uint16_t>(task + pid_off);
- tc->delVirtPort(vp);
return pd;
}
VirtualPort *vp = tc->getVirtPort();
uint64_t arg = vp->read<uint64_t>(sp +
(number-NumArgumentRegs) * sizeof(uint64_t));
- tc->delVirtPort(vp);
return arg;
}
#else
vp = tc->getVirtPort();
vp->writeHtoG(addr, (uint32_t)((cpuFreq / intrFreq) * 0.9988));
- tc->delVirtPort(vp);
}
}
// if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_comm", addr))
// panic("thread info not compiled into kernel\n");
// name_off = vp->readGtoH<int32_t>(addr);
-
- tc->delVirtPort(vp);
}
Addr
vp = tc->getVirtPort();
tsk = vp->readGtoH<Addr>(base + task_off);
- tc->delVirtPort(vp);
return tsk;
}
vp = tc->getVirtPort();
pd = vp->readGtoH<uint16_t>(task + pid_off);
- tc->delVirtPort(vp);
return pd;
}
VirtualPort *vp = tc->getVirtPort();
uint64_t arg = vp->read<uint64_t>(sp +
(number-NumArgumentRegs) * sizeof(uint64_t));
- tc->delVirtPort(vp);
return arg;
}
#else
if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_comm", addr))
panic("thread info not compiled into kernel\n");
name_off = vp->readGtoH<int32_t>(addr);
-
- tc->delVirtPort(vp);
}
Addr
vp = tc->getVirtPort();
tsk = vp->readGtoH<Addr>(base + task_off);
- tc->delVirtPort(vp);
return tsk;
}
vp = tc->getVirtPort();
pd = vp->readGtoH<uint16_t>(task + pid_off);
- tc->delVirtPort(vp);
return pd;
}
VirtualPort *vp = tc->getVirtPort();
uint64_t arg = vp->read<uint64_t>(sp + 92 +
(number-NumArgumentRegs) * sizeof(uint64_t));
- tc->delVirtPort(vp);
return arg;
}
#else
if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_comm", addr))
panic("thread info not compiled into kernel\n");
name_off = vp->readGtoH<int32_t>(addr);
-
- tc->delVirtPort(vp);
}
Addr
vp = tc->getVirtPort();
tsk = vp->readGtoH<Addr>(base + task_off);
- tc->delVirtPort(vp);
return tsk;
}
vp = tc->getVirtPort();
pd = vp->readGtoH<uint16_t>(task + pid_off);
- tc->delVirtPort(vp);
return pd;
}
TranslatingPort *port = context->getMemPort();
#endif
port->readBlob(vaddr, (uint8_t*)data, size);
-#if FULL_SYSTEM
- context->delVirtPort(port);
-#endif
#if TRACING_ON
if (DTRACE(GDBRead)) {
TranslatingPort *port = context->getMemPort();
#endif
port->writeBlob(vaddr, (uint8_t*)data, size);
-#if FULL_SYSTEM
- context->delVirtPort(port);
-#else
+#if !FULL_SYSTEM
delete port;
#endif
FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); }
- VirtualPort *getVirtPort(ThreadContext *tc = NULL)
+ VirtualPort *getVirtPort()
{ return actualTC->getVirtPort(); }
-
- void delVirtPort(VirtualPort *vp) { actualTC->delVirtPort(vp); }
#else
TranslatingPort *getMemPort() { return actualTC->getMemPort(); }
virtual FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
- virtual VirtualPort *getVirtPort(ThreadContext *src_tc = NULL);
-
- void delVirtPort(VirtualPort *vp);
+ virtual VirtualPort *getVirtPort();
virtual void connectMemPorts(ThreadContext *tc) { thread->connectMemPorts(tc); }
#else
#if FULL_SYSTEM
template <class Impl>
VirtualPort *
-O3ThreadContext<Impl>::getVirtPort(ThreadContext *src_tc)
+O3ThreadContext<Impl>::getVirtPort()
{
- if (!src_tc)
- return thread->getVirtPort();
-
- VirtualPort *vp;
-
- vp = new VirtualPort("tc-vport", src_tc);
- thread->connectToMemFunc(vp);
- return vp;
+ return thread->getVirtPort();
}
template <class Impl>
thread->trapPending = false;
}
-#if FULL_SYSTEM
-template <class Impl>
-void
-O3ThreadContext<Impl>::delVirtPort(VirtualPort *vp)
-{
- if (vp != thread->getVirtPort()) {
- vp->removeConn();
- delete vp;
- }
-}
-#endif
-
template <class Impl>
void
O3ThreadContext<Impl>::activate(int delay)
FunctionalPort *getPhysPort() { return thread->getPhysPort(); }
- VirtualPort *getVirtPort(ThreadContext *tc = NULL)
- { return thread->getVirtPort(tc); }
-
- void delVirtPort(VirtualPort *vp);
+ VirtualPort *getVirtPort()
+ { return thread->getVirtPort(); }
#else
TranslatingPort *getMemPort() { return thread->getMemPort(); }
thread->setCpuId(id);
}
-#if FULL_SYSTEM
-template <class Impl>
-void
-OzoneCPU<Impl>::OzoneTC::delVirtPort(VirtualPort *vp)
-{
- vp->removeConn();
- delete vp;
-}
-#endif
-
template <class Impl>
void
OzoneCPU<Impl>::OzoneTC::setStatus(Status new_status)
TheISA::copyRegs(src_tc, tc);
}
-#if FULL_SYSTEM
-VirtualPort*
-SimpleThread::getVirtPort(ThreadContext *src_tc)
-{
- if (!src_tc)
- return virtPort;
-
- VirtualPort *vp = new VirtualPort("tc-vport", src_tc);
- connectToMemFunc(vp);
- return vp;
-}
-
-void
-SimpleThread::delVirtPort(VirtualPort *vp)
-{
- if (vp != virtPort) {
- vp->removeConn();
- delete vp;
- }
-}
-
-#endif
-
FunctionalPort *getPhysPort() { return physPort; }
- /** Return a virtual port. If no thread context is specified then a static
- * port is returned. Otherwise a port is created and returned. It must be
- * deleted by deleteVirtPort(). */
- VirtualPort *getVirtPort(ThreadContext *tc);
-
- void delVirtPort(VirtualPort *vp);
+ /** Return a virtual port. This port cannot be cached locally in an object.
+ * After a CPU switch it may point to the wrong memory object which could
+ * mean stale data.
+ */
+ VirtualPort *getVirtPort() { return virtPort; }
#endif
Status status() const { return _status; }
virtual FunctionalPort *getPhysPort() = 0;
- virtual VirtualPort *getVirtPort(ThreadContext *tc = NULL) = 0;
-
- virtual void delVirtPort(VirtualPort *vp) = 0;
+ virtual VirtualPort *getVirtPort() = 0;
virtual void connectMemPorts(ThreadContext *tc) = 0;
#else
FunctionalPort *getPhysPort() { return actualTC->getPhysPort(); }
- VirtualPort *getVirtPort(ThreadContext *tc = NULL) { return actualTC->getVirtPort(tc); }
-
- void delVirtPort(VirtualPort *vp) { return actualTC->delVirtPort(vp); }
+ VirtualPort *getVirtPort() { return actualTC->getVirtPort(); }
void connectMemPorts(ThreadContext *tc) { actualTC->connectMemPorts(tc); }
#else
void setPhysPort(FunctionalPort *port) { physPort = port; }
- VirtualPort *getVirtPort(ThreadContext *tc = NULL) { return virtPort; }
-
- void setVirtPort(VirtualPort *port) { virtPort = port; }
+ VirtualPort *getVirtPort() { return virtPort; }
#else
Process *getProcessPtr() { return process; }
VirtualPort *vp = tc->getVirtPort();
vp->readBlob(src, dst, cplen);
-
- tc->delVirtPort(vp);
-
}
void
VirtualPort *vp = tc->getVirtPort();
vp->writeBlob(dest, src, cplen);
-
- tc->delVirtPort(vp);
}
void
vp->readBlob(vaddr++, (uint8_t*)dst++, 1);
} while (len < maxlen && start[len++] != 0 );
- tc->delVirtPort(vp);
dst[len] = 0;
}
vp->writeBlob(gen.addr(), (uint8_t*)src, gen.size());
src += gen.size();
}
- tc->delVirtPort(vp);
}
VirtualPort *port = tc->getVirtPort();
port->readBlob(ptr, buffer, sizeof(T));
- tc->delVirtPort(port);
}
bool