Move the check to see if you're in user mode into the isa directory.

--HG--
extra : convert_revision : b5b7cdf4a5e5e54228c592093516bf18d0f7dbe6
This commit is contained in:
Gabe Black 2006-11-08 13:55:48 -05:00
parent 770b575c30
commit 67b9a2ebd8
4 changed files with 17 additions and 4 deletions

View file

@ -42,6 +42,12 @@
namespace AlphaISA
{
static inline bool
inUserMode(ThreadContext *tc)
{
return (tc->readMiscReg(AlphaISA::IPR_DTB_CM) & 0x18) != 0;
}
static inline ExtMachInst
makeExtMI(MachInst inst, Addr pc) {
#if FULL_SYSTEM

View file

@ -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;

View file

@ -35,6 +35,7 @@
#include <algorithm>
#include <string>
#include "arch/utility.hh"
#include "base/loader/symtab.hh"
#include "base/timebuf.hh"
#include "cpu/exetrace.hh"
@ -1084,8 +1085,7 @@ DefaultCommit<Impl>::commitHead(DynInstPtr &head_inst, unsigned inst_num)
#if FULL_SYSTEM
if (thread[tid]->profile) {
// bool usermode =
// (cpu->readMiscReg(AlphaISA::IPR_DTB_CM, tid) & 0x18) != 0;
// bool usermode = TheISA::inUserMode(thread[tid]->getTC());
// thread[tid]->profilePC = usermode ? 1 : head_inst->readPC();
thread[tid]->profilePC = head_inst->readPC();
ProfileNode *node = thread[tid]->profile->consume(thread[tid]->getTC(),

View file

@ -407,8 +407,7 @@ BaseSimpleCPU::postExecute()
{
#if FULL_SYSTEM
if (thread->profile) {
bool usermode =
(thread->readMiscReg(AlphaISA::IPR_DTB_CM) & 0x18) != 0;
bool usermode = TheISA::inUserMode(tc);
thread->profilePC = usermode ? 1 : thread->readPC();
ProfileNode *node = thread->profile->consume(tc, inst);
if (node)