summaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_futex.h
Commit message (Collapse)AuthorAgeFilesLines
* linux: futex_mtx should follow futex_listYuri Pankov2019-10-181-2/+0
| | | | | | | | | | | Move futex_mtx to linux_common.ko for amd64 and aarch64 along with respective list/mutex init/destroy. PR: 240989 Reported by: Alex S <iwtcex@gmail.com> Notes: svn path=/head/; revision=353725
* linux: provide just one instance of futex_listYuri Pankov2019-10-181-1/+0
| | | | | | | | | | | | | | Move futex_list definition to linux.c which is included once in linux.ko (i386) and in linux_common.ko (amd64 and aarch64) allowing 32/64 bit linux programs to access the same futexes in the latter case. PR: 240989 Reviewed by: dchagin Differential Revision: https://reviews.freebsd.org/D22073 Notes: svn path=/head/; revision=353724
* Fix futexes on i386 after the 4/4G split.Konstantin Belousov2018-04-241-0/+5
| | | | | | | | | | | Use proper method to access userspace. For now, only the slow copyout path is implemented. Reported and tested by: tijl (previous version) Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=332930
* sys/compat: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326266
* Switch linuxulator to use the native 1:1 threads.Dmitry Chagin2015-05-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reasons: 1. Get rid of the stubs/quirks with process dethreading, process reparent when the process group leader exits and close to this problems on wait(), waitpid(), etc. 2. Reuse our kernel code instead of writing excessive thread managment routines in Linuxulator. Implementation details: 1. The thread is created via kern_thr_new() in the clone() call with the CLONE_THREAD parameter. Thus, everything else is a process. 2. The test that the process has a threads is done via P_HADTHREADS bit p_flag of struct proc. 3. Per thread emulator state data structure is now located in the struct thread and freed in the thread_dtor() hook. Mandatory holdig of the p_mtx required when referencing emuldata from the other threads. 4. PID mangling has changed. Now Linux pid is the native tid and Linux tgid is the native pid, with the exception of the first thread in the process where tid and pid are one and the same. Ugliness: In case when the Linux thread is the initial thread in the thread group thread id is equal to the process id. Glibc depends on this magic (assert in pthread_getattr_np.c). So for system calls that take thread id as a parameter we should use the special method to reference struct thread. Differential Revision: https://reviews.freebsd.org/D1039 Notes: svn path=/head/; revision=283383
* Yet another unimplemented futex operation, print out about.Dmitry Chagin2011-01-311-0/+1
| | | | | | | | Submitted by: arundel MFC after: 1 month. Notes: svn path=/head/; revision=218118
* Implement a futex BITSET op.Dmitry Chagin2011-01-311-0/+2
| | | | | | | | Submitted by: arundel MFC after: 1 month. Notes: svn path=/head/; revision=218117
* - print out the PID and program name of the program trying to use anAlexander Leidinger2010-11-151-9/+12
| | | | | | | | | | | | | | | | | | | | unsupported futex operation - for those futex operations which are known to be not supported, print out which futex operation it is - shortcut the error return of the unsupported FUTEX_CLOCK_REALTIME in some cases: FUTEX_CLOCK_REALTIME can be used to tell linux to use CLOCK_REALTIME instead of CLOCK_MONOTONIC. FUTEX_CLOCK_REALTIME however must only be set, if either FUTEX_WAIT_BITSET or FUTEX_WAIT_REQUEUE_PI are set too. If that's not the case we can die with ENOSYS right at the beginning. Submitted by: arundel Reviewed by: rdivacky (earlier iteration of the patch) MFC after: 1 week Notes: svn path=/head/; revision=215338
* Move extern variable definitions to the header file.Dmitry Chagin2009-05-021-0/+3
| | | | | | | | Approved by: kib (mentor) MFC after: 1 month Notes: svn path=/head/; revision=191741
* Ignore FUTEX_FD op, as it is done by linux.Dmitry Chagin2009-03-151-1/+1
| | | | | | | | Approved by: kib (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=189862
* Make robust futexes work on linux32/amd64. Use PTRIN to readKonstantin Belousov2008-10-141-12/+0
| | | | | | | | | | | user-mode pointers. Change types used in the structures definitions to properly-sized architecture-specific types. Submitted by: dchagin MFC after: 1 week Notes: svn path=/head/; revision=183871
* Implement robust futexes. Most of the code is modelled afterRoman Divacky2008-05-131-0/+18
| | | | | | | | | | | | | | what Linux does. This is because robust futexes are mostly userspace thing which we cannot alter. Two syscalls maintain pointer to userspace list and when process exits a routine walks this list waking up processes sleeping on futexes from that list. Reviewed by: kib (mentor) MFC after: 1 month Notes: svn path=/head/; revision=178976
* o Add stub support for some new futex operations,Roman Divacky2008-03-201-0/+5
| | | | | | | | | | | | | | | | | | | | so the annoying message is not printed. o Don't warn about FUTEX_FD not being implemented and return ENOSYS instead of 0 (eg. success). o Clear FUTEX_PRIVATE_FLAG as we actually implement only private futexes so there is no reason to return ENOSYS when app asks for a private futex. We don't reject shared futexes because they worked just fine with our implementation so far. Approved by: kib (mentor) Tested by: bsam MFC after: 1 week Notes: svn path=/head/; revision=177460
* MFp4 (110523, parts which apply cleanly):Alexander Leidinger2007-02-251-19/+19
| | | | | | | | | | | | semi-automatic style(9) The futex stuff already differs a lot (only a small part does not differ) from NetBSD, so we are already way off and can't apply changes from NetBSD automatically. As we need to merge everything by hand already, we can even make the files comply to our world order. Notes: svn path=/head/; revision=166969
* Add some new files needed for linux 2.6.x compatibility.Alexander Leidinger2006-08-151-0/+61
Please don't style(9) the NetBSD code, we want to stay in sync. Not imported on a vendor branch since we need local changes. Sponsored by: Google SoC 2006 Submitted by: rdivacky With help from: manu@NetBSD.org Obtained from: NetBSD (linux_{futex,time}.*) Notes: svn path=/head/; revision=161304