summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_futex.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove extraneous semicolons, no functional changes.mbr2010-01-071-1/+1
| | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week
* Unlock process lock when return error from getrobustlist call.dchagin2009-06-141-1/+3
| | | | | | Tested by: Alexander Best <alexbestms at math uni-muenster de> Approved by: kib (mentor) MFC after: 3 days
* Add KTR(9) tracing for futex emulation.dchagin2009-05-071-11/+49
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Move extern variable definitions to the header file.dchagin2009-05-021-1/+1
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Reimplement futexes.dchagin2009-05-011-358/+449
| | | | | | | | | | | | | | | | | | | | Old implemention used Giant to protect the kernel data structures, but at the same time called malloc(M_WAITOK), that could cause the calling thread to sleep and lost Giant protection. User-visible result was the missed wakeup. New implementation uses one sx lock per futex. The sx protects the futex structures and allows to sleep while copyin or copyout are performed. Unlike linux, we return EINVAL when FUTEX_CMP_REQUEUE operation is requested and either caller specified futexes are equial or second futex already exists. This is acceptable since the situation can only occur from the application error, and glibc falls back to old FUTEX_WAKE operation when FUTEX_CMP_REQUEUE returns an error. Approved by: kib (mentor) MFC after: 1 month
* Remove support for FUTEX_REQUEUE operation.dchagin2009-04-191-13/+18
| | | | | | | | | | | | | | | | Glibc does not use this operation since 2.3.3 version (Jun 2004), as it is racy and replaced by FUTEX_CMP_REQUEUE operation. Glibc versions prior to 2.3.3 fall back to FUTEX_WAKE when FUTEX_REQUEUE returned EINVAL. Any application directly using FUTEX_REQUEUE without return value checking are definitely broken. Limit quantity of messages per process about unsupported operation. Approved by: kib (mentor) MFC after: 1 month
* Sort include files in the alphabetical order.dchagin2009-03-161-5/+4
| | | | | Approved by: kib (mentor) MFC after: 2 weeks
* Ignore FUTEX_FD op, as it is done by linux.dchagin2009-03-151-7/+0
| | | | | Approved by: kib (mentor) MFC after: 2 weeks
* Include linux_futex.h before linux_emul.hdchagin2009-03-151-1/+1
| | | | | Approved by: kib (mentor) MFC after: 6 days
* In the robust futexes list head, futex_offset shall be signed,kib2008-11-161-2/+2
| | | | | | and glibc actually supplies negative offsets. Change l_ulong to l_long. Submitted by: dchagin
* Make robust futexes work on linux32/amd64. Use PTRIN to readkib2008-10-141-3/+3
| | | | | | | | user-mode pointers. Change types used in the structures definitions to properly-sized architecture-specific types. Submitted by: dchagin MFC after: 1 week
* Implement robust futexes. Most of the code is modelled afterrdivacky2008-05-131-0/+161
| | | | | | | | | | | 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
* o Add stub support for some new futex operations,rdivacky2008-03-201-2/+24
| | | | | | | | | | | | | | | | | 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
* Return ENOSYS instead of 0 for the unknown futex operations.kib2008-03-021-1/+1
| | | | | Submitted by: rdivacky Reported and tested by: Gary Stanley <gary velocity-servers net>
* Move futex support code from <arch>/support.s into linux compat directory.kib2007-05-231-75/+38
| | | | | | | | | | Implement all futex atomic operations in assembler to not depend on the fuword() that does not allow to distinguish between -1 and failure return. Correctly return 0 from atomic operations on success. In collaboration with: rdivacky Tested by: Scot Hetzel <swhetzel gmail com>, Milos Vyletel <mvyletel mzm cz> Sponsored by: Google SoC 2007
* MFP4: Linux futex support for amd64.jkim2007-03-301-87/+129
| | | | | | | Initial patch was submitted by kib and additional work was done by Divacky Roman. Tested by: emulation
* MFp4 (110541):netchild2007-02-251-2/+7
| | | | | | Sync with rev 1.7 in NetBSD. Obtained from: NetBSD
* MFp4 (110523, parts which apply cleanly):netchild2007-02-251-70/+73
| | | | | | | | | 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.
* Change futex lock from mutex to sx. Make futex_get atomic (protected by thenetchild2006-09-091-8/+4
| | | | | | | | futex lock). Sponsored by: Google SoC 2006 Submitted by: rdivacky Suggested by: jhb
* - don't wake every sleeper just the first one [1]netchild2006-09-091-5/+2
| | | | | | - remove debuging printf [2] Submitted by: intron <mag@intron.ac> [1], rdivacky [2]
* Correct the number of retries in a futex_wake() call.netchild2006-08-261-2/+6
| | | | | Sponsored by: Google SoC 2006 Submitted by: rdivacky
* ifdef DEBUG a printfssouhlal2006-08-191-0/+2
| | | | Submitted by: rdivacky
* Fix the DEBUG build:netchild2006-08-171-2/+3
| | | | | | | | | - linux_emul.c [1] - linux_futex.c [2] Sponsored by: Google SoC 2006 [1] Submitted by: rdivacky [1] netchild [2]
* Add some new files needed for linux 2.6.x compatibility.netchild2006-08-151-0/+500
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}.*)
OpenPOWER on IntegriCloud