From 239c9af90d61b2877a8cee8b91f162e7a0bf1e72 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 2 Jun 2010 12:58:11 -0500 Subject: [PATCH] ARM: Implement a badMode function that says whether a mode is legal. --- src/arch/arm/types.hh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/arch/arm/types.hh b/src/arch/arm/types.hh index e99a00435..2fe4f4aa7 100644 --- a/src/arch/arm/types.hh +++ b/src/arch/arm/types.hh @@ -234,6 +234,24 @@ namespace ArmISA MODE_SYSTEM = 31 }; + static inline bool + badMode(OperatingMode mode) + { + switch (mode) { + case MODE_USER: + case MODE_FIQ: + case MODE_IRQ: + case MODE_SVC: + case MODE_MON: + case MODE_ABORT: + case MODE_UNDEFINED: + case MODE_SYSTEM: + return false; + default: + return true; + } + } + struct CoreSpecific { // Empty for now on the ARM }; -- 2.30.2