summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-12-01 19:34:51 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2003-12-01 19:34:51 -0800
commit745f0044cd65d476b3b190377989eb0af3738df5 (patch)
treebc29a2944891cdfa20edeebe80e3a4ea08c0e3a7 /cpu
parent5b24b5a5c5d336eb1594e65826caf2a28da3ede1 (diff)
parent7976794aadd7f308010f88aa3a8a6e3469e37ba7 (diff)
downloadgem5-745f0044cd65d476b3b190377989eb0af3738df5.tar.xz
Merge zizzer:/bk/m5 into isabel.reinhardt.house:/z/stever/bk/m5
--HG-- extra : convert_revision : d66ebc598fdcfc9477ea5a1e455b21d7b9e56936
Diffstat (limited to 'cpu')
-rw-r--r--cpu/exec_context.cc2
-rw-r--r--cpu/exec_context.hh30
-rw-r--r--cpu/simple_cpu/simple_cpu.cc1
3 files changed, 30 insertions, 3 deletions
diff --git a/cpu/exec_context.cc b/cpu/exec_context.cc
index 92144bd93..7332b86a6 100644
--- a/cpu/exec_context.cc
+++ b/cpu/exec_context.cc
@@ -34,7 +34,7 @@
#ifdef FULL_SYSTEM
#include "sim/system.hh"
#else
-#include "sim/prog.hh"
+#include "sim/process.hh"
#endif
using namespace std;
diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh
index 274a3778b..7999e3735 100644
--- a/cpu/exec_context.hh
+++ b/cpu/exec_context.hh
@@ -52,7 +52,7 @@ class MemoryController;
#else // !FULL_SYSTEM
-#include "sim/prog.hh"
+#include "sim/process.hh"
#endif // FULL_SYSTEM
@@ -376,6 +376,34 @@ class ExecContext
#endif
#ifndef FULL_SYSTEM
+ IntReg getSyscallArg(int i)
+ {
+ return regs.intRegFile[ArgumentReg0 + i];
+ }
+
+ // used to shift args for indirect syscall
+ void setSyscallArg(int i, IntReg val)
+ {
+ regs.intRegFile[ArgumentReg0 + i] = val;
+ }
+
+ void setSyscallReturn(int64_t return_value)
+ {
+ // check for error condition. Alpha syscall convention is to
+ // indicate success/failure in reg a3 (r19) and put the
+ // return value itself in the standard return value reg (v0).
+ const int RegA3 = 19; // only place this is used
+ if (return_value >= 0) {
+ // no error
+ regs.intRegFile[RegA3] = 0;
+ regs.intRegFile[ReturnValueReg] = return_value;
+ } else {
+ // got an error, return details
+ regs.intRegFile[RegA3] = (IntReg) -1;
+ regs.intRegFile[ReturnValueReg] = -return_value;
+ }
+ }
+
void syscall()
{
process->syscall(this);
diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc
index a63f86098..476f28ea0 100644
--- a/cpu/simple_cpu/simple_cpu.cc
+++ b/cpu/simple_cpu/simple_cpu.cc
@@ -70,7 +70,6 @@
#else // !FULL_SYSTEM
#include "eio/eio.hh"
#include "mem/functional_mem/functional_memory.hh"
-#include "sim/prog.hh"
#endif // FULL_SYSTEM
using namespace std;