summaryrefslogtreecommitdiff
path: root/src/sim/syscall_emul.hh
diff options
context:
space:
mode:
authorDaniel Sanchez <sanchezd@stanford.edu>2009-04-21 08:17:36 -0700
committerDaniel Sanchez <sanchezd@stanford.edu>2009-04-21 08:17:36 -0700
commitb0e9654f8621729400ba627ed8c9bd0bf3833f7a (patch)
tree9d2131b1d6cfd177878b06595735627da7797527 /src/sim/syscall_emul.hh
parentb0489d18ed74b542e311a2a7238cd5e19bd4b2ab (diff)
downloadgem5-b0e9654f8621729400ba627ed8c9bd0bf3833f7a.tar.xz
Commit m5threads package.
This patch adds limited multithreading support in syscall-emulation mode, by using the clone system call. The clone system call works for Alpha, SPARC and x86, and multithreaded applications run correctly in Alpha and SPARC.
Diffstat (limited to 'src/sim/syscall_emul.hh')
-rw-r--r--src/sim/syscall_emul.hh13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 0b0e73692..e995bd487 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -183,10 +183,14 @@ SyscallReturn unimplementedFunc(SyscallDesc *desc, int num,
SyscallReturn ignoreFunc(SyscallDesc *desc, int num,
LiveProcess *p, ThreadContext *tc);
-/// Target exit() handler: terminate simulation.
+/// Target exit() handler: terminate current context.
SyscallReturn exitFunc(SyscallDesc *desc, int num,
LiveProcess *p, ThreadContext *tc);
+/// Target exit_group() handler: terminate simulation. (exit all threads)
+SyscallReturn exitGroupFunc(SyscallDesc *desc, int num,
+ LiveProcess *p, ThreadContext *tc);
+
/// Target getpagesize() handler.
SyscallReturn getpagesizeFunc(SyscallDesc *desc, int num,
LiveProcess *p, ThreadContext *tc);
@@ -308,6 +312,9 @@ SyscallReturn geteuidFunc(SyscallDesc *desc, int num,
SyscallReturn getegidFunc(SyscallDesc *desc, int num,
LiveProcess *p, ThreadContext *tc);
+/// Target clone() handler.
+SyscallReturn cloneFunc(SyscallDesc *desc, int num,
+ LiveProcess *p, ThreadContext *tc);
/// Pseudo Funcs - These functions use a different return convension,
@@ -1013,8 +1020,8 @@ gettimeofdayFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
getElapsedTime(tp->tv_sec, tp->tv_usec);
tp->tv_sec += seconds_since_epoch;
- tp->tv_sec = htog(tp->tv_sec);
- tp->tv_usec = htog(tp->tv_usec);
+ tp->tv_sec = TheISA::htog(tp->tv_sec);
+ tp->tv_usec = TheISA::htog(tp->tv_usec);
tp.copyOut(tc->getMemPort());