Home | History | Annotate | Download | only in common
History log of /src/sys/compat/linux/common/linux_exec.h
RevisionDateAuthorComments
 1.55  26-Nov-2021  ryo - LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.
it is now defined in each arch same as the other *_SIGNATURE definitions.
- add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
 1.54  23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.53  22-Aug-2018  msaitoh - Cleanup for dynamic sysctl:
- Remove unused *_NAMES macros for sysctl.
- Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
use them on all m68k machines.
 1.52  12-Feb-2017  chs branches: 1.52.12; 1.52.14;
es_arglen is now in units of bytes, update the emulations accordingly.
 1.51  21-Feb-2014  maxv branches: 1.51.6; 1.51.10; 1.51.14;
Increase LINUX32_ELF_AUX_ENTRIES to avoid overrun in linux32/. Also,
add comments and KASSERTs to make sure people don't forget to increase
XX_AUX_ENTRIES's when adding vectors.

Reported by martin@ (CV), with suggestions from chs@.

ok martin@ chs@
 1.50  09-Feb-2014  chs account for the 16 bytes of AT_RANDOM data in the stack setup. fixes PR 48518.
use cprng_strong32() instead of random(). add AT_RANDOM support for linux32.
 1.49  18-Nov-2013  chs implement AT_RANDOM.
 1.48  07-Jul-2010  chs branches: 1.48.8; 1.48.18; 1.48.22;
many changes for COMPAT_LINUX:
- 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.
 1.47  10-Dec-2009  matt branches: 1.47.2; 1.47.4;
Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds). Should result in no code differences.
 1.46  15-Aug-2009  matt Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for you.
 1.45  19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
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
 1.44  25-Oct-2008  christos branches: 1.44.2;
Add preliminary tls support for i386. Does not work yet. From FreeBSD.
 1.43  28-Apr-2008  martin branches: 1.43.6;
Remove clause 3 and 4 from TNF licenses
 1.42  04-Dec-2007  dsl branches: 1.42.12; 1.42.14; 1.42.16;
Remove all the __P
 1.41  15-Feb-2007  ad branches: 1.41.18; 1.41.20; 1.41.26; 1.41.28;
Fix Linux compat on amd64.
 1.40  09-Feb-2007  ad Merge newlock2 to head.
 1.39  23-Aug-2006  manu branches: 1.39.2;
1) Complete Linux exit_group() emulation
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
 1.38  07-Aug-2006  manu Add a new signature test for linux probe function. We look for a .debuglink
section, which is specific to the Linux dynamic interpeter (yes, Linux
can execute it as a stand alone program)
 1.37  09-Feb-2006  manu branches: 1.37.2;
Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
 1.36  11-Dec-2005  christos branches: 1.36.2; 1.36.4; 1.36.6;
merge ktrace-lwp.
 1.35  20-May-2005  fvdl branches: 1.35.2;
Define linux_usertrap function, and set it in struct emul. For all
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.
 1.34  03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.33  26-Feb-2005  perry nuke trailing whitespace
 1.32  26-Mar-2004  drochner branches: 1.32.8; 1.32.10;
all ports define __HAVE_SIGINFO now, so remove the CPP conditionals
 1.31  25-Sep-2003  christos constify sendsig/trapsignal
 1.30  06-Sep-2003  christos SA_SIGINFO changes
 1.29  29-Jun-2003  fvdl branches: 1.29.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.28  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.27  09-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.26  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.25  21-Nov-2002  jdolecek back previous off; port can only supply LINUX_ELF_AUX_ENTRIES if it also
overrides the ELF copyargs function
 1.24  15-Nov-2002  wdk Fix LINUX_ELF_AUX_ENTRIES sociability issue with Mips based ports
 1.23  13-Nov-2002  jdolecek add generic linux compat ELF copyargs function

this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
even if hz != 100
* glibc gets proper information on real/effective uid and enables
secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
 1.22  26-Aug-2002  christos Implement passing AT_{E,R}{U,G}ID in the elf aux vector, like solaris.
- pass struct proc to copyargs.
- eliminate svr4_copyargs, since it is the same as ours now.
 1.21  02-Apr-2002  jdolecek branches: 1.21.2;
rename sysctl_linux() to linux_sysctl() and hook it into emul_linux
 1.20  21-Mar-2002  christos Don't bitch if we don't have support for a particular arch. This makes it
easier to include this header from userland binaries [sysctl] on archs that
don't support compat-linux without incurring ifdef hell.
 1.19  20-Mar-2002  christos emulation specific sysctls. Also change the kernel date to nov 11 as requested
by bad.
 1.18  14-Jan-2002  bjh21 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.17  22-Sep-2001  manu Enable Mips Linux emulation in header files
 1.16  29-Jul-2001  christos branches: 1.16.2;
Adjust to the new copyargs() footprint.
 1.15  18-Jun-2001  christos branches: 1.15.2;
Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.14  19-Jan-2001  manu branches: 1.14.2;
Added Linux compatibility support for powerpc ports
 1.13  21-Nov-2000  jdolecek restructure struct emul and execsw, in preparation to make emulations LKMable:
* move all exec-type specific information from struct emul to execsw[] and
provide single struct emul per emulation
* elf:
- kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry
per emulation and contains pointer to respective probe function
- interp is allocated via MALLOC() rather than on stack
- elf_args structure is allocated via MALLOC() rather than malloc()
* ecoff: the per-emulation hooks moved from alpha and mips specific code
to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per
emulation supporting ecoff with appropriate probe function
* the makecmds/probe functions don't set emulation, pointer to emulation is
part of appropriate execsw[] entry
* constify couple of structures
 1.12  15-Dec-1998  itohy branches: 1.12.8;
