faults.cc (2719:d73e952240aa) | faults.cc (2800:18a615ca6e19) |
---|---|
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; --- 19 unchanged lines hidden (view full) --- 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" | 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; --- 19 unchanged lines hidden (view full) --- 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 |
|
36 37namespace SparcISA 38{ 39 40FaultName InternalProcessorError::_name = "intprocerr"; 41TrapType InternalProcessorError::_trapType = 0x029; 42FaultPriority InternalProcessorError::_priority = 4; 43FaultStat InternalProcessorError::_count; --- 169 unchanged lines hidden (view full) --- 213FaultPriority FillNOther::_priority = 9; 214FaultStat FillNOther::_count; 215 216FaultName TrapInstruction::_name = "trap_inst_n"; 217TrapType TrapInstruction::_baseTrapType = 0x100; 218FaultPriority TrapInstruction::_priority = 16; 219FaultStat TrapInstruction::_count; 220 | 40 41namespace SparcISA 42{ 43 44FaultName InternalProcessorError::_name = "intprocerr"; 45TrapType InternalProcessorError::_trapType = 0x029; 46FaultPriority InternalProcessorError::_priority = 4; 47FaultStat InternalProcessorError::_count; --- 169 unchanged lines hidden (view full) --- 217FaultPriority FillNOther::_priority = 9; 218FaultStat FillNOther::_count; 219 220FaultName TrapInstruction::_name = "trap_inst_n"; 221TrapType TrapInstruction::_baseTrapType = 0x100; 222FaultPriority TrapInstruction::_priority = 16; 223FaultStat TrapInstruction::_count; 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 |
|
221#if FULL_SYSTEM 222 223void SparcFault::invoke(ThreadContext * tc) 224{ 225 FaultBase::invoke(tc); 226 countStat()++; 227 228 //Use the SPARC trap state machine --- 18 unchanged lines hidden (view full) --- 247 248#if !FULL_SYSTEM 249 250void TrapInstruction::invoke(ThreadContext * tc) 251{ 252 // Should be handled in ISA. 253} 254 | 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} |
|
255#endif 256 257} // namespace SparcISA 258 | 285#endif 286 287} // namespace SparcISA 288 |