diff -r fa8801cdab43 -r e05edf61f878 src/cpu/inorder/inorder_dyn_inst.hh --- a/src/cpu/inorder/inorder_dyn_inst.hh Sat Sep 10 02:35:55 2011 -0700 +++ b/src/cpu/inorder/inorder_dyn_inst.hh Sat Sep 10 02:48:17 2011 -0700 @@ -525,10 +525,10 @@ bool simPalCheck(int palFunc); #else short syscallNum; +#endif - /** Calls a syscall. */ + /** Emulates a syscall. */ void syscall(int64_t callnum); -#endif //////////////////////////////////////////////////////////// // diff -r fa8801cdab43 -r e05edf61f878 src/cpu/inorder/inorder_dyn_inst.cc --- a/src/cpu/inorder/inorder_dyn_inst.cc Sat Sep 10 02:35:55 2011 -0700 +++ b/src/cpu/inorder/inorder_dyn_inst.cc Sat Sep 10 02:48:17 2011 -0700 @@ -311,14 +311,18 @@ #endif return this->cpu->simPalCheck(palFunc, this->threadNumber); } -#else +#endif + void InOrderDynInst::syscall(int64_t callnum) { +#if FULL_SYSTEM + panic("Syscall emulation isn't available in FS mode.\n"); +#else syscallNum = callnum; cpu->syscallContext(NoFault, this->threadNumber, this); +#endif } -#endif void InOrderDynInst::setSquashInfo(unsigned stage_num) diff -r fa8801cdab43 -r e05edf61f878 src/cpu/o3/dyn_inst.hh --- a/src/cpu/o3/dyn_inst.hh Sat Sep 10 02:35:55 2011 -0700 +++ b/src/cpu/o3/dyn_inst.hh Sat Sep 10 02:48:17 2011 -0700 @@ -205,10 +205,10 @@ /** Traps to handle specified fault. */ void trap(Fault fault); bool simPalCheck(int palFunc); -#else - /** Calls a syscall. */ +#endif + + /** Emulates a syscall. */ void syscall(int64_t callnum); -#endif public: diff -r fa8801cdab43 -r e05edf61f878 src/cpu/o3/dyn_inst_impl.hh --- a/src/cpu/o3/dyn_inst_impl.hh Sat Sep 10 02:35:55 2011 -0700 +++ b/src/cpu/o3/dyn_inst_impl.hh Sat Sep 10 02:48:17 2011 -0700 @@ -188,11 +188,15 @@ #endif return this->cpu->simPalCheck(palFunc, this->threadNumber); } -#else +#endif + template void BaseO3DynInst::syscall(int64_t callnum) { +#if FULL_SYSTEM + 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. @@ -202,6 +206,6 @@ if (!(curPC == newPC)) { this->pcState(newPC); } +#endif } -#endif diff -r fa8801cdab43 -r e05edf61f878 src/cpu/simple/base.hh --- a/src/cpu/simple/base.hh Sat Sep 10 02:35:55 2011 -0700 +++ b/src/cpu/simple/base.hh Sat Sep 10 02:48:17 2011 -0700 @@ -402,9 +402,17 @@ #if FULL_SYSTEM Fault hwrei() { return thread->hwrei(); } bool simPalCheck(int palFunc) { return thread->simPalCheck(palFunc); } +#endif + + void + syscall(int64_t callnum) + { +#if FULL_SYSTEM + panic("Syscall emulation isn't available in FS mode.\n"); #else - void syscall(int64_t callnum) { thread->syscall(callnum); } + thread->syscall(callnum); #endif + } bool misspeculating() { return thread->misspeculating(); } ThreadContext *tcBase() { return tc; }