31a32
> #include "cpu/base.hh"
33a35,36
> #include "mem/port.hh"
> #include "mem/translating_port.hh"
42,43c45,46
< ThreadState::ThreadState(int _cpuId, int _tid)
< : cpuId(_cpuId), tid(_tid), lastActivate(0), lastSuspend(0),
---
> ThreadState::ThreadState(BaseCPU *cpu, int _cpuId, int _tid)
> : baseCpu(cpu), cpuId(_cpuId), tid(_tid), lastActivate(0), lastSuspend(0),
44a48
> physPort(NULL), virtPort(NULL),
47,50c51,54
< ThreadState::ThreadState(int _cpuId, int _tid, Process *_process,
< short _asid, MemObject *mem)
< : cpuId(_cpuId), tid(_tid), lastActivate(0), lastSuspend(0),
< process(_process), asid(_asid),
---
> ThreadState::ThreadState(BaseCPU *cpu, int _cpuId, int _tid, Process *_process,
> short _asid)
> : baseCpu(cpu), cpuId(_cpuId), tid(_tid), lastActivate(0), lastSuspend(0),
> port(NULL), process(_process), asid(_asid),
110a115,141
> #else
> TranslatingPort *
> ThreadState::getMemPort()
> {
> if (port != NULL)
> return port;
>
> /* Use this port to for syscall emulation writes to memory. */
> Port *dcache_port, *func_mem_port;
> port = new TranslatingPort(csprintf("%s-%d-funcport",
> baseCpu->name(), tid),
> process->pTable, false);
>
> dcache_port = baseCpu->getPort("dcache_port");
> assert(dcache_port != NULL);
>
> MemObject *mem_object = dcache_port->getPeer()->getOwner();
> assert(mem_object != NULL);
>
> func_mem_port = mem_object->getPort("functional");
> assert(func_mem_port != NULL);
>
> func_mem_port->setPeer(port);
> port->setPeer(func_mem_port);
>
> return port;
> }