History log of /gem5/src/kern/linux/linux.hh
Revision Date Author Comments
# 13651:b33db942f760 02-Apr-2018 Moyang Wang <mw828@cornell.edu>

kern,sim: implement FUTEX_WAKE_OP

This patch implements FUTEX_WAKE_OP operation in the futex syscall.
Below is its description:

int futex(int *uaddr, int futex_op, int val,
const struct timespec *timeout,
int *uaddr2, int val3);

This operation was added to support some user-space use cases where more
than one futex must be handled at the same time. The most notable
example is the implementation of pthread_cond_signal(3), which requires
operations on two futexes, the one used to implement the mutex and the
one used in the implementation of the wait queue associated with the
condition variable. FUTEX_WAKE_OP allows such cases to be implemented
without leading to high rates of contention and context switching.

Reference: http://man7.org/linux/man-pages/man2/futex.2.html

Change-Id: I215f3c2a7bdc6374e5dfe06ee721c76933a10f2d
Reviewed-on: https://gem5-review.googlesource.com/c/9630
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>


# 13650:93efc0143eb7 02-Apr-2018 Moyang Wang <mw828@cornell.edu>

sim, kern: support FUTEX_CMP_REQUEUE

This patch supports FUTEX_CMP_REQUEUE operation. Below is its
description from Linux man page:

futex syscall: int futex(int *uaddr, int futex_op, int val,
const struct timespec *timeout,
int *uaddr2, int val3);

This operation first checks whether the location uaddr still contains
the value val3. If not, the operation fails with the error EAGAIN.
Otherwise, the operation wakes up a maximum of val waiters that are
waiting on the futex at uaddr. If there are more than val waiters, then
the remaining waiters are removed from the wait queue of the source
futex at uaddr and added to the wait queue of the target futex at
uaddr2. The val2 argument specifies an upper limit on the number of
waiters that are requeued to the futex at uaddr2.

Reference: http://man7.org/linux/man-pages/man2/futex.2.html

Change-Id: I6d2ebd19a935b656d19d8342f7ab450c0d2031f4
Reviewed-on: https://gem5-review.googlesource.com/c/9629
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>


# 13642:253cda14088e 02-Apr-2018 Tuan Ta <qtt2@cornell.edu>

sim,kern: support FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET ops

This patch adds support for two operations in futex system call:
FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET. The two operations are used to
selectively wake up a certain thread waiting on a futex variable.

Basically each thread waiting on a futex variable is associated with a
bitset that is checked when another thread tries to wake up all threads
waiting on the futex variable.

Change-Id: I2300e53b144d8fae226423fa2efb0238c1d93ef9
Reviewed-on: https://gem5-review.googlesource.com/c/9621
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>


# 13570:b6484720c6a9 18-Apr-2018 Brandon Potter <brandon.potter@amd.com>

sim-se: add syscalls related to polling

Fix poll so that it will use the syscall retry capability
instead of causing a blocking call.

Add the accept and wait4 system calls.

Add polling to read to remove deadlocks that occur in the
event queue that are caused by blocking system calls.

Modify the write system call to return an error number in
case of error.

Change-Id: I0b4091a2e41e4187ebf69d63e0088f988f37d5da
Reviewed-on: https://gem5-review.googlesource.com/c/12115
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>


# 12591:48dfacae20ba 25-Jul-2017 Jason Lowe-Power <jason@lowepower.com>

sim-se: Add /sys/devices/system/cpu/online file

Add the special file /sys/devices/system/cpu/online to the files that gem5
knows how to handle in SE mode. This file lists the CPUs that are active.
For instance, in an 8 CPU system it is the following:
0-7

This implementation simply returns a file that is 0-%d where %d is the
current number of thread contexts.

This file is required for C++11 threads with gcc 4.8 and above.

Change-Id: I0b566f77e75e9eca480509814d0fd038a231b940
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/8902
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>


# 11907:48a3d32da9d8 01-Mar-2017 Brandon Potter <Brandon.Potter@amd.com>

syscall-emul: Add functionality to open syscalls

This changeset adds refactors the existing open system call,
adds the openat variant (enabled for x86 builds), and adds
additional "special file" test cases for /proc/meminfo and
/etc/passwd.

Change-Id: I6f429db65bbf2a28ffa3fd12df518c2d0de49663
Reviewed-on: https://gem5-review.googlesource.com/2265
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>


# 11851:824055fe6b30 09-Nov-2016 Brandon Potter <brandon.potter@amd.com>

syscall_emul: [patch 5/22] remove LiveProcess class and use Process instead

The EIOProcess class was removed recently and it was the only other class
which derived from Process. Since every Process invocation is also a
LiveProcess invocation, it makes sense to simplify the organization by
combining the fields from LiveProcess into Process.


# 11800:54436a1784dc 09-Nov-2016 Brandon Potter <brandon.potter@amd.com>

style: [patch 3/22] reduce include dependencies in some headers

Used cppclean to help identify useless includes and removed them. This
involved erroneously included headers, but also cases where forward
declarations could have been used rather than a full include.


