syscall emulation: Add the futex system call.
Review Request #1200 - Created May 16, 2012 and submitted
| Information | |
|---|---|
| Marc Orr | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 8986:98603fcf1976 --------------------------- syscall emulation: Add the futex system call.
Tested with m5threads test___threads executable and x86 ISA.
Posted (May 17, 2012, 11:25 p.m.)
I think the implementation of WAIT is not correct. Here is what the man page has to say
FUTEX_WAIT
This operation atomically verifies that the futex address uaddr still
contains the value val, and sleeps awaiting FUTEX_WAKE on this futex
address. If the timeout argument is non-NULL, its contents describe
the maximum duration of the wait, which is infinite otherwise. The
arguments uaddr2 and val3 are ignored.
In the current implementation, val is being not checked.
-
src/sim/syscall_emul.cc (Diff revision 1) -
Unnecessary white space.
-
src/sim/syscall_emul.cc (Diff revision 1) -
A single DPRINTF is good enough.
-
src/sim/syscall_emul.cc (Diff revision 1) -
Do you know the Linux kernel / pthreads behavior in this case?
Review request changed
Updated (May 18, 2012, 9:38 a.m.)
Description: |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+94 -1) |
Review request changed
Updated (May 18, 2012, 9:40 a.m.)
Testing Done: |
|
|---|
Posted (May 18, 2012, 9:40 a.m.)
-
src/sim/syscall_emul.cc (Diff revision 2) -
I still need to move this stuff to (constants and futexMap) to a better place.
Posted (May 20, 2012, 12:42 a.m.)
-
src/sim/syscall_emul.cc (Diff revision 2) -
yes please
-
src/sim/syscall_emul.cc (Diff revision 2) -
perhaps this should live in the system instead of being static?
Review request changed
Updated (May 20, 2012, 4:12 a.m.)
Description: |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+94 -1) |
Posted (May 20, 2012, 4:37 a.m.)
-
src/arch/alpha/linux/linux.hh (Diff revision 3) -
how about TGT_EAGAIN? Is EAGAIN the same for all OSes? should this be in kern/linux in that case?
-
src/kern/linux/linux.hh (Diff revision 3) -
here again TGT_ seems to be the way others are done
-
src/kern/linux/linux.hh (Diff revision 3) -
actually you did put it in kern/linux so why does it need to be in the alpha dir?
-
src/sim/syscall_emul.hh (Diff revision 3) -
line length?
Posted (May 20, 2012, 4:53 a.m.)
-
src/arch/alpha/linux/linux.hh (Diff revision 3) -
shouldn't this be 35 then? TGT is for target (as opposed to host) just to disambiguate #defines that would be defined anyway.
Review request changed
Updated (May 20, 2012, 7:45 a.m.)
Description: |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+94 -1) |
Review request changed
Updated (May 20, 2012, 7:47 a.m.)
Description: |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 5 (+95 -1) |
Ship It!
Ship It!
