Skip to content
Snippets Groups Projects

x86: syscall: implementation of exit_group

On exit_group syscall, we used to exit the simulator.  But now we will only
halt the execution of threads that belong to the group.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>
parent 043672f4
No related branches found
No related tags found
No related merge requests found
......@@ -135,11 +135,17 @@ SyscallReturn
exitGroupFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
ThreadContext *tc)
{
// really should just halt all thread contexts belonging to this
// process in case there's another process running...
int index = 0;
exitSimLoop("target called exit()",
process->getSyscallArg(tc, index) & 0xff);
// halt all threads belonging to this process
for (auto i: process->contextIds) {
process->system->getThreadContext(i)->halt();
}
if (!process->system->numRunningContexts()) {
// all threads belonged to this process... exit simulator
int index = 0;
exitSimLoop("target called exit()",
process->getSyscallArg(tc, index) & 0xff);
}
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment