summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_emul.h
Commit message (Collapse)AuthorAgeFilesLines
* MFC r283460:dchagin2016-01-091-0/+1
| | | | Print out unsupported futex operation message only once for the process.
* MFC r283441:dchagin2016-01-091-0/+3
| | | | | | | | | | | Implement epoll family system calls. This is a tiny wrapper around kqueue() to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data, so we keep user data in the proc emuldata. Initial patch developed by rdivacky@ in 2007, then extended by Yuri Victorovich @ r255672 and finished by me in collaboration with mjg@ and jillies@.
* MFC r283422:dchagin2016-01-091-5/+16
| | | | | | | | | Refund the proc emuldata struct for future use. For now move flags from thread emuldata to proc emuldata as it was originally intended. As we can have both 64 & 32 bit Linuxulator running any eventhandler can be called twice for us. To prevent this move eventhandlers code from linux_emul.c to the linux_common.ko module.
* MFC r283383:dchagin2016-01-091-64/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch linuxulator to use the native 1:1 threads. 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.
* - >500 static DTrace probes for the linuxulatornetchild2012-05-051-7/+36
| | | | | | | | | | | | | | | | | | - DTrace scripts to check for errors, performance, ... they serve mostly as examples of what you can do with the static probe;s with moderate load the scripts may be overwhelmed, excessive lock-tracing may influence program behavior (see the last design decission) Design decissions: - use "linuxulator" as the provider for the native bitsize; add the bitsize for the non-native emulation (e.g. "linuxuator32" on amd64) - Add probes only for locks which are acquired in one function and released in another function. Locks which are aquired and released in the same function should be easy to pair in the code, inter-function locking is more easy to verify in DTrace. - Probes for locks should be fired after locking and before releasing to prevent races (to provide data/function stability in DTrace, see the man-page of "dtrace -v ..." and the corresponding DTrace docs).
* Extend struct sysvec with new method sv_schedtail, which is used for andchagin2011-03-081-1/+1
| | | | | | | | | | | | | | | explicit process at fork trampoline path instead of eventhadler(schedtail) invocation for each child process. Remove eventhandler(schedtail) code and change linux ABI to use newly added sysvec method. While here replace explicit comparing of module sysentvec structure with the newly created process sysentvec to detect the linux ABI. Discussed with: kib MFC after: 2 Week
* Rename used_requeue and use it as bitwise field to store more flags.dchagin2011-02-121-1/+5
| | | | Reimplement used_requeue logic with LINUX_XDEPR_REQUEUEOP flag.
* By using the 32-bit Linux version of Sun's Java Development Kit 1.6netchild2010-11-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | on FreeBSD (amd64), invocations of "javac" (or "java") eventually end with the output of "Killed" and exit code 137. This is caused by: 1. After calling exec() in multithreaded linux program threads are not destroyed and continue running. They get killed after program being executed finishes. 2. linux_exit_group doesn't return correct exit code when called not from group leader. Which happens regularly using sun jvm. The submitters fix this in a similar way to how NetBSD handles this. I took the PRs away from dchagin, who seems to be out of touch of this since a while (no response from him). The patches committed here are from [2], with some little modifications from me to the style. PR: 141439 [1], 144194 [2] Submitted by: Stefan Schmidt <stefan.schmidt@stadtbuch.de>, gk Reviewed by: rdivacky (in april 2010) MFC after: 5 days
* Remove support for FUTEX_REQUEUE operation.dchagin2009-04-191-0/+1
| | | | | | | | | | | | | | | | 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
* Include linux_futex.h before linux_emul.hdchagin2009-03-151-2/+0
| | | | | Approved by: kib (mentor) MFC after: 6 days
* Implement robust futexes. Most of the code is modelled afterrdivacky2008-05-131-0/+4
| | | | | | | | | | | 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
* MFP4: Turn emul_lock into a mutex.jkim2007-04-021-12/+12
| | | | Submitted by: rdivacky
* MFp4 (112498):netchild2007-01-071-2/+2
| | | | | | Rename the locking flags to EMUL_DOLOCK and EMUL_DONTLOCK to prevent confusion. Submitted by: rdivacky
* MFp4:netchild2006-12-311-13/+13
| | | | - semi-automatic style fixes
* MFP4:netchild2006-10-281-0/+2
| | | | | | | Implement prctl(). Submitted by: rdivacky Tested with: LTP
* Move some stuff into headers where they belong.netchild2006-08-171-0/+3
| | | | | | Sponsored by: Google SoC 2006 Submitted by: rdivacky Noticed by: jhb, ssouhlal
* Style fixes to comments.netchild2006-08-161-1/+2
| | | | | | Sponsored by: Google SoC 2006 Submitted by: rdivacky Noticed by: jhb, ssouhlal
* Add some new files needed for linux 2.6.x compatibility.netchild2006-08-151-0/+74
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