From: Gabe Black Date: Wed, 2 Jun 2010 17:58:11 +0000 (-0500) Subject: ARM: Implement a badMode function that says whether a mode is legal. X-Git-Tag: stable_2012_02_02~1182 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=239c9af90d61b2877a8cee8b91f162e7a0bf1e72;p=gem5.git ARM: Implement a badMode function that says whether a mode is legal. --- 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 };