# 11382:654272b82e94 17-Mar-2016 Brandon Potter <brandon.potter@amd.com>

syscall_emul: add many Linux kernel flags


# 10796:5bcba8001c7e 22-Apr-2015 Brandon Potter <brandon.potter@amd.com>

syscall_emul: implement clock_gettime system call


# 10027:532929273927 24-Jan-2014 Chris Adeniyi-Jones <Chris.Adeniyi-Jones@arm.com>

sim: Add openat/fstatat syscalls and fix mremap

This patch adds support for the openat and fstatat syscalls and
broadens the support for mremap to make it work on OS X.


# 9238:9fa13250abd8 21-Sep-2012 Lluc Alvarez <lluc.alvarez@bsc.es>

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.


# 9146:a61fdbbc1d45 06-Aug-2012 Marc Orr <marc.orr@gmail.com>

syscall emulation: Enabled getrlimit and getrusage for x86.
Added/moved rlimit constants to base linux header file.

This patch is a revised version of Vince Weaver's earlier patch.


# 9141:593fe25c86a6 06-Aug-2012 Marc Orr <marc.orr@gmail.com>

syscall emulation: Clean up ioctl handling, and implement for x86.

Enable different whitelists for different OS/arch combinations,
since some use the generic Linux definitions only, and others
use definitions inherited from earlier Unix flavors on those
architectures.

Also update x86 function pointers so ioctl is no longer
unimplemented on that platform.

This patch is a revised version of Vince Weaver's earlier patch.


# 9112:6e854ea87bab 11-Jul-2012 Marc Orr <marc.orr@gmail.com>

syscall emulation: Add the futex system call.


# 8794:e2ac2b7164dd 18-Nov-2011 Gabe Black <gblack@eecs.umich.edu>

SE/FS: Get rid of includes of config/full_system.hh.


# 8767:e575781f71b8 30-Oct-2011 Gabe Black <gblack@eecs.umich.edu>

SE/FS: Make getProcessPtr available in both modes, and get rid of FULL_SYSTEMs.


# 6744:408673e38566 14-Nov-2009 Ali Saidi <Ali.Saidi@arm.com>

SE: Fix SE mode OS X compilation.


# 6684:04cba5a03e2e 24-Oct-2009 Timothy M. Jones <tjones1@inf.ed.ac.uk>

syscall: Implementation of the time system call.


# 6683:5e0fcc528fe5 24-Oct-2009 Timothy M. Jones <tjones1@inf.ed.ac.uk>

syscall: Implementation of the times system call


# 6215:9aed64c9f10f 17-May-2009 Nathan Binkert <nate@binkert.org>

includes: use base/types.hh not inttypes.h or stdint.h


# 5795:72ce7502dc71 17-Jan-2009 Ali Saidi <saidi@eecs.umich.edu>

Fix issue 326: glibc non-deterministic because it reads /proc


# 5543:3af77710f397 10-Sep-2008 Ali Saidi <saidi@eecs.umich.edu>

style: Remove non-leading tabs everywhere they shouldn't be. Developers should configure their editors to not insert tabs


# 3122:f6d56fc0a12d 30-Sep-2006 Gabe Black <gblack@eecs.umich.edu>

Some code cleanup.

src/kern/linux/linux.hh:
src/kern/solaris/solaris.hh:
Some code cleanup. Uncommented some typedefs.
src/kern/tru64/tru64.hh:
Some code cleanup. Deleted an obsoleted function.


# 3113:a6811aaea654 15-Sep-2006 Gabe Black <gblack@eecs.umich.edu>

Changes to correct stat behavior


# 2764:e6fea7527b3c 17-Jun-2006 Steve Reinhardt <stever@eecs.umich.edu>

Fixes to compile under Cygwin.

src/kern/linux/linux.hh:
src/kern/solaris/solaris.hh:
Rename BSD_HOST to the more specific NO_STAT64.
src/sim/byteswap.hh:
Replace set of swap_byte functions with a single
templated version. Hope this fixes compiler issues
with e.g. int32_t vs int disambiguation.
src/sim/syscall_emul.hh:
Rename BSD_HOST to the more specific NO_STAT64.
Set this for __CYGWIN__.


# 2665:a124942bacb8 31-May-2006 Ali Saidi <saidi@eecs.umich.edu>

Updated Authors from bk prs info


# 2632:1bb2f91485ea 22-May-2006 Steve Reinhardt <stever@eecs.umich.edu>

New directory structure:
- simulator source now in 'src' subdirectory
- imported files from 'ext' repository
- support building in arbitrary places, including
outside of the source tree. See comment at top
of SConstruct file for more details.
Regression tests are temporarily disabled; that
syetem needs more extensive revisions.

SConstruct:
Update for new directory structure.
Modify to support build trees that are not subdirectories
of the source tree. See comment at top of file for
more details.
Regression tests are temporarily disabled.
src/arch/SConscript:
src/arch/isa_parser.py:
src/python/SConscript:
Update for new directory structure.