summaryrefslogtreecommitdiff
path: root/src/arch/sparc/faults.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-12-07 18:43:55 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-12-07 18:43:55 -0500
commit015873fa863bb5b84e3f6b826422007272e9921d (patch)
tree096eefc51afa6c1954c3f36c2b2ad3417a7ef3ce /src/arch/sparc/faults.cc
parent50b8cce355bc26a625e17a2651777340aa90a706 (diff)
downloadgem5-015873fa863bb5b84e3f6b826422007272e9921d.tar.xz
Change how Page Faults work in SPARC. It now prints the faulting address, and panics instead of fatals. This isn't technically what it should do, but it makes gdb stop at the panic rather than letting m5 exit.
--HG-- extra : convert_revision : 3b14c99edaf649e0809977c9579afb2b7b0d72e9
Diffstat (limited to 'src/arch/sparc/faults.cc')
-rw-r--r--src/arch/sparc/faults.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/arch/sparc/faults.cc b/src/arch/sparc/faults.cc
index 67920a3d1..4326e8b67 100644
--- a/src/arch/sparc/faults.cc
+++ b/src/arch/sparc/faults.cc
@@ -690,19 +690,21 @@ void PageTableFault::invoke(ThreadContext *tc)
{
Process *p = tc->getProcessPtr();
- // address is higher than the stack region or in the current stack region
- if (vaddr > p->stack_base || vaddr > p->stack_min)
- FaultBase::invoke(tc);
-
- // We've accessed the next page
- if (vaddr > p->stack_min - PageBytes) {
+ // We've accessed the next page of the stack, so extend the stack
+ // to cover it.
+ if(vaddr < p->stack_min && vaddr >= p->stack_min - PageBytes)
+ {
p->stack_min -= PageBytes;
- if (p->stack_base - p->stack_min > 8*1024*1024)
+ if(p->stack_base - p->stack_min > 8*1024*1024)
fatal("Over max stack size for one thread\n");
p->pTable->allocate(p->stack_min, PageBytes);
warn("Increasing stack size by one page.");
- } else {
- FaultBase::invoke(tc);
+ }
+ // Otherwise, we have an unexpected page fault. Report that fact,
+ // and what address was accessed to cause the fault.
+ else
+ {
+ panic("Page table fault when accessing virtual address %#x\n", vaddr);
}
}