Deleted Added
sdiff udiff text old ( 2800:18a615ca6e19 ) new ( 3415:72c48f292f6a )
full compact
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 15 unchanged lines hidden (view full) ---

24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Gabe Black
29 * Kevin Lim
30 */
31
32#include "arch/sparc/faults.hh"
33#include "cpu/thread_context.hh"
34#include "cpu/base.hh"
35#include "base/trace.hh"
36#if !FULL_SYSTEM
37#include "sim/process.hh"
38#include "mem/page_table.hh"
39#endif
40
41namespace SparcISA
42{
43
44FaultName InternalProcessorError::_name = "intprocerr";
45TrapType InternalProcessorError::_trapType = 0x029;
46FaultPriority InternalProcessorError::_priority = 4;
47FaultStat InternalProcessorError::_count;
48

--- 175 unchanged lines hidden (view full) ---

224
225#if !FULL_SYSTEM
226FaultName PageTableFault::_name = "page_table_fault";
227TrapType PageTableFault::_trapType = 0x0000;
228FaultPriority PageTableFault::_priority = 0;
229FaultStat PageTableFault::_count;
230#endif
231
232#if FULL_SYSTEM
233
234void SparcFault::invoke(ThreadContext * tc)
235{
236 FaultBase::invoke(tc);
237 countStat()++;
238
239 //Use the SPARC trap state machine

--- 18 unchanged lines hidden (view full) ---

258
259#if !FULL_SYSTEM
260
261void TrapInstruction::invoke(ThreadContext * tc)
262{
263 // Should be handled in ISA.
264}
265
266void PageTableFault::invoke(ThreadContext *tc)
267{
268 Process *p = tc->getProcessPtr();
269
270 // address is higher than the stack region or in the current stack region
271 if (vaddr > p->stack_base || vaddr > p->stack_min)
272 FaultBase::invoke(tc);
273
274 // We've accessed the next page
275 if (vaddr > p->stack_min - PageBytes) {
276 p->stack_min -= PageBytes;
277 if (p->stack_base - p->stack_min > 8*1024*1024)
278 fatal("Over max stack size for one thread\n");
279 p->pTable->allocate(p->stack_min, PageBytes);
280 warn("Increasing stack size by one page.");
281 } else {
282 FaultBase::invoke(tc);
283 }
284}
285#endif
286
287} // namespace SparcISA
288