summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_exec.c
AgeCommit message (Collapse)Author
2018-01-09remove struct emul's e_fault.maya
It used to be used by COMPAT_IRIX for the purpose of overriding uvm_fault (only implemented in MIPS), now removed. Ride 8.99.12 version bump.
2014-11-09Do not uselessly include <sys/malloc.h>.maxv
2012-02-19Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!rmind
Approved by core@.
2011-08-18sizeof type -> sizeof *varchristos
2010-07-07many changes for COMPAT_LINUX:chs
- update the linux syscall table for each platform. - support new-style (NPTL) linux pthreads on all platforms. clone() with CLONE_THREAD uses 1 process with many LWPs instead of separate processes. - move the contents of sys__lwp_setprivate() into a new lwp_setprivate() and use that everywhere. - update linux_release[] and linux32_release[] to "2.6.18". - adjust placement of emul fork/exec/exit hooks as needed and adjust other emul code to match. - convert all struct emul definitions to use named initializers. - change the pid allocator to allow multiple pids to refer to the same proc. - remove a few fields from struct proc that are no longer needed. - disable the non-functional "vdso" code in linux32/amd64, glibc works fine without it. - fix a race in the futex code where we could miss a wakeup after a requeue operation. - redo futex locking to be a little more efficient.
2009-10-25Initialise struct emul members by name (it is readable now and one can searchrmind
them in the tree).
2009-03-15ansify function definitionscegger
2009-03-14ANSIfy another 1261 function definitions.dsl
The only ones left in sys are beyond by sed script! (or in sys/dist or sys/external) Mostly they have function pointer parameters.
2008-12-17kill MALLOC and FREE macros.cegger
2008-11-19Make the emulations, exec formats, coredump, NFS, and the NFS serverad
into modules. By and large this commit: - shuffles header files and ifdefs - splits code out where necessary to be modular - adds module glue for each of the components - adds/replaces hooks for things that can be installed at runtime
2008-10-28Only call release_futexes if LINUX_NPTLjmcneill
2008-10-26futex support fixes from FreeBSD via cube+pengo.christos
2008-10-15Merge wrstuden-revivesa into HEAD.wrstuden
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-24Network protocol interrupts can now block on locks, so merge the globalsad
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock). Implications: - Inspecting process state requires thread context, so signals can no longer be sent from a hardware interrupt handler. Signal activity must be deferred to a soft interrupt or kthread. - As the proc state locking is simplified, it's now safe to take exit() and wait() out from under kernel_lock. - The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-23Sprinkle locking.ad
2008-04-11Under NPTL emulation, do not reparent all members of a thread group,njoly
but only the processes that emulate threads (with LINUX_CLONE_THREAD set). This fix a problem for child processes that share address space with the parent. At exit, the child will die silently, leaving the parent waiting indefinitely for its end ...
2008-04-08Cleanup unneeded LINUX_NPTL ifdef/endif.njoly
2007-12-08ANSIfy most of the function definitions in sys/compat (but not ndis).dsl
All by the magic of sed ...
2007-12-04Remove all the __Pdsl
2007-11-16Cleanup. Remove a few linux syscalls definitions, now identical tonjoly
native ones (with stackgap and ALT_CHECK_xxx removal). No functional changes expected.
2007-10-19Add compat_linux and exec_linux_elf lkm support for amd64:njoly
- Add needed COMPAT_OSSAUDIO to GENERIC. - Add missing includes needed by linux_syscallargs.h. - Add lkm building.
2007-10-19machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.had
2007-04-22Change the way that emulations locate files within the emulation root todsl
avoid having to allocate space in the 'stackgap' - which is very LWP unfriendly. The additional code for non-emulation namei() is trivial, the reduction for the emulations is massive. The vnode for a processes emulation root is saved in the cwdi structure during process exec. If the emulation root the TRYEMULROOT flag are set, namei() will do an initial search for absolute pathnames in the emulation root, if that fails it will retry from the normal root. ".." at the emulation root will always go to the real root, even in the middle of paths and when expanding symlinks. Absolute symlinks found using absolute paths in the emulation root will be relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links inside the emulation root don't need changing). If the root of the emulation would be returned (for an emulation lookup), then the real root is returned instead (matching the behaviour of emul_lookup, but being a cheap comparison here) so that programs that scan "../.." looking for the root dircetory don't loop forever. The target for symbolic links is no longer mangled (it used to get the CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended). CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding TRYEMULROOT to the flags to NDINIT(). A lot of the emulation system call stubs could now be deleted.
2007-03-09- Make the proclist_lock a mutex. The write:read ratio is unfavourable,ad
and mutexes are cheaper use than RW locks. - LOCK_ASSERT -> KASSERT in some places. - Hold proclist_lock/kernel_lock longer in a couple of places.
2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos
2007-02-19Introduce a new member to struct emul, e_startlwp, to be used bycube
sys__lwp_create. It allows using the said syscall under COMPAT_NETBSD32. The libpthread regression tests now pass on amd64 and sparc64.
2007-02-15Fix Linux compat on amd64.ad
2007-02-09Merge newlock2 to head.ad
2006-11-16__unused removal on arguments; approved by core.christos
2006-10-12- sprinkle __unused on function decls.christos
- fix a couple of unused bugs - no more -Wno-unused for i386
2006-09-29Coverity CID 2990: fix memory leak (from Arnaud Lacombe)christos
2006-09-02fix incomplete initializerchristos
2006-08-231) Complete Linux exit_group() emulationmanu
Members of the thread group must die without reporting to the parent and without going to zombie stage. We do that by reparenting to init before catching a SIGKILL. The parent will not see the child death. The thread group leader must report the exit status, even if it exits because of another thread calling exit_group(). We do that by storing the exit status in struct linux_emuldata_shared, and the exit hook has the duty of setting struct proc's p_xstat for the thread group leader. 2) For exit/fork/exec hooks, move the NPTL specific code to separate functions that are shared between COMPAT_LINUX and COMPAT_LINUX32 3) Fix LINUX_CLONE_PARENT_SETTID semantics
2006-06-25- Complete exit_group() implementation. We now maintain a list of Linuxmanu
threads in a processes and kill them properly. The code is a bit too complicated, but I could not find a simplier way of dealing with it - Change getpid() and getppid() semantics to match what Linux does, and implement gettid(). In the Linux kernel, threads are implemnted as plain old processes. A thread group is just a set of processes, with the parent called leader. Thread ID, which are returned by gettid(), are just the PID of the plain old processes, and getpid() returns the PID of the thread group leader. - Remove struct linux32_emuldata. COMPAT_LINUX32 uses a lot of COMPAT_LINUX code, where a struct linux_emuldata is assumed. By having distinct emuldata structure with different sizes and layouts, we caused kernel memory corruptions. - Fix setprioriry() and getpriority() Thanks to Nicolas Joly for tracking down the problem and providing me the hardware to fix them.
2005-12-11merge ktrace-lwp.christos
2005-11-23To awake all processes sleeping on a futex, set maximum value to 0x7fffffffmanu
instead of -1 (0xffffffff): the value is signed...
2005-11-05Implement more of Linux futex(2)manu
2005-11-05Fix build when LINUX_NPTL is not definedmanu
2005-11-05Instead of ifdef'ing __amd64__ all the Linux NPTL stuff, introduce anmanu
ifdef LINUX_NPTL. Also implement SETTLS flag to Linux clone()
2005-11-04Implement Linux futex ang gettidmanu
2005-06-22Implent CLONE_PARENT_SETTID, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTIDmanu
options to clone(). This makes fork() work on amd64. clone() prototype has changed and the changes is probably revelant on some other arches.
2005-06-02Add a const.tsutsui
2005-05-20Define linux_usertrap function, and set it in struct emul. For allfvdl
but amd64, it just returns 0, doing nothing. For amd64, it implements vsyscalls through cheating: if the faulting address is in the vsyscall area (which is statically known on Linux/amd64), and the intruction pointer is too, it must have been a vsyscall. In that case, retrieve the return address from the user stack, fix up %rip and %rsp, and just execute the normal system call. It will return as if the vsyscall has been executed.
2005-03-26s/uvm_map_defaultaddr/uvm_default_mapaddr/ HI FRANK!christos
2005-03-26Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.fvdl
* For sparc64 and amd64, define *SIZ32 VM constants. * Add a new function pointer to struct emul, pointing at a function that will return the default VM map address. The default function is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS macro. This gives emulations control over the default map address, and allows things to be mapped at the right address (in 32bit range) for COMPAT_NETBSD32. * Add code to adjust the data and stack limits when a COMPAT_NETBSD32 or COMPAT_SVR4_32 binary is executed. * Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr instead (emulations might have set it differently) * Since this changes struct emul, bump kernel version to 3.99.2 Tested on amd64, compile-tested on sparc64.
2004-08-08fix two bugs in previous:jdolecek
* flags passed from fork1() are FORK_*, not CLONE_*; thus, correct is to check for FORK_SHAREVM, not CLONE_VM * fix a reference counting bug
2004-08-08linux processes sharing VM space (via clone() call) must alsojdolecek
share same 'break' value used for brk()/sbrk(), otherwise application SIGSEGVs quickly once different threads try to adjust data segment size this fixes linux Mozilla crashes with SuSE 9.1 libraries, and possibly other linux applications using real threads
2003-12-20Put back Emmanuel's sigfilter hooks, as decided by Core.fvdl
2003-12-20Introduce lwp_emuldata and the associated hooks. No hook is provided for themanu
exec case, as the emulation already has the ability to intercept that with the e_proc_exec hook. It is the responsability of the emulation to take appropriaye action about lwp_emuldata in e_proc_exec. Patch reviewed by Christos.