diff -r 47d9409b2b7f -r c1bfe0b4aa84 src/arch/arm/utility.hh --- a/src/arch/arm/utility.hh Mon Aug 23 11:18:42 2010 -0500 +++ b/src/arch/arm/utility.hh Mon Aug 23 11:30:03 2010 -0500 @@ -142,9 +142,27 @@ void initCPU(ThreadContext *tc, int cpuId); static inline bool + inUserMode(CPSR cpsr) + { + return cpsr.mode == MODE_USER; + } + + static inline bool inUserMode(ThreadContext *tc) { - return (tc->readMiscRegNoEffect(MISCREG_CPSR) & 0x1f) == MODE_USER; + return inUserMode(tc->readMiscRegNoEffect(MISCREG_CPSR)); + } + + static inline bool + inPrivilegedMode(CPSR cpsr) + { + return !inUserMode(cpsr); + } + + static inline bool + inPrivilegedMode(ThreadContext *tc) + { + return !inUserMode(tc); } uint64_t getArgument(ThreadContext *tc, int number, bool fp);