summaryrefslogtreecommitdiff
path: root/src/sim/syscall_emul.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/syscall_emul.hh')
-rw-r--r--src/sim/syscall_emul.hh14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 5ba487c7c..dcd6b5d99 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -403,16 +403,20 @@ futexFunc(SyscallDesc *desc, int callnum, Process *process,
Addr uaddr = process->getSyscallArg(tc, index);
int op = process->getSyscallArg(tc, index);
int val = process->getSyscallArg(tc, index);
+ int timeout M5_VAR_USED = process->getSyscallArg(tc, index);
+ Addr uaddr2 M5_VAR_USED = process->getSyscallArg(tc, index);
+ int val3 = process->getSyscallArg(tc, index);
/*
* Unsupported option that does not affect the correctness of the
* application. This is a performance optimization utilized by Linux.
*/
op &= ~OS::TGT_FUTEX_PRIVATE_FLAG;
+ op &= ~OS::TGT_FUTEX_CLOCK_REALTIME_FLAG;
FutexMap &futex_map = tc->getSystemPtr()->futexMap;
- if (OS::TGT_FUTEX_WAIT == op) {
+ if (OS::TGT_FUTEX_WAIT == op || OS::TGT_FUTEX_WAIT_BITSET == op) {
// Ensure futex system call accessed atomically.
BufferArg buf(uaddr, sizeof(int));
buf.copyIn(tc->getMemProxy());
@@ -426,11 +430,17 @@ futexFunc(SyscallDesc *desc, int callnum, Process *process,
if (val != mem_val)
return -OS::TGT_EWOULDBLOCK;
- futex_map.suspend(uaddr, process->tgid(), tc);
+ if (OS::TGT_FUTEX_WAIT) {
+ futex_map.suspend(uaddr, process->tgid(), tc);
+ } else {
+ futex_map.suspend_bitset(uaddr, process->tgid(), tc, val3);
+ }
return 0;
} else if (OS::TGT_FUTEX_WAKE == op) {
return futex_map.wakeup(uaddr, process->tgid(), val);
+ } else if (OS::TGT_FUTEX_WAKE_BITSET == op) {
+ return futex_map.wakeup_bitset(uaddr, process->tgid(), val3);
}
warn("futex: op %d not implemented; ignoring.", op);