summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2005-02-25 18:01:19 -0500
committerKevin Lim <ktlim@umich.edu>2005-02-25 18:01:19 -0500
commitbb41c21d6ae3417cfcbfa1bb5ecc9efbae1950ab (patch)
tree89104e5d242908a1792850ec60b9e0510aa45e3c /arch
parent5c4714c1a91680a0253f866958a9db80cd8decb2 (diff)
parentd697721f570add1dce1d96f76df09e44bb4b7a99 (diff)
downloadgem5-bb41c21d6ae3417cfcbfa1bb5ecc9efbae1950ab.tar.xz
Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5 --HG-- extra : convert_revision : ba556bbc93275fcd920a0529383fd480bb7218de
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/alpha_memory.cc29
-rw-r--r--arch/alpha/isa_traits.hh3
2 files changed, 19 insertions, 13 deletions
diff --git a/arch/alpha/alpha_memory.cc b/arch/alpha/alpha_memory.cc
index 639abbeb8..8f6d7a51a 100644
--- a/arch/alpha/alpha_memory.cc
+++ b/arch/alpha/alpha_memory.cc
@@ -68,24 +68,27 @@ AlphaTLB::~AlphaTLB()
AlphaISA::PTE *
AlphaTLB::lookup(Addr vpn, uint8_t asn) const
{
- DPRINTF(TLB, "lookup %#x, asn %#x\n", vpn, (int)asn);
+ // assume not found...
+ AlphaISA::PTE *retval = NULL;
PageTable::const_iterator i = lookupTable.find(vpn);
- if (i == lookupTable.end())
- return NULL;
-
- while (i->first == vpn) {
- int index = i->second;
- AlphaISA::PTE *pte = &table[index];
- assert(pte->valid);
- if (vpn == pte->tag && (pte->asma || pte->asn == asn))
- return pte;
+ if (i != lookupTable.end()) {
+ while (i->first == vpn) {
+ int index = i->second;
+ AlphaISA::PTE *pte = &table[index];
+ assert(pte->valid);
+ if (vpn == pte->tag && (pte->asma || pte->asn == asn)) {
+ retval = pte;
+ break;
+ }
- ++i;
+ ++i;
+ }
}
- // not found...
- return NULL;
+ DPRINTF(TLB, "lookup %#x, asn %#x -> %s ppn %#x\n", vpn, (int)asn,
+ retval ? "hit" : "miss", retval ? retval->ppn : 0);
+ return retval;
}
diff --git a/arch/alpha/isa_traits.hh b/arch/alpha/isa_traits.hh
index bf184b875..9e286924b 100644
--- a/arch/alpha/isa_traits.hh
+++ b/arch/alpha/isa_traits.hh
@@ -179,6 +179,9 @@ static const Addr PageOffset = PageBytes - 1;
static StaticInstPtr<AlphaISA> decodeInst(MachInst);
+ // return a no-op instruction... used for instruction fetch faults
+ static const MachInst NoopMachInst;
+
enum annotes {
ANNOTE_NONE = 0,
// An impossible number for instruction annotations