summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorLluc Alvarez <lluc.alvarez@bsc.es>2012-09-21 04:51:18 -0400
committerLluc Alvarez <lluc.alvarez@bsc.es>2012-09-21 04:51:18 -0400
commitc8de7654682dd8f5efa920f79d6041f2cac2fbeb (patch)
tree4076d89b387c27a66e4403a341dae3cc3c807c0a /src/sim
parent9cd0c5ecc896690d923d443f3d419a05aec79ac1 (diff)
downloadgem5-c8de7654682dd8f5efa920f79d6041f2cac2fbeb.tar.xz
SE: Ignore FUTEX_PRIVATE_FLAG of sys_futex
This patch ignores the FUTEX_PRIVATE_FLAG of the sys_futex system call in SE mode. With this patch, when sys_futex with the options FUTEX_WAIT_PRIVATE or FUTEX_WAKE_PRIVATE is emulated, the FUTEX_PRIVATE_FLAG is ignored and so their behaviours are the regular FUTEX_WAIT and FUTEX_WAKE. Emulating FUTEX_WAIT_PRIVATE and FUTEX_WAKE_PRIVATE as if they were non-private is safe from a functional point of view. The FUTEX_PRIVATE_FLAG does not change the semantics of the futex, it's just a mechanism to improve performance under certain circunstances that can be ignored in SE mode.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/syscall_emul.hh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index aec159838..e98e771d5 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -359,6 +359,7 @@ futexFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
DPRINTF(SyscallVerbose, "In sys_futex: Address=%llx, op=%d, val=%d\n",
uaddr, op, val);
+ op &= ~OS::TGT_FUTEX_PRIVATE_FLAG;
if (op == OS::TGT_FUTEX_WAIT) {
if (timeout != 0) {
@@ -410,7 +411,7 @@ futexFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
"thread contexts\n", wokenUp);
return wokenUp;
} else {
- warn("sys_futex: op %d is not implemented, just returning...");
+ warn("sys_futex: op %d is not implemented, just returning...", op);
return 0;
}