summaryrefslogtreecommitdiff
path: root/src/arch/arm/isa/templates
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-10-16 05:49:51 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2014-10-16 05:49:51 -0400
commita2d246b6b8379f9a74dbc56feefc155f615b5ea4 (patch)
treebbfaf7a39edebda5ca7ddac9af5e205823d37e10 /src/arch/arm/isa/templates
parenta769963d16b7b259580fa2da1e84f62aae0a5a42 (diff)
downloadgem5-a2d246b6b8379f9a74dbc56feefc155f615b5ea4.tar.xz
arch: Use shared_ptr for all Faults
This patch takes quite a large step in transitioning from the ad-hoc RefCountingPtr to the c++11 shared_ptr by adopting its use for all Faults. There are no changes in behaviour, and the code modifications are mostly just replacing "new" with "make_shared".
Diffstat (limited to 'src/arch/arm/isa/templates')
-rw-r--r--src/arch/arm/isa/templates/mem64.isa2
-rw-r--r--src/arch/arm/isa/templates/neon.isa6
-rw-r--r--src/arch/arm/isa/templates/vfp.isa30
3 files changed, 24 insertions, 14 deletions
diff --git a/src/arch/arm/isa/templates/mem64.isa b/src/arch/arm/isa/templates/mem64.isa
index aa5b8f6b8..3d6cadb5d 100644
--- a/src/arch/arm/isa/templates/mem64.isa
+++ b/src/arch/arm/isa/templates/mem64.isa
@@ -41,7 +41,7 @@ let {{
SPAlignmentCheckCode = '''
if (baseIsSP && bits(XBase, 3, 0) &&
SPAlignmentCheckEnabled(xc->tcBase())) {
- return new SPAlignmentFault();
+ return std::make_shared<SPAlignmentFault>();
}
'''
}};
diff --git a/src/arch/arm/isa/templates/neon.isa b/src/arch/arm/isa/templates/neon.isa
index c437f7e13..45df741e7 100644
--- a/src/arch/arm/isa/templates/neon.isa
+++ b/src/arch/arm/isa/templates/neon.isa
@@ -49,11 +49,13 @@ let {{
if (trapEnCheck) {
CPSR cpsrEnCheck = Cpsr;
if (cpsrEnCheck.mode == MODE_HYP) {
- return new UndefinedInstruction(machInst, issEnCheck,
+ return std::make_shared<UndefinedInstruction>(
+ machInst, issEnCheck,
EC_TRAPPED_HCPTR);
} else {
if (!inSecureState(Scr, Cpsr)) {
- return new HypervisorTrap(machInst, issEnCheck,
+ return std::make_shared<HypervisorTrap>(
+ machInst, issEnCheck,
EC_TRAPPED_HCPTR);
}
}
diff --git a/src/arch/arm/isa/templates/vfp.isa b/src/arch/arm/isa/templates/vfp.isa
index 45be8a5f3..4da00e8d5 100644
--- a/src/arch/arm/isa/templates/vfp.isa
+++ b/src/arch/arm/isa/templates/vfp.isa
@@ -48,11 +48,13 @@ let {{
if (trapEnCheck) {
CPSR cpsrEnCheck = Cpsr;
if (cpsrEnCheck.mode == MODE_HYP) {
- return new UndefinedInstruction(machInst, issEnCheck,
+ return std::make_shared<UndefinedInstruction>(
+ machInst, issEnCheck,
EC_TRAPPED_HCPTR, mnemonic);
} else {
if (!inSecureState(Scr, Cpsr)) {
- return new HypervisorTrap(machInst, issEnCheck,
+ return std::make_shared<HypervisorTrap>(
+ machInst, issEnCheck,
EC_TRAPPED_HCPTR);
}
}
@@ -63,20 +65,20 @@ let {{
CPSR cpsrEnCheck = Cpsr;
ExceptionLevel el = (ExceptionLevel) (uint8_t) cpsrEnCheck.el;
if (!vfpNeon64Enabled(Cpacr64, el))
- return new SupervisorTrap(machInst, 0x1E00000,
+ return std::make_shared<SupervisorTrap>(machInst, 0x1E00000,
EC_TRAPPED_SIMD_FP);
if (ArmSystem::haveVirtualization(xc->tcBase()) && el <= EL2) {
HCPTR cptrEnCheck = xc->tcBase()->readMiscReg(MISCREG_CPTR_EL2);
if (cptrEnCheck.tfp)
- return new HypervisorTrap(machInst, 0x1E00000,
+ return std::make_shared<HypervisorTrap>(machInst, 0x1E00000,
EC_TRAPPED_SIMD_FP);
}
if (ArmSystem::haveSecurity(xc->tcBase())) {
HCPTR cptrEnCheck = xc->tcBase()->readMiscReg(MISCREG_CPTR_EL3);
if (cptrEnCheck.tfp)
- return new SecureMonitorTrap(machInst, 0x1E00000,
+ return std::make_shared<SecureMonitorTrap>(machInst, 0x1E00000,
EC_TRAPPED_SIMD_FP);
}
'''
@@ -95,11 +97,13 @@ let {{
if (trapEnCheck) {
CPSR cpsrEnCheck = Cpsr;
if (cpsrEnCheck.mode == MODE_HYP) {
- return new UndefinedInstruction(machInst, issEnCheck,
+ return std::make_shared<UndefinedInstruction>(
+ machInst, issEnCheck,
EC_TRAPPED_HCPTR, mnemonic);
} else {
if (!inSecureState(Scr, Cpsr)) {
- return new HypervisorTrap(machInst, issEnCheck,
+ return std::make_shared<HypervisorTrap>(
+ machInst, issEnCheck,
EC_TRAPPED_HCPTR);
}
}
@@ -121,11 +125,13 @@ let {{
if (trapEnCheck) {
CPSR cpsrEnCheck = Cpsr;
if (cpsrEnCheck.mode == MODE_HYP) {
- return new UndefinedInstruction(machInst, issEnCheck,
+ return std::make_shared<UndefinedInstruction>(
+ machInst, issEnCheck,
EC_TRAPPED_HCPTR, mnemonic);
} else {
if (!inSecureState(Scr, Cpsr)) {
- return new HypervisorTrap(machInst, issEnCheck,
+ return std::make_shared<HypervisorTrap>(
+ machInst, issEnCheck,
EC_TRAPPED_HCPTR);
}
}
@@ -141,11 +147,13 @@ let {{
if (trapEnCheck) {
CPSR cpsrEnCheck = Cpsr;
if (cpsrEnCheck.mode == MODE_HYP) {
- return new UndefinedInstruction(machInst, issEnCheck,
+ return std::make_shared<UndefinedInstruction>(
+ machInst, issEnCheck,
EC_TRAPPED_HCPTR, mnemonic);
} else {
if (!inSecureState(Scr, Cpsr)) {
- return new HypervisorTrap(machInst, issEnCheck,
+ return std::make_shared<HypervisorTrap>(
+ machInst, issEnCheck,
EC_TRAPPED_HCPTR);
}
}