faults.cc (12512:cb5ebe30bb9e) | faults.cc (12517:77e8688fc670) |
---|---|
1/* 2 * Copyright (c) 2010, 2012-2014, 2016-2018 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 184 unchanged lines hidden (view full) --- 193 194static_assert(sizeof(ArmFault::aarch64FaultSources) == 195 ArmFault::NumFaultSources, 196 "Invalid size of ArmFault::aarch64FaultSources[]"); 197 198// Fields: name, offset, cur{ELT,ELH}Offset, lowerEL{64,32}Offset, next mode, 199// {ARM, Thumb, ARM_ELR, Thumb_ELR} PC offset, hyp trap, 200// {A, F} disable, class, stat | 1/* 2 * Copyright (c) 2010, 2012-2014, 2016-2018 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 184 unchanged lines hidden (view full) --- 193 194static_assert(sizeof(ArmFault::aarch64FaultSources) == 195 ArmFault::NumFaultSources, 196 "Invalid size of ArmFault::aarch64FaultSources[]"); 197 198// Fields: name, offset, cur{ELT,ELH}Offset, lowerEL{64,32}Offset, next mode, 199// {ARM, Thumb, ARM_ELR, Thumb_ELR} PC offset, hyp trap, 200// {A, F} disable, class, stat |
201template<> ArmFault::FaultVals ArmFaultVals<Reset>::vals = { | 201template<> ArmFault::FaultVals ArmFaultVals<Reset>::vals( |
202 // Some dummy values (the reset vector has an IMPLEMENTATION DEFINED 203 // location in AArch64) 204 "Reset", 0x000, 0x000, 0x000, 0x000, 0x000, MODE_SVC, | 202 // Some dummy values (the reset vector has an IMPLEMENTATION DEFINED 203 // location in AArch64) 204 "Reset", 0x000, 0x000, 0x000, 0x000, 0x000, MODE_SVC, |
205 0, 0, 0, 0, false, true, true, EC_UNKNOWN, FaultStat() 206}; 207template<> ArmFault::FaultVals ArmFaultVals<UndefinedInstruction>::vals = { | 205 0, 0, 0, 0, false, true, true, EC_UNKNOWN 206); 207template<> ArmFault::FaultVals ArmFaultVals<UndefinedInstruction>::vals( |
208 "Undefined Instruction", 0x004, 0x000, 0x200, 0x400, 0x600, MODE_UNDEFINED, | 208 "Undefined Instruction", 0x004, 0x000, 0x200, 0x400, 0x600, MODE_UNDEFINED, |
209 4, 2, 0, 0, true, false, false, EC_UNKNOWN, FaultStat() 210}; 211template<> ArmFault::FaultVals ArmFaultVals<SupervisorCall>::vals = { | 209 4, 2, 0, 0, true, false, false, EC_UNKNOWN 210); 211template<> ArmFault::FaultVals ArmFaultVals<SupervisorCall>::vals( |
212 "Supervisor Call", 0x008, 0x000, 0x200, 0x400, 0x600, MODE_SVC, | 212 "Supervisor Call", 0x008, 0x000, 0x200, 0x400, 0x600, MODE_SVC, |
213 4, 2, 4, 2, true, false, false, EC_SVC_TO_HYP, FaultStat() 214}; 215template<> ArmFault::FaultVals ArmFaultVals<SecureMonitorCall>::vals = { | 213 4, 2, 4, 2, true, false, false, EC_SVC_TO_HYP 214); 215template<> ArmFault::FaultVals ArmFaultVals<SecureMonitorCall>::vals( |
216 "Secure Monitor Call", 0x008, 0x000, 0x200, 0x400, 0x600, MODE_MON, | 216 "Secure Monitor Call", 0x008, 0x000, 0x200, 0x400, 0x600, MODE_MON, |
217 4, 4, 4, 4, false, true, true, EC_SMC_TO_HYP, FaultStat() 218}; 219template<> ArmFault::FaultVals ArmFaultVals<HypervisorCall>::vals = { | 217 4, 4, 4, 4, false, true, true, EC_SMC_TO_HYP 218); 219template<> ArmFault::FaultVals ArmFaultVals<HypervisorCall>::vals( |
220 "Hypervisor Call", 0x008, 0x000, 0x200, 0x400, 0x600, MODE_HYP, | 220 "Hypervisor Call", 0x008, 0x000, 0x200, 0x400, 0x600, MODE_HYP, |
221 4, 4, 4, 4, true, false, false, EC_HVC, FaultStat() 222}; 223template<> ArmFault::FaultVals ArmFaultVals<PrefetchAbort>::vals = { | 221 4, 4, 4, 4, true, false, false, EC_HVC 222); 223template<> ArmFault::FaultVals ArmFaultVals<PrefetchAbort>::vals( |
224 "Prefetch Abort", 0x00C, 0x000, 0x200, 0x400, 0x600, MODE_ABORT, | 224 "Prefetch Abort", 0x00C, 0x000, 0x200, 0x400, 0x600, MODE_ABORT, |
225 4, 4, 0, 0, true, true, false, EC_PREFETCH_ABORT_TO_HYP, FaultStat() 226}; 227template<> ArmFault::FaultVals ArmFaultVals<DataAbort>::vals = { | 225 4, 4, 0, 0, true, true, false, EC_PREFETCH_ABORT_TO_HYP 226); 227template<> ArmFault::FaultVals ArmFaultVals<DataAbort>::vals( |
228 "Data Abort", 0x010, 0x000, 0x200, 0x400, 0x600, MODE_ABORT, | 228 "Data Abort", 0x010, 0x000, 0x200, 0x400, 0x600, MODE_ABORT, |
229 8, 8, 0, 0, true, true, false, EC_DATA_ABORT_TO_HYP, FaultStat() 230}; 231template<> ArmFault::FaultVals ArmFaultVals<VirtualDataAbort>::vals = { | 229 8, 8, 0, 0, true, true, false, EC_DATA_ABORT_TO_HYP 230); 231template<> ArmFault::FaultVals ArmFaultVals<VirtualDataAbort>::vals( |
232 "Virtual Data Abort", 0x010, 0x000, 0x200, 0x400, 0x600, MODE_ABORT, | 232 "Virtual Data Abort", 0x010, 0x000, 0x200, 0x400, 0x600, MODE_ABORT, |
233 8, 8, 0, 0, true, true, false, EC_INVALID, FaultStat() 234}; 235template<> ArmFault::FaultVals ArmFaultVals<HypervisorTrap>::vals = { | 233 8, 8, 0, 0, true, true, false, EC_INVALID 234); 235template<> ArmFault::FaultVals ArmFaultVals<HypervisorTrap>::vals( |
236 // @todo: double check these values 237 "Hypervisor Trap", 0x014, 0x000, 0x200, 0x400, 0x600, MODE_HYP, | 236 // @todo: double check these values 237 "Hypervisor Trap", 0x014, 0x000, 0x200, 0x400, 0x600, MODE_HYP, |
238 0, 0, 0, 0, false, false, false, EC_UNKNOWN, FaultStat() 239}; 240template<> ArmFault::FaultVals ArmFaultVals<SecureMonitorTrap>::vals = { | 238 0, 0, 0, 0, false, false, false, EC_UNKNOWN 239); 240template<> ArmFault::FaultVals ArmFaultVals<SecureMonitorTrap>::vals( |
241 "Secure Monitor Trap", 0x004, 0x000, 0x200, 0x400, 0x600, MODE_MON, | 241 "Secure Monitor Trap", 0x004, 0x000, 0x200, 0x400, 0x600, MODE_MON, |
242 4, 2, 0, 0, false, false, false, EC_UNKNOWN, FaultStat() 243}; 244template<> ArmFault::FaultVals ArmFaultVals<Interrupt>::vals = { | 242 4, 2, 0, 0, false, false, false, EC_UNKNOWN 243); 244template<> ArmFault::FaultVals ArmFaultVals<Interrupt>::vals( |
245 "IRQ", 0x018, 0x080, 0x280, 0x480, 0x680, MODE_IRQ, | 245 "IRQ", 0x018, 0x080, 0x280, 0x480, 0x680, MODE_IRQ, |
246 4, 4, 0, 0, false, true, false, EC_UNKNOWN, FaultStat() 247}; 248template<> ArmFault::FaultVals ArmFaultVals<VirtualInterrupt>::vals = { | 246 4, 4, 0, 0, false, true, false, EC_UNKNOWN 247); 248template<> ArmFault::FaultVals ArmFaultVals<VirtualInterrupt>::vals( |
249 "Virtual IRQ", 0x018, 0x080, 0x280, 0x480, 0x680, MODE_IRQ, | 249 "Virtual IRQ", 0x018, 0x080, 0x280, 0x480, 0x680, MODE_IRQ, |
250 4, 4, 0, 0, false, true, false, EC_INVALID, FaultStat() 251}; 252template<> ArmFault::FaultVals ArmFaultVals<FastInterrupt>::vals = { | 250 4, 4, 0, 0, false, true, false, EC_INVALID 251); 252template<> ArmFault::FaultVals ArmFaultVals<FastInterrupt>::vals( |
253 "FIQ", 0x01C, 0x100, 0x300, 0x500, 0x700, MODE_FIQ, | 253 "FIQ", 0x01C, 0x100, 0x300, 0x500, 0x700, MODE_FIQ, |
254 4, 4, 0, 0, false, true, true, EC_UNKNOWN, FaultStat() 255}; 256template<> ArmFault::FaultVals ArmFaultVals<VirtualFastInterrupt>::vals = { | 254 4, 4, 0, 0, false, true, true, EC_UNKNOWN 255); 256template<> ArmFault::FaultVals ArmFaultVals<VirtualFastInterrupt>::vals( |
257 "Virtual FIQ", 0x01C, 0x100, 0x300, 0x500, 0x700, MODE_FIQ, | 257 "Virtual FIQ", 0x01C, 0x100, 0x300, 0x500, 0x700, MODE_FIQ, |
258 4, 4, 0, 0, false, true, true, EC_INVALID, FaultStat() 259}; 260template<> ArmFault::FaultVals ArmFaultVals<SupervisorTrap>::vals = { | 258 4, 4, 0, 0, false, true, true, EC_INVALID 259); 260template<> ArmFault::FaultVals ArmFaultVals<SupervisorTrap>::vals( |
261 // Some dummy values (SupervisorTrap is AArch64-only) 262 "Supervisor Trap", 0x014, 0x000, 0x200, 0x400, 0x600, MODE_SVC, | 261 // Some dummy values (SupervisorTrap is AArch64-only) 262 "Supervisor Trap", 0x014, 0x000, 0x200, 0x400, 0x600, MODE_SVC, |
263 0, 0, 0, 0, false, false, false, EC_UNKNOWN, FaultStat() 264}; 265template<> ArmFault::FaultVals ArmFaultVals<PCAlignmentFault>::vals = { | 263 0, 0, 0, 0, false, false, false, EC_UNKNOWN 264); 265template<> ArmFault::FaultVals ArmFaultVals<PCAlignmentFault>::vals( |
266 // Some dummy values (PCAlignmentFault is AArch64-only) 267 "PC Alignment Fault", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC, | 266 // Some dummy values (PCAlignmentFault is AArch64-only) 267 "PC Alignment Fault", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC, |
268 0, 0, 0, 0, true, false, false, EC_PC_ALIGNMENT, FaultStat() 269}; 270template<> ArmFault::FaultVals ArmFaultVals<SPAlignmentFault>::vals = { | 268 0, 0, 0, 0, true, false, false, EC_PC_ALIGNMENT 269); 270template<> ArmFault::FaultVals ArmFaultVals<SPAlignmentFault>::vals( |
271 // Some dummy values (SPAlignmentFault is AArch64-only) 272 "SP Alignment Fault", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC, | 271 // Some dummy values (SPAlignmentFault is AArch64-only) 272 "SP Alignment Fault", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC, |
273 0, 0, 0, 0, true, false, false, EC_STACK_PTR_ALIGNMENT, FaultStat() 274}; 275template<> ArmFault::FaultVals ArmFaultVals<SystemError>::vals = { | 273 0, 0, 0, 0, true, false, false, EC_STACK_PTR_ALIGNMENT 274); 275template<> ArmFault::FaultVals ArmFaultVals<SystemError>::vals( |
276 // Some dummy values (SError is AArch64-only) 277 "SError", 0x000, 0x180, 0x380, 0x580, 0x780, MODE_SVC, | 276 // Some dummy values (SError is AArch64-only) 277 "SError", 0x000, 0x180, 0x380, 0x580, 0x780, MODE_SVC, |
278 0, 0, 0, 0, false, true, true, EC_SERROR, FaultStat() 279}; 280template<> ArmFault::FaultVals ArmFaultVals<SoftwareBreakpoint>::vals = { | 278 0, 0, 0, 0, false, true, true, EC_SERROR 279); 280template<> ArmFault::FaultVals ArmFaultVals<SoftwareBreakpoint>::vals( |
281 // Some dummy values (SoftwareBreakpoint is AArch64-only) 282 "Software Breakpoint", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC, | 281 // Some dummy values (SoftwareBreakpoint is AArch64-only) 282 "Software Breakpoint", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC, |
283 0, 0, 0, 0, true, false, false, EC_SOFTWARE_BREAKPOINT, FaultStat() 284}; 285template<> ArmFault::FaultVals ArmFaultVals<ArmSev>::vals = { | 283 0, 0, 0, 0, true, false, false, EC_SOFTWARE_BREAKPOINT 284); 285template<> ArmFault::FaultVals ArmFaultVals<ArmSev>::vals( |
286 // Some dummy values 287 "ArmSev Flush", 0x000, 0x000, 0x000, 0x000, 0x000, MODE_SVC, | 286 // Some dummy values 287 "ArmSev Flush", 0x000, 0x000, 0x000, 0x000, 0x000, MODE_SVC, |
288 0, 0, 0, 0, false, true, true, EC_UNKNOWN, FaultStat() 289}; 290template<> ArmFault::FaultVals ArmFaultVals<IllegalInstSetStateFault>::vals = { | 288 0, 0, 0, 0, false, true, true, EC_UNKNOWN 289); 290template<> ArmFault::FaultVals ArmFaultVals<IllegalInstSetStateFault>::vals( |
291 // Some dummy values (SPAlignmentFault is AArch64-only) 292 "Illegal Inst Set State Fault", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC, | 291 // Some dummy values (SPAlignmentFault is AArch64-only) 292 "Illegal Inst Set State Fault", 0x000, 0x000, 0x200, 0x400, 0x600, MODE_SVC, |
293 0, 0, 0, 0, true, false, false, EC_ILLEGAL_INST, FaultStat() 294}; | 293 0, 0, 0, 0, true, false, false, EC_ILLEGAL_INST 294); |
295 296Addr 297ArmFault::getVector(ThreadContext *tc) 298{ 299 Addr base; 300 301 // ARM ARM issue C B1.8.1 302 bool haveSecurity = ArmSystem::haveSecurity(tc); --- 1231 unchanged lines hidden --- | 295 296Addr 297ArmFault::getVector(ThreadContext *tc) 298{ 299 Addr base; 300 301 // ARM ARM issue C B1.8.1 302 bool haveSecurity = ArmSystem::haveSecurity(tc); --- 1231 unchanged lines hidden --- |