summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2007-11-13 16:58:16 -0500
committerKorey Sewell <ksewell@umich.edu>2007-11-13 16:58:16 -0500
commit269259004943b80916ec9b6354f2fc00c811c88b (patch)
tree4a01b0300aef6692a787f85d42280a1dbdb086e6 /src/mem
parent422ab8bec0034a6b703578ec2c92350c6382875a (diff)
downloadgem5-269259004943b80916ec9b6354f2fc00c811c88b.tar.xz
Add in files from merge-bare-iron, get them compiling in FS and SE mode
--HG-- extra : convert_revision : d4e19afda897bc3797868b40469ce2ec7ec7d251
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/physical.cc4
-rw-r--r--src/mem/request.hh6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/mem/physical.cc b/src/mem/physical.cc
index 2f358daf2..4ea58e5e3 100644
--- a/src/mem/physical.cc
+++ b/src/mem/physical.cc
@@ -304,9 +304,13 @@ PhysicalMemory::doAtomicAccess(PacketPtr pkt)
void
PhysicalMemory::doFunctionalAccess(PacketPtr pkt)
{
+ warn("addr %#x >= %#x AND %#x <= %#x",
+ pkt->getAddr(), start(), pkt->getAddr() + pkt->getSize(), start() + size());
+
assert(pkt->getAddr() >= start() &&
pkt->getAddr() + pkt->getSize() <= start() + size());
+
uint8_t *hostAddr = pmemAddr + pkt->getAddr() - start();
if (pkt->cmd == MemCmd::ReadReq) {
diff --git a/src/mem/request.hh b/src/mem/request.hh
index e08593f0d..cc9c6b8bf 100644
--- a/src/mem/request.hh
+++ b/src/mem/request.hh
@@ -75,6 +75,8 @@ const uint32_t INST_READ = 0x80000;
/** This request is for a memory swap. */
const uint32_t MEM_SWAP = 0x100000;
const uint32_t MEM_SWAP_COND = 0x200000;
+/** The request should ignore unaligned access faults */
+const uint32_t NO_HALF_WORD_ALIGN_FAULT = 0x400000;
class Request : public FastAlloc
@@ -272,6 +274,10 @@ class Request : public FastAlloc
bool isCondSwap() { return (getFlags() & MEM_SWAP_COND) != 0; }
+ bool inline isMisaligned() {return (!(getFlags() & NO_ALIGN_FAULT) &&
+ ((vaddr & 1) ||
+ (!(getFlags() & NO_HALF_WORD_ALIGN_FAULT)
+ && (vaddr & 0x2))));}
friend class Packet;
};