From: Gabe Black Date: Wed, 25 Feb 2009 18:18:06 +0000 (-0800) Subject: X86: Implement inUserMode for x86. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=710b43dfbdbbaf0588d182ce0bc82a0b7db0b550;p=gem5.git X86: Implement inUserMode for x86. --- diff --git a/src/arch/x86/utility.hh b/src/arch/x86/utility.hh index 477a76e0b..6f0812a6a 100644 --- a/src/arch/x86/utility.hh +++ b/src/arch/x86/utility.hh @@ -93,7 +93,12 @@ namespace X86ISA static inline bool inUserMode(ThreadContext *tc) { - return false; +#if FULL_SYSTEM + HandyM5Reg m5reg = tc->readMiscRegNoEffect(MISCREG_M5_REG); + return m5reg.cpl == 3; +#else + return true; +#endif } inline bool isCallerSaveIntegerRegister(unsigned int reg) {