Added linux compat support on m68k ports.
 1.11  04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.10  03-Oct-1998  christos Attempt to fix the mess.
 1.9  01-Oct-1998  erh Move compat/linux/linux_exec.h to common.
 1.8  24-Jan-1998  mycroft Prototype new functions.
 1.7  26-Sep-1996  cgd branches: 1.7.14;
adapt ELF-using compat code to use new ELF definitions/code. At this point,
these are restricted to 32-bit ELF, and should be severely cleaned.
 1.6  13-Jun-1996  christos - Pass the Elf32_Ehdr in the linux probe function, and use it!

Since linux binaries are (mostly) always compiled with gcc, look for
the gcc signature in the .comment section header: "\0 GCC: (GNU) ".
I've changed the probe order in kern/exec_elf.c to probe for linux ELF
binaries first and fall back to SVR4 binaries. This makes statically
linked binaries work for both linux and svr4. Note that gcc-compiled
svr4 binaries, still contain the operating system signature first and
then the GCC signature, so there is no conflict. Yes this is a hack.
 1.5  07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.4  22-Jun-1995  fvdl * Changed to use generic ELF code from kern/exec_elf.c (which was taken
from the svr4 exec code plus the linux compat mods)
* Include file change
* Add multicast sockopts (from John Brezak)
 1.3  11-Jun-1995  fvdl * Make Linux ELF binaries work. Lots of code duplication, but it will have to do
for now.
* Add a sanity check in linux_uselib
 1.2  07-Apr-1995  fvdl Handle Linux signal tramp code differently. Some changes because of the
now seperate Linux signal trampoline code. Add linux_sigreturn to
syscalls.master.
 1.1  28-Feb-1995  fvdl Added Linux compat code.
 1.7.14.1  29-Jan-1998  mellon Pull up 1.8 (mycroft)
 1.12.8.2  11-Feb-2001  bouyer Sync with HEAD.
 1.12.8.1  22-Nov-2000  bouyer Sync with HEAD.
 1.14.2.9  11-Dec-2002  thorpej Sync with HEAD.
 1.14.2.8  27-Aug-2002  nathanw Catch up to -current.
 1.14.2.7  17-Apr-2002  nathanw Catch up to -current.
 1.14.2.6  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.14.2.5  28-Feb-2002  nathanw Catch up to -current.
 1.14.2.4  26-Sep-2001  nathanw Catch up to -current.
Again.
 1.14.2.3  24-Aug-2001  nathanw Catch up with -current.
 1.14.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.14.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.15.2.5  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.15.2.4  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.2.3  11-Feb-2002  jdolecek Sync w/ -current.
 1.15.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.1  03-Aug-2001  lukem update to -current
 1.16.2.1  01-Oct-2001  fvdl Catch up with -current.
 1.21.2.1  29-Aug-2002  gehenna catch up with -current.
 1.29.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.29.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.29.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.29.2.2  03-Aug-2004  skrll Sync with HEAD
 1.29.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.32.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.32.8.1  29-Apr-2005  kent sync with -current
 1.35.2.4  07-Dec-2007  yamt sync with head
 1.35.2.3  26-Feb-2007  yamt sync with head.
 1.35.2.2  30-Dec-2006  yamt sync with head.
 1.35.2.1  21-Jun-2006  yamt sync with head.
 1.36.6.1  22-Apr-2006  simonb Sync with head.
 1.36.4.1  09-Sep-2006  rpaulo sync with head
 1.36.2.1  18-Feb-2006  yamt sync with head.
 1.37.2.2  03-Sep-2006  yamt sync with head.
 1.37.2.1  11-Aug-2006  yamt sync with head
 1.39.2.1  24-Oct-2006  ad - Redo LWP locking slightly and fix some races.
- Fix some locking botches.
- Make signal mask / stack per-proc for SA processes.
- Add _lwp_kill().
 1.41.28.1  08-Dec-2007  ad Sync with head.
 1.41.26.1  08-Dec-2007  mjf Sync with HEAD.
 1.41.20.1  09-Jan-2008  matt sync with HEAD
 1.41.18.1  09-Dec-2007  jmcneill Sync with HEAD.
 1.42.16.5  11-Aug-2010  yamt sync with head.
 1.42.16.4  11-Mar-2010  yamt sync with head
 1.42.16.3  19-Aug-2009  yamt sync with head.
 1.42.16.2  04-May-2009  yamt sync with head.
 1.42.16.1  16-May-2008  yamt sync with head.
 1.42.14.1  18-May-2008  yamt sync with head.
 1.42.12.2  17-Jan-2009  mjf Sync with HEAD.
 1.42.12.1  02-Jun-2008  mjf Sync with HEAD.
 1.43.6.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.44.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.47.4.1  05-Mar-2011  rmind sync with head
 1.47.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.48.22.1  18-May-2014  rmind sync with head
 1.48.18.2  03-Dec-2017  jdolecek update from HEAD
 1.48.18.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.48.8.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.51.14.1  21-Apr-2017  bouyer Sync with HEAD
 1.51.10.1  20-Mar-2017  pgoyette Sync with HEAD
 1.51.6.1  28-Aug-2017  skrll Sync with HEAD
 1.52.14.1  10-Jun-2019  christos Sync with HEAD
 1.52.12.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

RSS XML Feed