From b0e9654f8621729400ba627ed8c9bd0bf3833f7a Mon Sep 17 00:00:00 2001 From: Daniel Sanchez Date: Tue, 21 Apr 2009 08:17:36 -0700 Subject: 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. --- src/sim/syscall_emul.hh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/sim/syscall_emul.hh') 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()); -- cgit v1.2.3