From 5146a69835bc9ba37fba7d3b0ff72ecaf9b98b74 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Mon, 7 Jan 2013 13:05:33 -0500 Subject: cpu: rename the misleading inSyscall to noSquashFromTC isSyscall was originally created because during handling of a syscall in SE mode the threadcontext had to be updated. However, in many places this is used in FS mode (e.g. fault handlers) and the name doesn't make much sense. The boolean actually stops gem5 from squashing speculative and non-committed state when a write to a threadcontext happens, so re-name the variable to something more appropriate --- src/cpu/o3/thread_context_impl.hh | 40 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 30 deletions(-) (limited to 'src/cpu/o3/thread_context_impl.hh') diff --git a/src/cpu/o3/thread_context_impl.hh b/src/cpu/o3/thread_context_impl.hh index 8a8ee636a..38e7c5dec 100755 --- a/src/cpu/o3/thread_context_impl.hh +++ b/src/cpu/o3/thread_context_impl.hh @@ -96,7 +96,7 @@ O3ThreadContext::takeOverFrom(ThreadContext *old_context) old_context->setStatus(ThreadContext::Halted); - thread->inSyscall = false; + thread->noSquashFromTC = false; thread->trapPending = false; } @@ -207,9 +207,9 @@ void O3ThreadContext::copyArchRegs(ThreadContext *tc) { // Prevent squashing - thread->inSyscall = true; + thread->noSquashFromTC = true; TheISA::copyRegs(tc, this); - thread->inSyscall = false; + thread->noSquashFromTC = false; if (!FullSystem) this->thread->funcExeInst = tc->readFuncExeInst(); @@ -253,10 +253,7 @@ O3ThreadContext::setIntReg(int reg_idx, uint64_t val) reg_idx = cpu->isa[thread->threadId()].flattenIntIndex(reg_idx); cpu->setArchIntReg(reg_idx, val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -266,9 +263,7 @@ O3ThreadContext::setFloatReg(int reg_idx, FloatReg val) reg_idx = cpu->isa[thread->threadId()].flattenFloatIndex(reg_idx); cpu->setArchFloatReg(reg_idx, val, thread->threadId()); - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -278,10 +273,7 @@ O3ThreadContext::setFloatRegBits(int reg_idx, FloatRegBits val) reg_idx = cpu->isa[thread->threadId()].flattenFloatIndex(reg_idx); cpu->setArchFloatRegInt(reg_idx, val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -290,10 +282,7 @@ O3ThreadContext::pcState(const TheISA::PCState &val) { cpu->pcState(val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -302,10 +291,7 @@ O3ThreadContext::pcStateNoRecord(const TheISA::PCState &val) { cpu->pcState(val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -328,10 +314,7 @@ O3ThreadContext::setMiscRegNoEffect(int misc_reg, const MiscReg &val) { cpu->setMiscRegNoEffect(misc_reg, val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } template @@ -340,9 +323,6 @@ O3ThreadContext::setMiscReg(int misc_reg, const MiscReg &val) { cpu->setMiscReg(misc_reg, val, thread->threadId()); - // Squash if we're not already in a state update mode. - if (!thread->trapPending && !thread->inSyscall) { - cpu->squashFromTC(thread->threadId()); - } + conditionalSquash(); } -- cgit v1.2.3