diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2012-01-29 02:04:34 -0800 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2012-01-29 02:04:34 -0800 |
commit | dc0e629ea1f074691d307cde3ab7dd51a5e2102f (patch) | |
tree | 9ce01152dc0c5231748a2da03199096a87ec34f5 /src/arch/alpha/faults.cc | |
parent | 22a076a6d5b949db5595bbca530fe7db927f6367 (diff) | |
download | gem5-dc0e629ea1f074691d307cde3ab7dd51a5e2102f.tar.xz |
Implement Ali's review feedback.
Try to decrease indentation, and remove some redundant FullSystem checks.
Diffstat (limited to 'src/arch/alpha/faults.cc')
-rw-r--r-- | src/arch/alpha/faults.cc | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/src/arch/alpha/faults.cc b/src/arch/alpha/faults.cc index a6d3ef2d0..e4a5c9223 100644 --- a/src/arch/alpha/faults.cc +++ b/src/arch/alpha/faults.cc @@ -187,16 +187,17 @@ ItbPageFault::invoke(ThreadContext *tc, StaticInstPtr inst) { if (FullSystem) { ItbFault::invoke(tc); + return; + } + + Process *p = tc->getProcessPtr(); + TlbEntry entry; + bool success = p->pTable->lookup(pc, entry); + if (!success) { + panic("Tried to execute unmapped address %#x.\n", pc); } else { - Process *p = tc->getProcessPtr(); - TlbEntry entry; - bool success = p->pTable->lookup(pc, entry); - if (!success) { - panic("Tried to execute unmapped address %#x.\n", pc); - } else { - VAddr vaddr(pc); - tc->getITBPtr()->insert(vaddr.page(), entry); - } + VAddr vaddr(pc); + tc->getITBPtr()->insert(vaddr.page(), entry); } } @@ -205,19 +206,20 @@ NDtbMissFault::invoke(ThreadContext *tc, StaticInstPtr inst) { if (FullSystem) { DtbFault::invoke(tc, inst); + return; + } + + Process *p = tc->getProcessPtr(); + TlbEntry entry; + bool success = p->pTable->lookup(vaddr, entry); + if (!success) { + if (p->fixupStackFault(vaddr)) + success = p->pTable->lookup(vaddr, entry); + } + if (!success) { + panic("Tried to access unmapped address %#x.\n", (Addr)vaddr); } else { - Process *p = tc->getProcessPtr(); - TlbEntry entry; - bool success = p->pTable->lookup(vaddr, entry); - if (!success) { - if (p->fixupStackFault(vaddr)) - success = p->pTable->lookup(vaddr, entry); - } - if (!success) { - panic("Tried to access unmapped address %#x.\n", (Addr)vaddr); - } else { - tc->getDTBPtr()->insert(vaddr.page(), entry); - } + tc->getDTBPtr()->insert(vaddr.page(), entry); } } |