diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2011-09-09 01:01:43 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2011-09-09 01:01:43 -0700 |
commit | a1ad9e652a1a8b0b7d8c5dd2229324792010f6f3 (patch) | |
tree | 97577adc8e71a46e9d4b34d255c4fd84df3b88d0 /src/sim/process.cc | |
parent | f370ac5c186d063bd169c07ea89e1792617264cd (diff) | |
download | gem5-a1ad9e652a1a8b0b7d8c5dd2229324792010f6f3.tar.xz |
Stack: Tidy up some comments, a warning, and make stack extension consistent.
Do some minor cleanup of some recently added comments, a warning, and change
other instances of stack extension to be like what's now being done for x86.
Diffstat (limited to 'src/sim/process.cc')
-rw-r--r-- | src/sim/process.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/sim/process.cc b/src/sim/process.cc index bec33c70b..62b9b7002 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -329,29 +329,31 @@ Process::sim_fd_obj(int tgt_fd) } bool -Process::checkAndAllocNextPage(Addr vaddr) +Process::fixupStackFault(Addr vaddr) { - // if this is an initial write we might not have + // Check if this is already on the stack and there's just no page there + // yet. if (vaddr >= stack_min && vaddr < stack_base) { pTable->allocate(roundDown(vaddr, VMPageSize), VMPageSize); return true; } - // We've accessed the next page of the stack, so extend the stack - // to cover it. + // We've accessed the next page of the stack, so extend it to include + // this address. if (vaddr < stack_min && vaddr >= stack_base - max_stack_size) { while (vaddr < stack_min) { stack_min -= TheISA::PageBytes; - if(stack_base - stack_min > max_stack_size) + if (stack_base - stack_min > max_stack_size) fatal("Maximum stack size exceeded\n"); - if(stack_base - stack_min > 8*1024*1024) + if (stack_base - stack_min > 8 * 1024 * 1024) fatal("Over max stack size for one thread\n"); pTable->allocate(stack_min, TheISA::PageBytes); inform("Increasing stack size by one page."); }; return true; } - warn("Not increasing stack: requested vaddr is outside of stack range."); + warn("Not extending stack: address %#x isn't at the end of the stack.", + vaddr); return false; } |