diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2006-11-08 13:55:48 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2006-11-08 13:55:48 -0500 |
commit | 67b9a2ebd850b6b0a01324b46ac3d6f87b3a8cb5 (patch) | |
tree | 7a05754175a3ba9ac87747cb265d44f0d0e6a530 /src/arch/sparc/utility.hh | |
parent | 770b575c30e734b3ed9528558a72c476a9e4bf41 (diff) | |
download | gem5-67b9a2ebd850b6b0a01324b46ac3d6f87b3a8cb5.tar.xz |
Move the check to see if you're in user mode into the isa directory.
--HG--
extra : convert_revision : b5b7cdf4a5e5e54228c592093516bf18d0f7dbe6
Diffstat (limited to 'src/arch/sparc/utility.hh')
-rw-r--r-- | src/arch/sparc/utility.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/arch/sparc/utility.hh b/src/arch/sparc/utility.hh index e2b0b2307..e51677cdf 100644 --- a/src/arch/sparc/utility.hh +++ b/src/arch/sparc/utility.hh @@ -39,6 +39,14 @@ namespace SparcISA { + + static inline bool + inUserMode(ThreadContext *tc) + { + return !(tc->readMiscReg(MISCREG_PSTATE & (1 << 2)) || + tc->readMiscReg(MISCREG_HPSTATE & (1 << 2))); + } + inline ExtMachInst makeExtMI(MachInst inst, ThreadContext * xc) { ExtMachInst emi = (unsigned MachInst) inst; |