faults.hh (5004:7d94cedab264) | faults.hh (7678:f19b6a3a8cec) |
---|---|
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#ifndef __SPARC_FAULTS_HH__ 33#define __SPARC_FAULTS_HH__ 34 35#include "config/full_system.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#ifndef __SPARC_FAULTS_HH__ 33#define __SPARC_FAULTS_HH__ 34 35#include "config/full_system.hh" |
36#include "cpu/static_inst.hh" |
|
36#include "sim/faults.hh" 37 38// The design of the "name" and "vect" functions is in sim/faults.hh 39 40namespace SparcISA 41{ 42 43typedef uint32_t TrapType; --- 17 unchanged lines hidden (view full) --- 61 { 62 const FaultName name; 63 const TrapType trapType; 64 const FaultPriority priority; 65 const PrivilegeLevel nextPrivilegeLevel[NumLevels]; 66 FaultStat count; 67 }; 68#if FULL_SYSTEM | 37#include "sim/faults.hh" 38 39// The design of the "name" and "vect" functions is in sim/faults.hh 40 41namespace SparcISA 42{ 43 44typedef uint32_t TrapType; --- 17 unchanged lines hidden (view full) --- 62 { 63 const FaultName name; 64 const TrapType trapType; 65 const FaultPriority priority; 66 const PrivilegeLevel nextPrivilegeLevel[NumLevels]; 67 FaultStat count; 68 }; 69#if FULL_SYSTEM |
69 void invoke(ThreadContext * tc); | 70 void invoke(ThreadContext * tc, 71 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
70#endif 71 virtual TrapType trapType() = 0; 72 virtual FaultPriority priority() = 0; 73 virtual FaultStat & countStat() = 0; 74 virtual PrivilegeLevel getNextLevel(PrivilegeLevel current) = 0; 75}; 76 77template<typename T> --- 9 unchanged lines hidden (view full) --- 87 PrivilegeLevel getNextLevel(PrivilegeLevel current) 88 { 89 return vals.nextPrivilegeLevel[current]; 90 } 91}; 92 93class PowerOnReset : public SparcFault<PowerOnReset> 94{ | 72#endif 73 virtual TrapType trapType() = 0; 74 virtual FaultPriority priority() = 0; 75 virtual FaultStat & countStat() = 0; 76 virtual PrivilegeLevel getNextLevel(PrivilegeLevel current) = 0; 77}; 78 79template<typename T> --- 9 unchanged lines hidden (view full) --- 89 PrivilegeLevel getNextLevel(PrivilegeLevel current) 90 { 91 return vals.nextPrivilegeLevel[current]; 92 } 93}; 94 95class PowerOnReset : public SparcFault<PowerOnReset> 96{ |
95 void invoke(ThreadContext * tc); | 97#if FULL_SYSTEM 98 void invoke(ThreadContext * tc, 99 StaticInstPtr inst = StaticInst::nullStaticInstPtr); 100#endif |
96}; 97 98class WatchDogReset : public SparcFault<WatchDogReset> {}; 99 100class ExternallyInitiatedReset : public SparcFault<ExternallyInitiatedReset> {}; 101 102class SoftwareInitiatedReset : public SparcFault<SoftwareInitiatedReset> {}; 103 --- 101 unchanged lines hidden (view full) --- 205 public SparcFault<FastInstructionAccessMMUMiss> 206{ 207#if !FULL_SYSTEM 208 protected: 209 Addr vaddr; 210 public: 211 FastInstructionAccessMMUMiss(Addr addr) : vaddr(addr) 212 {} | 101}; 102 103class WatchDogReset : public SparcFault<WatchDogReset> {}; 104 105class ExternallyInitiatedReset : public SparcFault<ExternallyInitiatedReset> {}; 106 107class SoftwareInitiatedReset : public SparcFault<SoftwareInitiatedReset> {}; 108 --- 101 unchanged lines hidden (view full) --- 210 public SparcFault<FastInstructionAccessMMUMiss> 211{ 212#if !FULL_SYSTEM 213 protected: 214 Addr vaddr; 215 public: 216 FastInstructionAccessMMUMiss(Addr addr) : vaddr(addr) 217 {} |
213 void invoke(ThreadContext * tc); | 218 void invoke(ThreadContext * tc, 219 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
214#endif 215}; 216 217class FastDataAccessMMUMiss : public SparcFault<FastDataAccessMMUMiss> 218{ 219#if !FULL_SYSTEM 220 protected: 221 Addr vaddr; 222 public: 223 FastDataAccessMMUMiss(Addr addr) : vaddr(addr) 224 {} | 220#endif 221}; 222 223class FastDataAccessMMUMiss : public SparcFault<FastDataAccessMMUMiss> 224{ 225#if !FULL_SYSTEM 226 protected: 227 Addr vaddr; 228 public: 229 FastDataAccessMMUMiss(Addr addr) : vaddr(addr) 230 {} |
225 void invoke(ThreadContext * tc); | 231 void invoke(ThreadContext * tc, 232 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
226#endif 227}; 228 229class FastDataAccessProtection : public SparcFault<FastDataAccessProtection> {}; 230 231class InstructionBreakpoint : public SparcFault<InstructionBreakpoint> {}; 232 233class CpuMondo : public SparcFault<CpuMondo> {}; 234 235class DevMondo : public SparcFault<DevMondo> {}; 236 237class ResumableError : public SparcFault<ResumableError> {}; 238 239class SpillNNormal : public EnumeratedFault<SpillNNormal> 240{ 241 public: 242 SpillNNormal(uint32_t n) : EnumeratedFault<SpillNNormal>(n) {;} 243 //These need to be handled specially to enable spill traps in SE 244#if !FULL_SYSTEM | 233#endif 234}; 235 236class FastDataAccessProtection : public SparcFault<FastDataAccessProtection> {}; 237 238class InstructionBreakpoint : public SparcFault<InstructionBreakpoint> {}; 239 240class CpuMondo : public SparcFault<CpuMondo> {}; 241 242class DevMondo : public SparcFault<DevMondo> {}; 243 244class ResumableError : public SparcFault<ResumableError> {}; 245 246class SpillNNormal : public EnumeratedFault<SpillNNormal> 247{ 248 public: 249 SpillNNormal(uint32_t n) : EnumeratedFault<SpillNNormal>(n) {;} 250 //These need to be handled specially to enable spill traps in SE 251#if !FULL_SYSTEM |
245 void invoke(ThreadContext * tc); | 252 void invoke(ThreadContext * tc, 253 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
246#endif 247}; 248 249class SpillNOther : public EnumeratedFault<SpillNOther> 250{ 251 public: 252 SpillNOther(uint32_t n) : EnumeratedFault<SpillNOther>(n) {;} 253}; 254 255class FillNNormal : public EnumeratedFault<FillNNormal> 256{ 257 public: 258 FillNNormal(uint32_t n) : EnumeratedFault<FillNNormal>(n) {;} 259 //These need to be handled specially to enable fill traps in SE 260#if !FULL_SYSTEM | 254#endif 255}; 256 257class SpillNOther : public EnumeratedFault<SpillNOther> 258{ 259 public: 260 SpillNOther(uint32_t n) : EnumeratedFault<SpillNOther>(n) {;} 261}; 262 263class FillNNormal : public EnumeratedFault<FillNNormal> 264{ 265 public: 266 FillNNormal(uint32_t n) : EnumeratedFault<FillNNormal>(n) {;} 267 //These need to be handled specially to enable fill traps in SE 268#if !FULL_SYSTEM |
261 void invoke(ThreadContext * tc); | 269 void invoke(ThreadContext * tc, 270 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
262#endif 263}; 264 265class FillNOther : public EnumeratedFault<FillNOther> 266{ 267 public: 268 FillNOther(uint32_t n) : EnumeratedFault<FillNOther>(n) {;} 269}; 270 271class TrapInstruction : public EnumeratedFault<TrapInstruction> 272{ 273 public: 274 TrapInstruction(uint32_t n) : EnumeratedFault<TrapInstruction>(n) {;} 275 //In SE, trap instructions are requesting services from the OS. 276#if !FULL_SYSTEM | 271#endif 272}; 273 274class FillNOther : public EnumeratedFault<FillNOther> 275{ 276 public: 277 FillNOther(uint32_t n) : EnumeratedFault<FillNOther>(n) {;} 278}; 279 280class TrapInstruction : public EnumeratedFault<TrapInstruction> 281{ 282 public: 283 TrapInstruction(uint32_t n) : EnumeratedFault<TrapInstruction>(n) {;} 284 //In SE, trap instructions are requesting services from the OS. 285#if !FULL_SYSTEM |
277 void invoke(ThreadContext * tc); | 286 void invoke(ThreadContext * tc, 287 StaticInstPtr inst = StaticInst::nullStaticInstPtr); |
278#endif 279}; 280 281static inline Fault genMachineCheckFault() 282{ 283 return new InternalProcessorError; 284} 285 286 287} // SparcISA namespace 288 289#endif // __SPARC_FAULTS_HH__ | 288#endif 289}; 290 291static inline Fault genMachineCheckFault() 292{ 293 return new InternalProcessorError; 294} 295 296 297} // SparcISA namespace 298 299#endif // __SPARC_FAULTS_HH__ |