diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2012-01-29 02:04:34 -0800 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2012-01-29 02:04:34 -0800 |
commit | dc0e629ea1f074691d307cde3ab7dd51a5e2102f (patch) | |
tree | 9ce01152dc0c5231748a2da03199096a87ec34f5 /src/cpu/o3 | |
parent | 22a076a6d5b949db5595bbca530fe7db927f6367 (diff) | |
download | gem5-dc0e629ea1f074691d307cde3ab7dd51a5e2102f.tar.xz |
Implement Ali's review feedback.
Try to decrease indentation, and remove some redundant FullSystem checks.
Diffstat (limited to 'src/cpu/o3')
-rw-r--r-- | src/cpu/o3/dyn_inst_impl.hh | 21 | ||||
-rw-r--r-- | src/cpu/o3/thread_state.hh | 29 |
2 files changed, 25 insertions, 25 deletions
diff --git a/src/cpu/o3/dyn_inst_impl.hh b/src/cpu/o3/dyn_inst_impl.hh index 93ae83441..76a456ee3 100644 --- a/src/cpu/o3/dyn_inst_impl.hh +++ b/src/cpu/o3/dyn_inst_impl.hh @@ -193,18 +193,17 @@ template <class Impl> void BaseO3DynInst<Impl>::syscall(int64_t callnum) { - if (FullSystem) { + if (FullSystem) panic("Syscall emulation isn't available in FS mode.\n"); - } else { - // HACK: check CPU's nextPC before and after syscall. If it - // changes, update this instruction's nextPC because the syscall - // must have changed the nextPC. - TheISA::PCState curPC = this->cpu->pcState(this->threadNumber); - this->cpu->syscall(callnum, this->threadNumber); - TheISA::PCState newPC = this->cpu->pcState(this->threadNumber); - if (!(curPC == newPC)) { - this->pcState(newPC); - } + + // HACK: check CPU's nextPC before and after syscall. If it + // changes, update this instruction's nextPC because the syscall + // must have changed the nextPC. + TheISA::PCState curPC = this->cpu->pcState(this->threadNumber); + this->cpu->syscall(callnum, this->threadNumber); + TheISA::PCState newPC = this->cpu->pcState(this->threadNumber); + if (!(curPC == newPC)) { + this->pcState(newPC); } } diff --git a/src/cpu/o3/thread_state.hh b/src/cpu/o3/thread_state.hh index fc54ec33c..9273b00da 100644 --- a/src/cpu/o3/thread_state.hh +++ b/src/cpu/o3/thread_state.hh @@ -75,22 +75,23 @@ struct O3ThreadState : public ThreadState { : ThreadState(_cpu, _thread_num, _process), cpu(_cpu), inSyscall(0), trapPending(0) { - if (FullSystem) { - if (cpu->params()->profile) { - profile = new FunctionProfile( - cpu->params()->system->kernelSymtab); - Callback *cb = - new MakeCallback<O3ThreadState, - &O3ThreadState::dumpFuncProfile>(this); - registerExitCallback(cb); - } + if (!FullSystem) + return; - // let's fill with a dummy node for now so we don't get a segfault - // on the first cycle when there's no node available. - static ProfileNode dummyNode; - profileNode = &dummyNode; - profilePC = 3; + if (cpu->params()->profile) { + profile = new FunctionProfile( + cpu->params()->system->kernelSymtab); + Callback *cb = + new MakeCallback<O3ThreadState, + &O3ThreadState::dumpFuncProfile>(this); + registerExitCallback(cb); } + + // let's fill with a dummy node for now so we don't get a segfault + // on the first cycle when there's no node available. + static ProfileNode dummyNode; + profileNode = &dummyNode; + profilePC = 3; } /** Pointer to the ThreadContext of this thread. */ |