#define __CPU_EXEC_CONTEXT_HH__
#include "config/full_system.hh"
-#include "mem/functional/functional.hh"
-#include "mem/mem_interface.hh"
-#include "mem/mem_req.hh"
+#include "mem/physical.hh"
+#include "mem/request.hh"
#include "sim/host.hh"
#include "sim/serialize.hh"
#include "targetarch/byte_swap.hh"
-class PhysicalMemory;
+class Memory;
class BaseCPU;
#if FULL_SYSTEM
int cpu_id;
System *system;
- FunctionalMemory *mem;
+ Memory *mem;
#if FULL_SYSTEM
AlphaITB *itb;
// look them up through the system pointer, but we'll leave them
// here for now for convenience
MemoryController *memctrl;
- PhysicalMemory *physmem;
+// PhysicalMemory *physmem;
Kernel::Binning *kernelBinning;
Kernel::Statistics *kernelStats;
AlphaITB *_itb, AlphaDTB *_dtb, FunctionalMemory *_dem);
#else
ExecContext(BaseCPU *_cpu, int _thread_num, System *_system,
- FunctionalMemory *_mem, Process *_process, int _asid);
+ Memory *_mem, Process *_process, int _asid);
#endif
virtual ~ExecContext();
int getInstAsid() { return regs.instAsid(); }
int getDataAsid() { return regs.dataAsid(); }
- Fault translateInstReq(MemReqPtr &req)
+ Fault translateInstReq(CpuRequestPtr &req)
{
return itb->translate(req);
}
- Fault translateDataReadReq(MemReqPtr &req)
+ Fault translateDataReadReq(CpuRequestPtr &req)
{
return dtb->translate(req, false);
}
- Fault translateDataWriteReq(MemReqPtr &req)
+ Fault translateDataWriteReq(CpuRequestPtr &req)
{
return dtb->translate(req, true);
}
int getInstAsid() { return asid; }
int getDataAsid() { return asid; }
- Fault translateInstReq(MemReqPtr &req)
+ Fault translateInstReq(CpuRequestPtr &req)
{
return process->pTable->translate(req);
}
- Fault translateDataReadReq(MemReqPtr &req)
+ Fault translateDataReadReq(CpuRequestPtr &req)
{
return process->pTable->translate(req);
}
- Fault translateDataWriteReq(MemReqPtr &req)
+ Fault translateDataWriteReq(CpuRequestPtr &req)
{
return process->pTable->translate(req);
}
#endif
template <class T>
- Fault read(MemReqPtr &req, T &data)
+ Fault read(CpuRequestPtr &req, T &data)
{
#if FULL_SYSTEM && defined(TARGET_ALPHA)
if (req->flags & LOCKED) {
#endif
Fault error;
- error = mem->read(req, data);
+ error = mem->prot_read(req->paddr, data, req->size);
data = gtoh(data);
return error;
}
template <class T>
- Fault write(MemReqPtr &req, T &data)
+ Fault write(CpuRequestPtr &req, T &data)
{
#if FULL_SYSTEM && defined(TARGET_ALPHA)
}
#endif
- return mem->write(req, (T)htog(data));
+ return mem->prot_write(req->paddr, (T)htog(data), req->size);
}
virtual bool misspeculating();
inst = new_inst;
}
- Fault instRead(MemReqPtr &req)
+ Fault instRead(CpuRequestPtr &req)
{
panic("instRead not implemented");
// return funcPhysMem->read(req, inst);
typedef Request* RequestPtr;
typedef CpuRequest* CpuRequestPtr;
+/** The request is a Load locked/store conditional. */
+const unsigned LOCKED = 0x001;
+/** The virtual address is also the physical address. */
+const unsigned PHYSICAL = 0x002;
+/** The request is an ALPHA VPTE pal access (hw_ld). */
+const unsigned VPTE = 0x004;
+/** Use the alternate mode bits in ALPHA. */
+const unsigned ALTMODE = 0x008;
+/** The request is to an uncacheable address. */
+const unsigned UNCACHEABLE = 0x010;
+/** The request should not cause a page fault. */
+const unsigned NO_FAULT = 0x020;
+
class Request
{
//@todo Make Accesor functions, make these private.
/** Destination address if this is a block copy. */
Addr copyDest;
+
+ uint32_t flags;
};
class CpuRequest : public Request