Home | History | Annotate | only in /src/sys/compat/freebsd
History log of /src/sys/compat/freebsd
RevisionDateAuthorComments
 1.8 14-Jan-2014  christos use new bsd.syscall.mk
 1.7 11-Dec-2005  christos branches: 1.7.110; 1.7.120; 1.7.126;
merge ktrace-lwp.
 1.6 26-Feb-2005  perry make this rebuild generated files by default
 1.5 15-Nov-2003  thorpej branches: 1.5.8; 1.5.10;
We have CVS; there is no reason to make .bak files when generating the
syscall tables.
 1.4 26-Oct-2003  lukem Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
 1.3 10-Dec-1996  mycroft branches: 1.3.62;
Fix pasto.
 1.2 03-Sep-1996  mycroft Give every emulation its own Makefile for the syscall table.
 1.1 10-Oct-1995  mycroft branches: 1.1.6;
FreeBSD binary compatibility module, from Noriyuki Soda.
 1.1.6.2 10-Dec-1996  mycroft Fix pasto.
 1.1.6.1 10-Dec-1996  mycroft From trunk:
Give all the emulations a consistent Makefile.
 1.3.62.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.62.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.62.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.62.1 03-Aug-2004  skrll Sync with HEAD
 1.5.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.7.126.1 18-May-2014  rmind sync with head
 1.7.120.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.110.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.16 27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.15 01-Aug-2017  maxv branches: 1.15.2; 1.15.4;
Move arch/i386/i386/freebsd_* into compat/freebsd/. COMPAT_FREEBSD is
i386-specific.
 1.14 29-Jul-2017  maxv Remove exec_aout support in compat_freebsd. The only reason we still have
compat_freebsd is because of tw_cli, and it is an elf32 binary (could test,
manuel sent it to me).
 1.13 17-Nov-2014  uebayasi branches: 1.13.2;
Define compat modules (but without dependencies yet).
 1.12 19-Nov-2008  ad branches: 1.12.26;
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.11 30-Aug-2006  matt branches: 1.11.52; 1.11.56; 1.11.62; 1.11.66;
Update for options PTRACE
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.8;
merge ktrace-lwp.
 1.9 22-Feb-2005  heas branches: 1.9.4;
Add FreeBSD sysctl emulation for their undocumented special OIDs rooted at
OID 0. Only OID 0.3 is implemented for now, it 0.3 is the equivalent of
NetBSD's sysctlgetmibinfo().
This includes a new sysctl kern.osreldate with the value __NetBSD_Version__
for kernels with COMPAT_FREEBSD.

Both of these are used by 3ware's FreeBSD tw_cli, which seems to work now.
 1.8 22-Dec-2002  gmcgarry branches: 1.8.2; 1.8.10; 1.8.12;
Add stubs for scheduler syscalls.
 1.7 08-Dec-2002  manu Now it uses BSD system calls with alternate path checks in compat/common,
Darwin does not need freebsd_file.c anymore.
 1.6 15-Nov-2002  christos it is not kosher to include the same file twice.
 1.5 09-Oct-2002  pooka FreeBSD rfork emulation
 1.4 01-Dec-2000  jdolecek branches: 1.4.2;
split aout and elf32 specific code to separate files
emul_freebsd: add emul flags
EMUL_HAS_SYS___syscall|EMUL_GETPID_PASS_PPID|EMUL_GETID_PASS_EID
 1.3 22-Jan-1998  mycroft branches: 1.3.14;
Put a local copy of the SysV IPC compatibility from compat/common in here, so
it's not dependent on COMPAT_10. Also, fix translation of shmctl(), since
FreeBSD's is a little different.
 1.2 20-Jul-1997  pk branches: 1.2.6;
config.new => config
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.2.6.1 29-Jan-1998  mellon Pull up 1.3 (mycroft)
 1.3.14.1 08-Dec-2000  bouyer Sync with HEAD.
 1.4.2.2 29-Dec-2002  thorpej Sync with HEAD.
 1.4.2.1 18-Oct-2002  nathanw Catch up to -current.
 1.8.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.10.1 29-Apr-2005  kent sync with -current
 1.8.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.9.4.1 30-Dec-2006  yamt sync with head.
 1.10.8.1 03-Sep-2006  yamt sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.11.66.1 19-Jan-2009  skrll Sync with HEAD.
 1.11.62.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.11.56.1 04-May-2009  yamt sync with head.
 1.11.52.1 17-Jan-2009  mjf Sync with HEAD.
 1.12.26.1 03-Dec-2017  jdolecek update from HEAD
 1.13.2.1 28-Aug-2017  skrll Sync with HEAD
 1.15.4.1 10-Jun-2019  christos Sync with HEAD
 1.15.2.1 12-Mar-2018  pgoyette Update dependencies for modules when they are built-in. Now we don't
(or at least, shouldn't) need reminders in the GENERIC config files
about which module options require other options.

Update branch status doc accordingly.
 1.42 10-Aug-2018  pgoyette Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c
 1.41 06-May-2018  kamil branches: 1.41.2;
Remove an element from struct emul: e_tracesig

e_tracesig used to be implemented for Darwin compat. Nowadays the Darwin
compatiblity layer is gone and there are no other users.

This functionality isn't used where it shall be used in the existing
codebase.

If we want to emulate debugging interfaces in compat layers we would need
to implement that from scratch anyway. We would need to be bug compatible
with other OSes too.

Proposed on tech-kern@.

Welcome to NetBSD 8.99.16!

Sponsored by <The NetBSD Foundation>
 1.40 09-Jan-2018  maya branches: 1.40.2;
remove struct emul's e_fault.

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.
 1.39 08-Aug-2017  maxv Move freebsd_machdep.h into sys/compat/freebsd, and don't install it. Now,
the compat_freebsd files are all contained in sys/compat/freebsd.
 1.38 19-Feb-2012  rmind branches: 1.38.2; 1.38.16;
Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.37 07-Jul-2010  chs branches: 1.37.8; 1.37.12;
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.36 19-Nov-2008  ad branches: 1.36.6; 1.36.8;
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.35 15-Oct-2008  wrstuden branches: 1.35.2;
Merge wrstuden-revivesa into HEAD.
 1.34 19-Feb-2007  cube branches: 1.34.38; 1.34.42; 1.34.44; 1.34.48;
Introduce a new member to struct emul, e_startlwp, to be used by
sys__lwp_create. It allows using the said syscall under COMPAT_NETBSD32.

The libpthread regression tests now pass on amd64 and sparc64.
 1.33 09-Feb-2007  ad branches: 1.33.2;
Merge newlock2 to head.
 1.32 30-Aug-2006  christos branches: 1.32.2;
fix incomplete initializer
 1.31 11-Dec-2005  christos branches: 1.31.4; 1.31.8;
merge ktrace-lwp.
 1.30 13-Sep-2005  christos compat code reorg.
 1.29 10-Jul-2005  christos define syscall again.
 1.28 10-Jul-2005  christos No point in declaring syscall_intern and syscall in a zillion places.
 1.27 26-Mar-2005  fvdl branches: 1.27.2;
Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.

* 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.
 1.26 12-Sep-2004  jdolecek branches: 1.26.4; 1.26.6; 1.26.10;
only include emulation syscallnames with SYSCALL_DEBUG, it's not used otherwise
 1.25 20-Dec-2003  fvdl Put back Emmanuel's sigfilter hooks, as decided by Core.
 1.24 20-Dec-2003  manu Introduce lwp_emuldata and the associated hooks. No hook is provided for the
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.
 1.23 05-Dec-2003  jdolecek back the sigfilter emulation hook change off
 1.22 03-Dec-2003  manu Add a sigfilter emulation hook. It is used at the beginning of kpsignal2()
so that a specific emulation has the oportunity to filter out some signals.

if sigfilter returns 0, then no signal is sent by kpsignal2().

There is another place where signals can be generated: trapsignal. Since this
function is already an emulation hook, no call to the sigfilter hook was
introduced in trapsignal.

This is needed to emulate the softsignal feature in COMPAT_DARWIN (signals
sent as Mach exception messages)
 1.21 06-Sep-2003  christos SA_SIGINFO changes
 1.20 24-Aug-2003  chs add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default. the changes
fall into two basic catagories:

- pmap and trap-handler changes. these are all MD:
= alpha: we already track per-page execute permission with the (software)
PG_EXEC bit, so just have the trap handler pay attention to it.
= i386: use a new GDT segment for %cs for processes that have no
executable mappings above a certain threshold (currently the
bottom of the stack). track per-page execute permission with
the last unused PTE bit.
= powerpc/ibm4xx: just use the hardware exec bit.
= powerpc/oea: we already track per-page exec bits, but the hardware only
implements non-exec mappings at the segment level. so track the
number of executable mappings in each segment and turn on the no-exec
segment bit iff the count is 0. adjust the trap handler to deal.
= sparc (sun4m): fix our use of the hardware protection bits.
fix the trap handler to recognize text faults.
= sparc64: split the existing unified TSB into data and instruction TSBs,
and only load TTEs into the appropriate TSB(s) for the permissions.
fix the trap handler to check for execute permission.
= not yet implemented: amd64, hppa, sh5

- changes in all the emulations that put a signal trampoline on the stack.
instead, we now put the trampoline into a uvm_aobj and map that into
the process separately.

originally from openbsd, adapted for netbsd by me.
 1.19 01-Nov-2002  jdolecek branches: 1.19.6;
set struct emul's nsysent to compat SYS_NSYSENT, not SYS_MAXSYSCALL
 1.18 21-Sep-2002  manu - Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.

- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports

- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));

- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
 1.17 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.16 18-Sep-2001  jdolecek Make the setregs hook emulation-specific, rather than executable
format specific.
Struct emul has a e_setregs hook back, which points to emulation-specific
setregs function. es_setregs of struct execsw now only points to
optional executable-specific setup function (this is only used for
ECOFF).
 1.15 18-Jun-2001  christos branches: 1.15.2; 1.15.4;
Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.14 18-Dec-2000  jdolecek branches: 1.14.2;
separate the freebsd syscall code similarily to other emulations
 1.13 11-Dec-2000  mycroft Introduce 2 new flags in types.h:
* __HAVE_SYSCALL_INTERN. If this is defined, e_syscall is replaced by
e_syscall_intern, which is called at key places in the kernel. This can be
used to set a MD syscall handler pointer. This obsoletes and replaces the
*_HAS_SEPARATED_SYSCALL flags.
* __HAVE_MINIMAL_EMUL. If this is defined, certain (deprecated) elements in
struct emul are omitted.
 1.12 09-Dec-2000  jdolecek always fill in e_syscall in respective emul_*; if the emulation doesn't
have it's own separated *_syscall() function, use syscall()
 1.11 09-Dec-2000  mycroft Get rid of the damn EMUL_GET* flags.
 1.10 01-Dec-2000  jdolecek split aout and elf32 specific code to separate files
emul_freebsd: add emul flags
EMUL_HAS_SYS___syscall|EMUL_GETPID_PASS_PPID|EMUL_GETID_PASS_EID
 1.9 01-Dec-2000  jdolecek add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.8 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.7 13-Nov-2000  jdolecek change the type of *syscallnames[] array to 'const char * const foo[]'
 1.6 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.5 25-Oct-1999  kleink branches: 1.5.6;
Update to match new SVR4-style definition names in <sys/exec_elf.h>.
 1.4 09-Feb-1999  christos branches: 1.4.8; 1.4.10; 1.4.12;
PR/6962: Paul Shupak: ELF Freebsd support
 1.3 24-Jan-1998  mycroft Use freebsd_setregs().
 1.2 18-May-1996  christos branches: 1.2.16;
- rename cpu_exec_aout_prep_oldzmagic to exec_aout_prep_oldzmagic
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.2.16.1 29-Jan-1998  mellon Pull up 1.3 (mycroft)
 1.4.12.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.10.1 15-Nov-1999  fvdl Sync with -current
 1.4.8.5 05-Jan-2001  bouyer Sync with HEAD
 1.4.8.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.4.8.3 08-Dec-2000  bouyer Sync with HEAD.
 1.4.8.2 22-Nov-2000  bouyer Sync with HEAD.
 1.4.8.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.6.1 07-Mar-2002  he Apply patch (requested by jonathan):
Recognize FreeBSD ELFOSABI marked executables.
Patch is revisions 1.3-1.5 of freebsd_exec_elf32.c (new after branch)
 1.14.2.5 11-Nov-2002  nathanw Catch up to -current
 1.14.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.14.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.14.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.14.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.15.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.15.2.2 10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.15.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.19.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.19.6.4 01-Apr-2005  skrll Sync with HEAD.
 1.19.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.19.6.1 03-Aug-2004  skrll Sync with HEAD
 1.26.10.1 18-Sep-2005  tron Pull up following revision(s) (requested by fvdl in ticket #798):
sys/compat/sunos/sunos_exec.c: revision 1.47
sys/compat/pecoff/pecoff_emul.c: revision 1.11
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.45
sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.12
sys/sys/proc.h: revision 1.198
sys/compat/mach/mach_exec.c: revision 1.56
sys/compat/freebsd/freebsd_exec.c: revision 1.27
sys/arch/sparc64/include/vmparam.h: revision 1.27
sys/kern/kern_resource.c: revision 1.91
sys/compat/netbsd32/netbsd32_netbsd.c: revision 1.88
sys/compat/osf1/osf1_exec.c: revision 1.39
sys/compat/svr4_32/svr4_32_resource.c: revision 1.5
sys/compat/ultrix/ultrix_misc.c: revision 1.99
sys/compat/svr4_32/svr4_32_exec.h: revision 1.9
sys/kern/exec_elf32.c: revision 1.103
sys/compat/aoutm68k/aoutm68k_exec.c: revision 1.19
sys/compat/sunos32/sunos32_exec.c: revision 1.20
sys/compat/hpux/hpux_exec.c: revision 1.46
sys/compat/darwin/darwin_exec.c: revision 1.40
sys/kern/sysv_shm.c: revision 1.83
sys/uvm/uvm_extern.h: revision 1.99
sys/uvm/uvm_mmap.c: revision 1.89
sys/kern/kern_exec.c: revision 1.195
sys/compat/netbsd32/netbsd32.h: revision 1.31
sys/arch/sparc64/sparc64/svr4_32_machdep.c: revision 1.20
sys/compat/svr4/svr4_exec.c: revision 1.56
sys/compat/irix/irix_exec.c: revision 1.41
sys/compat/ibcs2/ibcs2_exec.c: revision 1.63
sys/compat/svr4_32/svr4_32_exec.c: revision 1.16
sys/arch/amd64/include/vmparam.h: revision 1.8
sys/compat/linux/common/linux_exec.c: revision 1.73
Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.
* 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.
 1.26.6.1 26-Mar-2005  yamt sync with head.
 1.26.4.1 29-Apr-2005  kent sync with -current
 1.27.2.3 26-Feb-2007  yamt sync with head.
 1.27.2.2 30-Dec-2006  yamt sync with head.
 1.27.2.1 21-Jun-2006  yamt sync with head.
 1.31.8.1 03-Sep-2006  yamt sync with head.
 1.31.4.1 09-Sep-2006  rpaulo sync with head
 1.32.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.33.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.34.48.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.34.48.1 19-Oct-2008  haad Sync with HEAD.
 1.34.44.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.34.42.2 11-Aug-2010  yamt sync with head.
 1.34.42.1 04-May-2009  yamt sync with head.
 1.34.38.1 17-Jan-2009  mjf Sync with HEAD.
 1.35.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.36.8.1 05-Mar-2011  rmind sync with head
 1.36.6.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.37.12.1 24-Feb-2012  mrg sync to -current.
 1.37.8.1 17-Apr-2012  yamt sync with head
 1.38.16.1 28-Aug-2017  skrll Sync with HEAD
 1.38.2.1 03-Dec-2017  jdolecek update from HEAD
 1.40.2.2 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.40.2.1 21-May-2018  pgoyette Sync with HEAD
 1.41.2.1 10-Jun-2019  christos Sync with HEAD
 1.18 29-Jul-2017  maxv Remove exec_aout support in compat_freebsd. The only reason we still have
compat_freebsd is because of tw_cli, and it is an elf32 binary (could test,
manuel sent it to me).
 1.17 10-Dec-2009  matt branches: 1.17.22; 1.17.40;
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.16 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.15 04-Dec-2007  dsl branches: 1.15.12; 1.15.16; 1.15.22; 1.15.24;
Remove all the __P
 1.14 11-Dec-2005  christos branches: 1.14.44; 1.14.46; 1.14.52; 1.14.56;
merge ktrace-lwp.
 1.13 26-Feb-2005  perry branches: 1.13.4;
nuke trailing whitespace
 1.12 07-Aug-2003  agc branches: 1.12.8; 1.12.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.11 29-Jun-2003  fvdl branches: 1.11.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.10 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.9 19-Feb-2003  jdolecek remove local idea of ELF_AUX_ARGSIZ - since this emul uses elf32_copyargs(),
it shouldn't override the size
 1.8 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 10-Dec-2002  thorpej Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is.
 1.6 21-Nov-2000  jdolecek branches: 1.6.2;
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.5 30-Apr-1999  cgd branches: 1.5.2;
compute the value to be used for e_arglen via howmany(value, sizeof (char *)),
rather than just "value / sizeof (char *)". While in these cases the latter
works as well, the former's a better example for other uses to copy (since
it handles the non-integral multiple case correctly).
 1.4 09-Feb-1999  christos branches: 1.4.4;
PR/6962: Paul Shupak: ELF Freebsd support
 1.3 24-Jan-1998  mycroft Prototype new functions.
 1.2 05-Jan-1998  perry RCSID Police.
 1.1 10-Oct-1995  mycroft branches: 1.1.18;
FreeBSD binary compatibility module, from Noriyuki Soda.
 1.1.18.1 29-Jan-1998  mellon Pull up 1.3 (mycroft)
 1.4.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.5.2.1 22-Nov-2000  bouyer Sync with HEAD.
 1.6.2.2 11-Dec-2002  thorpej Sync with HEAD.
 1.6.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.11.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.11.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.11.2.2 03-Aug-2004  skrll Sync with HEAD
 1.11.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.12.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.12.8.1 29-Apr-2005  kent sync with -current
 1.13.4.2 07-Dec-2007  yamt sync with head
 1.13.4.1 21-Jun-2006  yamt sync with head.
 1.14.56.1 08-Dec-2007  ad Sync with head.
 1.14.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.14.46.1 09-Jan-2008  matt sync with HEAD
 1.14.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.15.24.1 19-Jan-2009  skrll Sync with HEAD.
 1.15.22.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.15.16.2 11-Mar-2010  yamt sync with head
 1.15.16.1 04-May-2009  yamt sync with head.
 1.15.12.1 17-Jan-2009  mjf Sync with HEAD.
 1.17.40.1 28-Aug-2017  skrll Sync with HEAD
 1.17.22.1 03-Dec-2017  jdolecek update from HEAD
 1.10 29-Jul-2017  maxv Remove exec_aout support in compat_freebsd. The only reason we still have
compat_freebsd is because of tw_cli, and it is an elf32 binary (could test,
manuel sent it to me).
 1.9 16-Aug-2009  martin branches: 1.9.22; 1.9.40;
Include <sys/exec_aout.h> for a.out specific defines.
 1.8 08-Dec-2007  dsl branches: 1.8.16;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.7 11-Dec-2005  christos branches: 1.7.44; 1.7.46; 1.7.56;
merge ktrace-lwp.
 1.6 13-Feb-2004  wiz branches: 1.6.16;
Uppercase CPU, plural is CPUs.
 1.5 29-Jun-2003  fvdl branches: 1.5.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.4 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.3 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.2 01-Dec-2000  jdolecek branches: 1.2.2; 1.2.4; 1.2.6;
define EXEC_AOUT before including freebsd_exec.h, so that the a.out stuff
gets defined
 1.1 01-Dec-2000  jdolecek split aout and elf32 specific code to separate files
emul_freebsd: add emul flags
EMUL_HAS_SYS___syscall|EMUL_GETPID_PASS_PPID|EMUL_GETID_PASS_EID
 1.2.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 14-Nov-2001  nathanw Catch up to -current.
 1.2.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.2.2.1 01-Dec-2000  bouyer file freebsd_exec_aout.c was added on branch thorpej_scsipi on 2000-12-08 09:08:11 +0000
 1.5.2.5 04-Feb-2005  skrll Adapt to branch.
 1.5.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.2 03-Aug-2004  skrll Sync with HEAD
 1.5.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.6.16.2 21-Jan-2008  yamt sync with head
 1.6.16.1 21-Jun-2006  yamt sync with head.
 1.7.56.1 26-Dec-2007  ad Sync with head.
 1.7.46.1 09-Jan-2008  matt sync with HEAD
 1.7.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.8.16.1 19-Aug-2009  yamt sync with head.
 1.9.40.1 28-Aug-2017  skrll Sync with HEAD
 1.9.22.1 03-Dec-2017  jdolecek update from HEAD
 1.21 08-Aug-2017  maxv Move freebsd_machdep.h into sys/compat/freebsd, and don't install it. Now,
the compat_freebsd files are all contained in sys/compat/freebsd.
 1.20 09-Nov-2014  maxv branches: 1.20.2;
Do not uselessly include <sys/malloc.h>.
 1.19 24-Jun-2014  maxv branches: 1.19.2;
Remove unused headers.
 1.18 24-Jun-2014  maxv Remove dead code. The kernel already checks for PT_INTERP sections, and puts
their content into "itp". There's no need for re-reading the whole binary and
trying to find this section again. Just use "itp".

DEBUG_FREEBSD_ELF is now unused, so remove its references in amd64/conf/ALL
and i386/conf/ALL.
 1.17 22-Apr-2007  dsl branches: 1.17.78; 1.17.94;
Change the way that emulations locate files within the emulation root to
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.
 1.16 16-Nov-2006  christos branches: 1.16.4; 1.16.8; 1.16.10;
__unused removal on arguments; approved by core.
 1.15 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.14 11-Dec-2005  christos branches: 1.14.20; 1.14.22;
merge ktrace-lwp.
 1.13 13-Sep-2005  christos compat code reorg.
 1.12 31-Oct-2003  drochner branches: 1.12.16;
adapt for changes to kern/exec_elf32.c
 1.11 29-Jun-2003  fvdl branches: 1.11.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.10 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.9 29-Nov-2002  jdolecek Get the dynamic interpreter location using emul_find_interp(), so that
it checks both the alternative/emul tree, and the non-emul tree.
This makes it possible to run chrooted emulated binaries without need
to setup shadow /emul tree within the chroot hierarchy.
Only tested for COMPAT_LINUX, changes to other compat modules were
mechanical.
Fixes kern/19161 by Christian Groessler.
 1.8 28-Nov-2002  jdolecek back previous off, it makes the probe function mistaken some linux
binaries as freebsd
problem reported in thread 'installing suse_base on current
i386 sets time to 1970' on current-users
 1.7 19-Nov-2002  christos Make the OSABI and the branding optional. Tested by Ben Collver, thanks.
 1.6 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.5 27-Oct-2001  jdolecek Add a comment regarding the ELFOSABI_FREEBSD thing,
and reformat the condition a bit to avoid nested if
 1.4 23-Oct-2001  christos branches: 1.4.2;
KNF.
 1.3 23-Oct-2001  christos PR/14332: Shingo WATANABE: Regognize new ELFOSABI_FREEBSD branded executables.
 1.2 14-Jul-2001  christos rename elf32_read_from to exec_read_from since it is used in many places
now.
 1.1 01-Dec-2000  jdolecek branches: 1.1.2; 1.1.4; 1.1.6;
split aout and elf32 specific code to separate files
emul_freebsd: add emul flags
EMUL_HAS_SYS___syscall|EMUL_GETPID_PASS_PPID|EMUL_GETID_PASS_EID
 1.1.6.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.6.1 03-Aug-2001  lukem update to -current
 1.1.4.3 11-Dec-2002  thorpej Sync with HEAD.
 1.1.4.2 14-Nov-2001  nathanw Catch up to -current.
 1.1.4.1 24-Aug-2001  nathanw Catch up with -current.
 1.1.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.1.2.1 01-Dec-2000  bouyer file freebsd_exec_elf32.c was added on branch thorpej_scsipi on 2000-12-08 09:08:11 +0000
 1.4.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.11.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.11.2.2 03-Aug-2004  skrll Sync with HEAD
 1.11.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.12.16.3 03-Sep-2007  yamt sync with head.
 1.12.16.2 30-Dec-2006  yamt sync with head.
 1.12.16.1 21-Jun-2006  yamt sync with head.
 1.14.22.2 10-Dec-2006  yamt sync with head.
 1.14.22.1 22-Oct-2006  yamt sync with head
 1.14.20.1 18-Nov-2006  ad Sync with head.
 1.16.10.1 11-Jul-2007  mjf Sync with head.
 1.16.8.1 27-May-2007  ad Sync with head.
 1.16.4.1 07-May-2007  yamt sync with head.
 1.17.94.1 10-Aug-2014  tls Rebase.
 1.17.78.2 03-Dec-2017  jdolecek update from HEAD
 1.17.78.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.2.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.20.2.1 28-Aug-2017  skrll Sync with HEAD
 1.34 23-Oct-2015  maxv Change do_sys_mount() so that it only takes as argument the type of the
drive instead of its associated vfsops. Makes it more friendly, and allows
compat binaries to autoload VFS modules if needed.

sent on tech-kern@, ok christos@
 1.33 09-Nov-2014  maxv branches: 1.33.2;
Do not uselessly include <sys/malloc.h>.
 1.32 02-Mar-2010  pooka branches: 1.32.20; 1.32.36;
regen:
- remove nfssvc / fs_nfs.h / #ifdef NFS
- make getfh unconditional
 1.31 20-Dec-2007  dsl branches: 1.31.10; 1.31.12; 1.31.30;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.30 08-Dec-2007  dsl branches: 1.30.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.29 04-Dec-2007  dsl Remove all the __P
 1.28 17-Jul-2007  christos branches: 1.28.6; 1.28.8; 1.28.14; 1.28.16;
use the compat MFSNAMELEN
 1.27 13-Jul-2007  dsl Remove all the syscall stubs that were only there to get files lookup
up in the alternate path.
 1.26 12-Jul-2007  dsl Change compat mount code to pass do_sys_mount() kernel resident buffers.
Possibly the standard nfs code needs teaching how to set the length and
address family in order to support non-netbsd sockaddr.
There are now no active stackgap() calls in the compat tree.
 1.25 22-Apr-2007  dsl Change the way that emulations locate files within the emulation root to
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.
 1.24 04-Mar-2007  christos branches: 1.24.2; 1.24.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.23 09-Feb-2007  ad branches: 1.23.2;
Merge newlock2 to head.
 1.22 13-Jul-2006  martin branches: 1.22.4;
Make freebsd_sys_getfh use compat_30_sys_getfh
 1.21 11-Dec-2005  christos branches: 1.21.4; 1.21.8; 1.21.16;
merge ktrace-lwp.
 1.20 21-Apr-2004  christos branches: 1.20.12;
Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.19 29-Jun-2003  fvdl branches: 1.19.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.18 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.17 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.16 16-Mar-2002  christos make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
 1.15 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.14 30-May-2001  mrg branches: 1.14.2;
use _KERNEL_OPT.
 1.13 22-Jan-2001  jdolecek branches: 1.13.2;
Use CHECK_ALT_SYMLINK() instead CHECK_ALT_EXISTS() where appropriate.
This addresses kern/11757.
 1.12 18-Jan-2001  jdolecek constify
 1.11 01-Dec-2000  jdolecek LKMify
 1.10 01-Dec-2000  jdolecek add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.9 19-Feb-1998  thorpej branches: 1.9.14;
Include the NFS option header.
 1.8 18-Oct-1997  christos Use stat12; from Enami Tsugutomo
 1.7 16-Oct-1997  christos ostat -> stat43
 1.6 10-Oct-1997  enami New function freebsd_sys_lchown() to emulate FreeBSD lchown(2).
 1.5 31-Jan-1997  thorpej branches: 1.5.8;
NFSCLIENT -> NFS
 1.4 03-Sep-1996  mycroft branches: 1.4.2;
Define execv() and execve() consistently across emulations.
Do path name translation.
 1.3 03-May-1996  christos branches: 1.3.4;
gcc -Wall fixes.
 1.2 07-Nov-1995  gwr ufs ==> ffs
 1.1 10-Oct-1995  mycroft branches: 1.1.2;
FreeBSD binary compatibility module, from Noriyuki Soda.
 1.1.2.1 07-Nov-1995  gwr From Head: ufs ==> ffs
 1.3.4.1 10-Dec-1996  mycroft From trunk:
Do execv() and execve() path name translation consistently across
emulations.
 1.4.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.5.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.14.2 11-Feb-2001  bouyer Sync with HEAD.
 1.9.14.1 08-Dec-2000  bouyer Sync with HEAD.
 1.13.2.6 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.13.2.5 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.13.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.13.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.13.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.13.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.14.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.19.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.19.2.2 03-Aug-2004  skrll Sync with HEAD
 1.19.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.20.12.6 21-Jan-2008  yamt sync with head
 1.20.12.5 07-Dec-2007  yamt sync with head
 1.20.12.4 03-Sep-2007  yamt sync with head.
 1.20.12.3 26-Feb-2007  yamt sync with head.
 1.20.12.2 30-Dec-2006  yamt sync with head.
 1.20.12.1 21-Jun-2006  yamt sync with head.
 1.21.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.21.8.1 11-Aug-2006  yamt sync with head
 1.21.4.1 09-Sep-2006  rpaulo sync with head
 1.22.4.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.23.2.2 07-May-2007  yamt sync with head.
 1.23.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.24.4.1 11-Jul-2007  mjf Sync with head.
 1.24.2.3 20-Aug-2007  ad Sync with HEAD.
 1.24.2.2 15-Jul-2007  ad Sync with head.
 1.24.2.1 27-May-2007  ad Sync with head.
 1.28.16.2 26-Dec-2007  ad Sync with head.
 1.28.16.1 08-Dec-2007  ad Sync with head.
 1.28.14.2 27-Dec-2007  mjf Sync with HEAD.
 1.28.14.1 08-Dec-2007  mjf Sync with HEAD.
 1.28.8.1 09-Jan-2008  matt sync with HEAD
 1.28.6.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.30.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.31.30.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.31.12.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.31.12.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.31.10.1 11-Mar-2010  yamt sync with head
 1.32.36.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.32.20.1 03-Dec-2017  jdolecek update from HEAD
 1.33.2.1 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.9 16-Apr-2018  kamil Remove the rnewprocp argument from fork1(9)

It's now unused and it can cause use-after-free scenarios as noted by
<Mateusz Guzik>.

Reference: http://mail-index.netbsd.org/tech-kern/2017/09/08/msg022267.html

Sponsored by <The NetBSD Foundation>
 1.8 08-Aug-2017  maxv branches: 1.8.2;
Move freebsd_machdep.h into sys/compat/freebsd, and don't install it. Now,
the compat_freebsd files are all contained in sys/compat/freebsd.
 1.7 28-Apr-2008  martin branches: 1.7.44; 1.7.64;
Remove clause 3 and 4 from TNF licenses
 1.6 20-Dec-2007  dsl branches: 1.6.6; 1.6.8; 1.6.10;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.5 11-Dec-2005  christos branches: 1.5.46; 1.5.56; 1.5.60;
merge ktrace-lwp.
 1.4 13-Sep-2005  christos compat code reorg.
 1.3 26-Feb-2005  perry branches: 1.3.4;
nuke trailing whitespace
 1.2 18-Jan-2003  thorpej branches: 1.2.2; 1.2.10; 1.2.12;
Merge the nathanw_sa branch.
 1.1 09-Oct-2002  pooka branches: 1.1.2;
FreeBSD rfork emulation
 1.1.2.3 18-Oct-2002  nathanw LWPify freebsd_sys_rfork().
 1.1.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.1 09-Oct-2002  nathanw file freebsd_fork.c was added on branch nathanw_sa on 2002-10-18 02:40:57 +0000
 1.2.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.10.1 29-Apr-2005  kent sync with -current
 1.2.2.2 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.2.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.4.2 21-Jan-2008  yamt sync with head
 1.3.4.1 21-Jun-2006  yamt sync with head.
 1.5.60.1 02-Jan-2008  bouyer Sync with HEAD
 1.5.56.1 26-Dec-2007  ad Sync with head.
 1.5.46.1 09-Jan-2008  matt sync with HEAD
 1.6.10.1 16-May-2008  yamt sync with head.
 1.6.8.1 18-May-2008  yamt sync with head.
 1.6.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.7.64.1 28-Aug-2017  skrll Sync with HEAD
 1.7.44.1 03-Dec-2017  jdolecek update from HEAD
 1.8.2.1 22-Apr-2018  pgoyette Sync with HEAD
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 26-Feb-2005  perry nuke trailing whitespace
 1.2 07-Aug-2003  agc branches: 1.2.8; 1.2.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 09-Oct-2002  pooka branches: 1.1.2; 1.1.8;
FreeBSD rfork emulation
 1.1.8.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.8.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.8.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.8.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.1 09-Oct-2002  nathanw file freebsd_fork.h was added on branch nathanw_sa on 2002-10-18 02:40:57 +0000
 1.2.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.8.1 29-Apr-2005  kent sync with -current
 1.15 20-Dec-2007  dsl branches: 1.15.12;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.14 08-Dec-2007  dsl branches: 1.14.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.13 29-May-2007  christos branches: 1.13.6; 1.13.8; 1.13.16;
Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.
 1.12 04-Mar-2007  christos branches: 1.12.2; 1.12.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.11 09-Feb-2007  ad branches: 1.11.2;
Merge newlock2 to head.
 1.10 11-Dec-2005  christos branches: 1.10.20;
merge ktrace-lwp.
 1.9 29-Jun-2003  fvdl branches: 1.9.2; 1.9.18;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.8 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.7 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.6 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.5 01-Dec-2000  jdolecek branches: 1.5.2; 1.5.4;
add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.4 09-Oct-2000  onoe Map the ioctl number of ifioctl ('i') group as much as possible.
commands are: FreeBSD NetBSD
SIOCALIFADDR 27 28
SIOCGLIFADDR 28 29
SIOCDLIFADDR 29 30
SIOCGIFMTU 51 126
SIOCSIFMTU 52 127
* SIOCGLIFADDR is necessary for cvsup to work.
commands not emulated are:
SIOCGIFPHYS, SIOCSIFPHYS, SIOCGIFSTATUS, SIOCSIFLLADDR
 1.3 06-May-1997  augustss branches: 1.3.22;
Adjust ioctl() encoding before calling OSS audio code.
 1.2 04-Apr-1997  augustss * Move the Linux audio emulation into its own directory and rename it
OSS (aka VoxWare) audio emulation.
* Use the OSS audio emulation for Linux and FreeBSD.
* Add mixer emulation to the OSS emulator.
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.3.22.2 08-Dec-2000  bouyer Sync with HEAD.
 1.3.22.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.4 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.5.2.3 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.5.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.5.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.9.18.4 21-Jan-2008  yamt sync with head
 1.9.18.3 03-Sep-2007  yamt sync with head.
 1.9.18.2 26-Feb-2007  yamt sync with head.
 1.9.18.1 21-Jun-2006  yamt sync with head.
 1.9.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.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.10.20.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.11.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.12.4.1 11-Jul-2007  mjf Sync with head.
 1.12.2.1 09-Jun-2007  ad Sync with head.
 1.13.16.1 26-Dec-2007  ad Sync with head.
 1.13.8.1 09-Jan-2008  matt sync with HEAD
 1.13.6.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.14.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.15.12.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.15.12.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.7 06-Sep-2015  dholland More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
 1.6 29-May-2007  christos branches: 1.6.78; 1.6.98;
Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.
 1.5 09-Oct-2000  onoe branches: 1.5.40; 1.5.82; 1.5.84;
Map the ioctl number of ifioctl ('i') group as much as possible.
commands are: FreeBSD NetBSD
SIOCALIFADDR 27 28
SIOCGLIFADDR 28 29
SIOCDLIFADDR 29 30
SIOCGIFMTU 51 126
SIOCSIFMTU 52 127
* SIOCGLIFADDR is necessary for cvsup to work.
commands not emulated are:
SIOCGIFPHYS, SIOCSIFPHYS, SIOCGIFSTATUS, SIOCSIFLLADDR
 1.4 04-Oct-1998  veego branches: 1.4.12;
There is no need to include ../linux/linux_ioctl.h.
 1.3 06-May-1997  augustss Adjust ioctl() encoding before calling OSS audio code.
 1.2 04-Apr-1997  augustss * Move the Linux audio emulation into its own directory and rename it
OSS (aka VoxWare) audio emulation.
* Use the OSS audio emulation for Linux and FreeBSD.
* Add mixer emulation to the OSS emulator.
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.4.12.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.84.1 11-Jul-2007  mjf Sync with head.
 1.5.82.1 09-Jun-2007  ad Sync with head.
 1.5.40.1 03-Sep-2007  yamt sync with head.
 1.6.98.1 22-Sep-2015  skrll Sync with HEAD
 1.6.78.1 03-Dec-2017  jdolecek update from HEAD
 1.17 09-Nov-2014  maxv Do not uselessly include <sys/malloc.h>.
 1.16 11-Jan-2009  christos branches: 1.16.24; 1.16.40;
merge christos-time_t
 1.15 20-Dec-2007  dsl branches: 1.15.6; 1.15.8; 1.15.12; 1.15.14; 1.15.20;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.14 08-Dec-2007  dsl branches: 1.14.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.13 09-Feb-2007  ad branches: 1.13.18; 1.13.20; 1.13.28;
Merge newlock2 to head.
 1.12 10-Nov-2005  christos branches: 1.12.22;
need compat/sys/shm.h
 1.11 18-Jan-2003  thorpej branches: 1.11.2; 1.11.18;
Merge the nathanw_sa branch.
 1.10 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.9 30-May-2001  mrg branches: 1.9.2;
use _KERNEL_OPT.
 1.8 29-Nov-2000  jdolecek branches: 1.8.2;
LKMify
 1.7 28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.6 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.5 25-Aug-1999  thorpej branches: 1.5.2;
Update for new msgctl()/semctl()/shmctl().
 1.4 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.3 15-Aug-1998  mycroft Make copyright notices with my name consistent.
 1.2 22-Jan-1998  mycroft branches: 1.2.2;
Fix an old typo that caused shmdt() to fail.
 1.1 22-Jan-1998  mycroft Put a local copy of the SysV IPC compatibility from compat/common in here, so
it's not dependent on COMPAT_10. Also, fix translation of shmctl(), since
FreeBSD's is a little different.
 1.2.2.2 22-Jan-1998  mycroft Fix an old typo that caused shmdt() to fail.
 1.2.2.1 22-Jan-1998  mycroft file freebsd_ipc.c was added on branch netbsd-1-3 on 1998-01-22 17:23:44 +0000
 1.5.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.5.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.8.2.4 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.8.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.8.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.8.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.9.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.11.18.3 21-Jan-2008  yamt sync with head
 1.11.18.2 26-Feb-2007  yamt sync with head.
 1.11.18.1 21-Jun-2006  yamt sync with head.
 1.11.2.1 11-Dec-2005  christos Sync with head.
 1.12.22.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.13.28.1 26-Dec-2007  ad Sync with head.
 1.13.20.1 09-Jan-2008  matt sync with HEAD
 1.13.18.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.14.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.15.20.1 19-Jan-2009  skrll Sync with HEAD.
 1.15.14.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.15.14.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.15.12.1 04-May-2009  yamt sync with head.
 1.15.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.15.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.16.40.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.16.24.1 03-Dec-2017  jdolecek update from HEAD
 1.5 07-Sep-2021  riastradh sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.4 17-Sep-2017  maxv branches: 1.4.2; 1.4.10;
Remove the second argument from USERMODE and KERNELMODE, it is unused
now that we don't have vm86 anymore.
 1.3 12-Aug-2017  maxv branches: 1.3.2;
Remove vm86. Simplifies a number of critical places.

Pass 2.
 1.2 08-Aug-2017  maxv Move freebsd_machdep.h into sys/compat/freebsd, and don't install it. Now,
the compat_freebsd files are all contained in sys/compat/freebsd.
 1.1 01-Aug-2017  maxv Move arch/i386/i386/freebsd_* into compat/freebsd/. COMPAT_FREEBSD is
i386-specific.
 1.3.2.2 28-Aug-2017  skrll Sync with HEAD
 1.3.2.1 12-Aug-2017  skrll file freebsd_machdep.c was added on branch nick-nhusb on 2017-08-28 17:51:58 +0000
 1.4.10.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/freebsd/freebsd_machdep.c: revision 1.5
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/common/ieee80211_20.c: revision 1.7
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/common/if_media_80.c: revision 1.4
sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.4.2.2 03-Dec-2017  jdolecek update from HEAD
 1.4.2.1 17-Sep-2017  jdolecek file freebsd_machdep.c was added on branch tls-maxphys on 2017-12-03 11:36:53 +0000
 1.1 08-Aug-2017  maxv branches: 1.1.2; 1.1.4;
Move freebsd_machdep.h into sys/compat/freebsd, and don't install it. Now,
the compat_freebsd files are all contained in sys/compat/freebsd.
 1.1.4.2 03-Dec-2017  jdolecek update from HEAD
 1.1.4.1 08-Aug-2017  jdolecek file freebsd_machdep.h was added on branch tls-maxphys on 2017-12-03 11:36:53 +0000
 1.1.2.2 28-Aug-2017  skrll Sync with HEAD
 1.1.2.1 08-Aug-2017  skrll file freebsd_machdep.h was added on branch nick-nhusb on 2017-08-28 17:51:58 +0000
 1.34 07-Sep-2021  riastradh sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.33 09-Nov-2014  maxv branches: 1.33.12; 1.33.24;
Do not uselessly include <sys/malloc.h>.
 1.32 20-Dec-2007  dsl branches: 1.32.12; 1.32.54; 1.32.72;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.31 08-Dec-2007  dsl branches: 1.31.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.30 15-Aug-2007  ad branches: 1.30.2; 1.30.10;
Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
 1.29 04-Mar-2007  christos branches: 1.29.2; 1.29.10; 1.29.14;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.28 09-Feb-2007  ad branches: 1.28.2;
Merge newlock2 to head.
 1.27 16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.26 22-Oct-2006  christos ktruser checks for length now.
 1.25 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.24 11-Dec-2005  christos branches: 1.24.20; 1.24.22;
merge ktrace-lwp.
 1.23 13-Sep-2005  christos Forgot to reverse the conditional test.
 1.22 12-Sep-2005  christos Range checks are not optional. The omission of this one, allows the user
to corrupt the heap and/or crash the kernel (Christer Oeberg).
 1.21 26-Feb-2005  perry branches: 1.21.2; 1.21.4;
nuke trailing whitespace
 1.20 18-Sep-2003  pooka branches: 1.20.2; 1.20.6; 1.20.8; 1.20.10;
Add a good enuf emulation of the MAP_STACK flag to the mmap()
syscall. This allows programs which use MAP_STACK to work instead
of failing in weird and wonderous ways.
 1.19 29-Jun-2003  fvdl branches: 1.19.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.18 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.17 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.16 26-Nov-2002  christos rename: s/sa_/<compat>sa/g
 1.15 04-Jul-2002  thorpej Add kernel support for having userland provide the signal trampoline:

* struct sigacts gets a new sigact_sigdesc structure, which has the
sigaction and the trampoline/version. Version 0 means "legacy kernel
provided trampoline". Other versions are coordinated with machine-
dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions. Instead,
sendsig() looks up the handler by peeking in the sigacts for the
process getting the signal (since it has to look in there for the
trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later. Kernel
version not bumped; we will ride the 1.6C bump made recently.
 1.14 13-Nov-2001  lukem branches: 1.14.8; 1.14.10;
add RCSIDs (including regeneration of files as appropriate)
 1.13 30-May-2001  mrg branches: 1.13.2;
use _KERNEL_OPT.
 1.12 28-Dec-2000  jdolecek branches: 1.12.2;
use NetBSD utrace(2) facilities for FreeBSD utrace(2) emulation;
use id 'FreeBSD utrace'
 1.11 18-Dec-2000  jdolecek make compilable without KTRACE, too
 1.10 17-Dec-2000  jdolecek add emulation of FreeBSD utrace(2)
 1.9 01-Dec-2000  jdolecek LKMify
 1.8 01-Dec-2000  jdolecek add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.7 07-Aug-2000  bjh21 Second phase of changes to remove ntp_adjtime(2) from the kernel entirely if
NTP is not defined.

Also removes sysctl_ntptime, since that's unreferenced without NTP.

ntp_gettime(2) is left alone, since it doesn't raise SIGSYS, which sys_nosys()
does.
 1.6 18-Jul-2000  onoe implement new signal syscalls in FreeBSD 4.0-RELEASE, using native syscalls:
sigaction, sigprocmask, sigsuspend, and sigpending.
 1.5 21-Apr-2000  minoura branches: 1.5.4;
We have now native issetugid.
 1.4 02-May-1998  christos branches: 1.4.14;
PR/5350: Minoura Makoto: add issetugid() syscall. (with fixes from me)
 1.3 20-Oct-1997  thorpej branches: 1.3.2;
Fix the shared library versioning snafu caused by the recent changes
to the stat(2) family and msync(2). This uses a primitive function
versioning scheme.

This reverts the libc shared library major version from 13 to 12, and
adds a few new interfaces to bring us to libc version 12.20.

From Frank van der Linden <fvdl@NetBSD.ORG>.
 1.2 03-May-1996  christos gcc -Wall fixes.
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.3.2.1 30-Sep-1998  cgd pull up rev 1.4 from trunk (tv)
 1.4.14.3 05-Jan-2001  bouyer Sync with HEAD
 1.4.14.2 08-Dec-2000  bouyer Sync with HEAD.
 1.4.14.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.5.4.1 06-Mar-2002  he Pull up revisions 1.6-1.7 (requested by jonathan):
Add support for FreeBSD 4.x signals; fixes PR#9769.
 1.12.2.7 11-Dec-2002  thorpej Sync with HEAD.
 1.12.2.6 01-Aug-2002  nathanw Catch up to -current.
 1.12.2.5 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.12.2.4 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.12.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.12.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.12.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.13.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.13.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.14.10.1 14-Sep-2005  riz Pull up patch (requested by elad in ticket #5867):
Fix a user-controlled length argument from potentially overflowing an
integer. Reported by Christer Oeberg.
 1.14.8.1 15-Jul-2002  gehenna catch up with -current.
 1.19.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.19.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.19.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.19.2.2 03-Aug-2004  skrll Sync with HEAD
 1.19.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.20.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.8.1 29-Apr-2005  kent sync with -current
 1.20.6.2 08-Feb-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11023):
sys/kern/kern_ktrace.c: revision 1.110 via patch
sys/sys/ktrace.h: revision 1.45 via patch
sys/compat/freebsd/freebsd_misc.c: revision 1.26 via patch
sys/compat/darwin/darwin_iohidsystem.c: revision 1.35 via patch
sys/compat/darwin/darwin_ktrace.c: revision 1.6 via patch
Due to insufficient length checking it is possible for a user to cause
an integer overflow. Make ktruser return an error instead.
 1.20.6.1 13-Sep-2005  tron branches: 1.20.6.1.2;
Pull up following revision(s) (requested by christos in ticket #5846):
sys/compat/freebsd/freebsd_misc.c: revision 1.22 via patch
Range checks are not optional. The omission of this one, allows the user
to corrupt the heap and/or crash the kernel. (Christer Oeberg)
 1.20.6.1.2.1 08-Feb-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11023):
sys/kern/kern_ktrace.c: revision 1.110 via patch
sys/sys/ktrace.h: revision 1.45 via patch
sys/compat/freebsd/freebsd_misc.c: revision 1.26 via patch
sys/compat/darwin/darwin_iohidsystem.c: revision 1.35 via patch
sys/compat/darwin/darwin_ktrace.c: revision 1.6 via patch
Due to insufficient length checking it is possible for a user to cause
an integer overflow. Make ktruser return an error instead.
 1.20.2.2 08-Feb-2007  bouyer Pull up following revision(s) (requested by adrianp in ticket #11023):
sys/kern/kern_ktrace.c: revision 1.110 via patch
sys/sys/ktrace.h: revision 1.45 via patch
sys/compat/freebsd/freebsd_misc.c: revision 1.26 via patch
sys/compat/darwin/darwin_iohidsystem.c: revision 1.35 via patch
sys/compat/darwin/darwin_ktrace.c: revision 1.6 via patch
Due to insufficient length checking it is possible for a user to cause
an integer overflow. Make ktruser return an error instead.
 1.20.2.1 13-Sep-2005  tron Pull up following revision(s) (requested by christos in ticket #5846):
sys/compat/freebsd/freebsd_misc.c: revision 1.22 via patch
Range checks are not optional. The omission of this one, allows the user
to corrupt the heap and/or crash the kernel. (Christer Oeberg)
 1.21.4.5 21-Jan-2008  yamt sync with head
 1.21.4.4 03-Sep-2007  yamt sync with head.
 1.21.4.3 26-Feb-2007  yamt sync with head.
 1.21.4.2 30-Dec-2006  yamt sync with head.
 1.21.4.1 21-Jun-2006  yamt sync with head.
 1.21.2.3 24-Oct-2006  ghen Pull up following revision(s) (requested by adrianp in ticket #1564):
sys/compat/darwin/darwin_ktrace.c: revision 1.6 via patch
sys/compat/darwin/darwin_iohidsystem.c: revision 1.35 via patch
sys/compat/freebsd/freebsd_misc.c: revision 1.26 via patch
sys/kern/kern_ktrace.c: revision 1.110 via patch
sys/sys/ktrace.h: revision 1.45 via patch
make ktruser enforce the maximum buffer length, and return an error.
ktruser checks for length now.
ktruser now returns an error if the buffer length is too big.
 1.21.2.2 13-Sep-2005  tron branches: 1.21.2.2.2;
Pull up following revision(s) (requested by christos in ticket #778):
sys/compat/freebsd/freebsd_misc.c: revision 1.23
Forgot to reverse the conditional test.
 1.21.2.1 13-Sep-2005  tron Pull up following revision(s) (requested by christos in ticket #778):
sys/compat/freebsd/freebsd_misc.c: revision 1.22
Range checks are not optional. The omission of this one, allows the user
to corrupt the heap and/or crash the kernel. (Christer Oeberg)
 1.21.2.2.2.1 24-Oct-2006  ghen Pull up following revision(s) (requested by adrianp in ticket #1564):
sys/compat/darwin/darwin_ktrace.c: revision 1.6 via patch
sys/compat/darwin/darwin_iohidsystem.c: revision 1.35 via patch
sys/compat/freebsd/freebsd_misc.c: revision 1.26 via patch
sys/kern/kern_ktrace.c: revision 1.110 via patch
sys/sys/ktrace.h: revision 1.45 via patch
make ktruser enforce the maximum buffer length, and return an error.
ktruser checks for length now.
ktruser now returns an error if the buffer length is too big.
 1.24.22.2 10-Dec-2006  yamt sync with head.
 1.24.22.1 22-Oct-2006  yamt sync with head
 1.24.20.3 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.24.20.2 18-Nov-2006  ad Sync with head.
 1.24.20.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.28.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.29.14.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.29.14.1 16-Aug-2007  jmcneill Sync with HEAD.
 1.29.10.1 03-Sep-2007  skrll Sync with HEAD.
 1.29.2.1 20-Aug-2007  ad Sync with HEAD.
 1.30.10.1 26-Dec-2007  ad Sync with head.
 1.30.2.1 09-Jan-2008  matt sync with HEAD
 1.31.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.32.72.1 17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.32.54.1 03-Dec-2017  jdolecek update from HEAD
 1.32.12.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.32.12.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.33.24.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/freebsd/freebsd_machdep.c: revision 1.5
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/common/ieee80211_20.c: revision 1.7
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/common/if_media_80.c: revision 1.4
sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.33.12.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.4 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3 11-Dec-2005  christos branches: 1.3.70; 1.3.72; 1.3.74;
merge ktrace-lwp.
 1.2 26-Feb-2005  perry nuke trailing whitespace
 1.1 18-Sep-2003  pooka branches: 1.1.4; 1.1.10; 1.1.12;
Add a good enuf emulation of the MAP_STACK flag to the mmap()
syscall. This allows programs which use MAP_STACK to work instead
of failing in weird and wonderous ways.
 1.1.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.1.10.1 29-Apr-2005  kent sync with -current
 1.1.4.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.1.4.2 03-Aug-2004  skrll Sync with HEAD
 1.1.4.1 18-Sep-2003  skrll file freebsd_mman.h was added on branch ktrace-lwp on 2004-08-03 10:43:44 +0000
 1.3.74.1 16-May-2008  yamt sync with head.
 1.3.72.1 18-May-2008  yamt sync with head.
 1.3.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.7 05-Feb-2019  pgoyette Update compat_freebsd requirements list to use compat_09 vs compat
 1.6 29-Jul-2017  maxv branches: 1.6.4;
Remove exec_aout support in compat_freebsd. The only reason we still have
compat_freebsd is because of tw_cli, and it is an elf32 binary (could test,
manuel sent it to me).
 1.5 07-Mar-2014  christos branches: 1.5.6;
fix typos
 1.4 07-Mar-2014  christos c99 initializers for struct execsw
 1.3 19-Sep-2013  christos exec modules need to be of the exec kind
 1.2 16-Aug-2009  martin branches: 1.2.12; 1.2.22; 1.2.26;
Add missing include <sys/exec_aout.h>
 1.1 19-Nov-2008  ad branches: 1.1.4; 1.1.6; 1.1.8; 1.1.12;
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.1.12.3 19-Aug-2009  yamt sync with head.
 1.1.12.2 04-May-2009  yamt sync with head.
 1.1.12.1 19-Nov-2008  yamt file freebsd_mod.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:18 +0000
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 19-Nov-2008  skrll file freebsd_mod.c was added on branch nick-hppapmap on 2009-01-19 13:17:21 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 19-Nov-2008  mjf file freebsd_mod.c was added on branch mjf-devfs2 on 2009-01-17 13:28:42 +0000
 1.1.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.4.1 19-Nov-2008  haad file freebsd_mod.c was added on branch haad-dm on 2008-12-13 01:13:47 +0000
 1.2.26.1 18-May-2014  rmind sync with head
 1.2.22.2 03-Dec-2017  jdolecek update from HEAD
 1.2.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.12.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.5.6.1 28-Aug-2017  skrll Sync with HEAD
 1.6.4.1 10-Jun-2019  christos Sync with HEAD
 1.21 08-Aug-2017  maxv Move freebsd_machdep.h into sys/compat/freebsd, and don't install it. Now,
the compat_freebsd files are all contained in sys/compat/freebsd.
 1.20 19-Jan-2014  dsl branches: 1.20.6;
Rip out the code that might once have supported the freebsd ptrace
system calls.
Removes some very dodgy conversions of FP register layouts.
Most of it has been disabled since 2007 when I removed the stackgap.
 1.19 23-Nov-2009  rmind branches: 1.19.12; 1.19.22; 1.19.26;
Use lwp_getpcb() in compat code, clean from struct user.
 1.18 12-Nov-2008  ad Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.17 20-Dec-2007  dsl branches: 1.17.6; 1.17.10; 1.17.12; 1.17.16; 1.17.18;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.16 08-Dec-2007  dsl branches: 1.16.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.15 23-Jun-2007  dsl branches: 1.15.6; 1.15.8; 1.15.16;
Comment out support for FREEBSD_PT_READ_U and FREEBSD_PT_WRITE_U.
It all looks like a rather broken hack.
If nothing else it accesses userspace without copyin/out.
 1.14 04-Mar-2007  christos branches: 1.14.2; 1.14.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 09-Feb-2007  ad branches: 1.13.2;
Merge newlock2 to head.
 1.12 01-Sep-2006  matt branches: 1.12.2;
When calling PTRACE from an LKM, use sysent[SYS_ptrace].sy_call in case
the sys_ptrace symbol isn't present.
 1.11 31-Aug-2006  he Protect the include of "opt_ptrace.h" by _KERNEL_OPT.
 1.10 30-Aug-2006  matt Update for options PTRACE
 1.9 11-Dec-2005  christos branches: 1.9.4; 1.9.8;
merge ktrace-lwp.
 1.8 13-Sep-2005  christos compat code reorg.
 1.7 07-Aug-2003  agc branches: 1.7.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 18-Jan-2003  thorpej branches: 1.6.2;
Merge the nathanw_sa branch.
 1.5 16-Mar-2002  christos make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
 1.4 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.3 01-Dec-2000  jdolecek branches: 1.3.2; 1.3.4;
add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.2 03-May-1996  christos branches: 1.2.30;
gcc -Wall fixes.
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.2.30.1 08-Dec-2000  bouyer Sync with HEAD.
 1.3.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.5 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.3.2.4 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.3.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.3.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.6.2.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.2.1 03-Aug-2004  skrll Sync with HEAD
 1.7.16.5 21-Jan-2008  yamt sync with head
 1.7.16.4 03-Sep-2007  yamt sync with head.
 1.7.16.3 26-Feb-2007  yamt sync with head.
 1.7.16.2 30-Dec-2006  yamt sync with head.
 1.7.16.1 21-Jun-2006  yamt sync with head.
 1.9.8.1 03-Sep-2006  yamt sync with head.
 1.9.4.1 09-Sep-2006  rpaulo sync with head
 1.12.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.13.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.4.1 11-Jul-2007  mjf Sync with head.
 1.14.2.1 15-Jul-2007  ad Sync with head.
 1.15.16.1 26-Dec-2007  ad Sync with head.
 1.15.8.1 09-Jan-2008  matt sync with HEAD
 1.15.6.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.16.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.17.18.1 19-Jan-2009  skrll Sync with HEAD.
 1.17.16.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.17.12.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.17.12.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.17.10.2 11-Mar-2010  yamt sync with head
 1.17.10.1 04-May-2009  yamt sync with head.
 1.17.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.19.26.1 18-May-2014  rmind sync with head
 1.19.22.2 03-Dec-2017  jdolecek update from HEAD
 1.19.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.12.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.20.6.1 28-Aug-2017  skrll Sync with HEAD
 1.7 19-Jan-2014  dsl No longer used.
 1.6 04-Dec-2007  dsl branches: 1.6.50; 1.6.60; 1.6.66;
Remove all the __P
 1.5 04-Mar-2007  christos branches: 1.5.14; 1.5.16; 1.5.22; 1.5.24;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.4 11-Dec-2005  christos branches: 1.4.26;
merge ktrace-lwp.
 1.3 07-Aug-2003  agc branches: 1.3.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 13-Oct-1997  lukem branches: 1.2.50;
rcsid fascism
 1.1 10-Oct-1995  mycroft branches: 1.1.14;
FreeBSD binary compatibility module, from Noriyuki Soda.
 1.1.14.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.50.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.50.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.50.1 03-Aug-2004  skrll Sync with HEAD
 1.3.16.2 07-Dec-2007  yamt sync with head
 1.3.16.1 03-Sep-2007  yamt sync with head.
 1.4.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.5.24.1 08-Dec-2007  ad Sync with head.
 1.5.22.1 08-Dec-2007  mjf Sync with HEAD.
 1.5.16.1 09-Jan-2008  matt sync with HEAD
 1.5.14.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.6.66.1 18-May-2014  rmind sync with head
 1.6.60.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.6.50.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.4 12-May-2008  martin Follow FreeBSD's rev 1.18 (by imp):
Replace (name) with Henric Vestergaard Draboel since it was clear that
this was just cut N paste and '(name)' doesn't make any sense.
 1.3 05-Jan-1998  perry branches: 1.3.146; 1.3.148; 1.3.150; 1.3.152;
RCSID Police.
 1.2 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.3.152.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.3.150.1 16-May-2008  yamt sync with head.
 1.3.148.1 18-May-2008  yamt sync with head.
 1.3.146.1 02-Jun-2008  mjf Sync with HEAD.
 1.23 07-Sep-2021  riastradh sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.22 28-Jun-2014  maxv branches: 1.22.20; 1.22.32;
Empy comment
 1.21 22-Jun-2014  christos simplify and clarify
 1.20 21-Jun-2014  christos Avoid NULL dereference and fix sched param conversion (at least make it
do something). Pointed out by Maxime Villard
 1.19 28-Apr-2008  martin branches: 1.19.10; 1.19.24; 1.19.40; 1.19.44; 1.19.46; 1.19.48; 1.19.56; 1.19.60;
Remove clause 3 and 4 from TNF licenses
 1.18 29-Feb-2008  dogcow branches: 1.18.2; 1.18.4;
Add some of those pesky semicolons, and correct number of args.
 1.17 28-Feb-2008  elad Factor out the guts of get/setparam so it can be used from the compat code.

Make the FreeBSD and Linux compat code convert the parameters to their
native representation and call the native routines.

Remove KAUTH_PROCESS_SCHEDULER_GET/SET.

Update documentation and examples.

XXX: For now, only the Linux compat code does the priority conversion
XXX: right.

Linux priority conversion code from yamt@, thanks!

Okay yamt@.
 1.16 16-Feb-2008  elad branches: 1.16.2; 1.16.6;
Fold KAUTH_REQ_PROCESS_SCHEDULER_* to KAUTH_PROCESS_SCHEDULER_*. In other
words, don't pass an action and a request, and just use a single action to
indicate what is the operation in question.

This is the first step in fixing PR/37986, which calls for policy/priority
checking in the secmodel code. Right now we're lacking room for another
parameter required to make a decision, and this change makes room for such.
 1.15 23-Jan-2008  elad Use KAUTH_ARG(), from hannken@ - thanks!
 1.14 23-Jan-2008  elad Use SCARG() to get pid, we don't have it as a local.

Spotted by hannken@, thanks!
 1.13 23-Jan-2008  elad Tons of process scope changes.

- Add a KAUTH_PROCESS_SCHEDULER action, to handle scheduler related
requests, and add specific requests for set/get scheduler policy and
set/get scheduler parameters.

- Add a KAUTH_PROCESS_KEVENT_FILTER action, to handle kevent(2) related
requests.

- Add a KAUTH_DEVICE_TTY_STI action to handle requests to TIOCSTI.

- Add requests for the KAUTH_PROCESS_CANSEE action, indicating what
process information is being looked at (entry itself, args, env,
open files).

- Add requests for the KAUTH_PROCESS_RLIMIT action indicating set/get.

- Add requests for the KAUTH_PROCESS_CORENAME action indicating set/get.

- Make bsd44 secmodel code handle the newly added rqeuests appropriately.

All of the above make it possible to issue finer-grained kauth(9) calls in
many places, removing some KAUTH_GENERIC_ISSUSER requests.

- Remove the "CAN" from KAUTH_PROCESS_CAN{KTRACE,PROCFS,PTRACE,SIGNAL}.

Discussed with christos@ and yamt@.
 1.12 20-Dec-2007  dsl Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.11 08-Dec-2007  dsl branches: 1.11.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.10 19-Oct-2007  ad branches: 1.10.2; 1.10.4;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.9 09-Mar-2007  ad branches: 1.9.2; 1.9.14; 1.9.16; 1.9.20;
- Make the proclist_lock a mutex. The write:read ratio is unfavourable,
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.
 1.8 18-Feb-2007  dsl Factor out the replicated code that verifies that the caller is allowed
to acces the required process into a separate function (hi cut and paste).
Acquire the proclist_lock across p_find().
 1.7 05-Jan-2007  elad branches: 1.7.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.
 1.6 16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.5 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.4 23-Jul-2006  ad branches: 1.4.4; 1.4.6;
Use the LWP cached credentials where sane.
 1.3 14-May-2006  elad integrate kauth.
 1.2 18-Jan-2003  thorpej branches: 1.2.18; 1.2.32; 1.2.34; 1.2.36; 1.2.38; 1.2.40;
Merge the nathanw_sa branch.
 1.1 22-Dec-2002  gmcgarry branches: 1.1.2;
Add stubs for scheduler syscalls.
 1.1.2.3 29-Dec-2002  thorpej Fix a few bogons in LWP'ification.
 1.1.2.2 29-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 22-Dec-2002  thorpej file freebsd_sched.c was added on branch nathanw_sa on 2002-12-29 19:49:11 +0000
 1.2.40.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.38.2 06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.2.38.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.2.36.2 11-Aug-2006  yamt sync with head
 1.2.36.1 24-May-2006  yamt sync with head.
 1.2.34.1 01-Jun-2006  kardel Sync with head.
 1.2.32.1 09-Sep-2006  rpaulo sync with head
 1.2.18.9 17-Mar-2008  yamt sync with head.
 1.2.18.8 27-Feb-2008  yamt sync with head.
 1.2.18.7 04-Feb-2008  yamt sync with head.
 1.2.18.6 21-Jan-2008  yamt sync with head
 1.2.18.5 27-Oct-2007  yamt sync with head.
 1.2.18.4 03-Sep-2007  yamt sync with head.
 1.2.18.3 26-Feb-2007  yamt sync with head.
 1.2.18.2 30-Dec-2006  yamt sync with head.
 1.2.18.1 21-Jun-2006  yamt sync with head.
 1.4.6.2 10-Dec-2006  yamt sync with head.
 1.4.6.1 22-Oct-2006  yamt sync with head
 1.4.4.2 12-Jan-2007  ad Sync with head.
 1.4.4.1 18-Nov-2006  ad Sync with head.
 1.7.2.2 12-Mar-2007  rmind Sync with HEAD.
 1.7.2.1 27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.9.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.9.16.3 23-Mar-2008  matt sync with HEAD
 1.9.16.2 09-Jan-2008  matt sync with HEAD
 1.9.16.1 06-Nov-2007  matt sync with HEAD
 1.9.14.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.9.14.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.9.2.1 23-Oct-2007  ad Sync with head.
 1.10.4.1 26-Dec-2007  ad Sync with head.
 1.10.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.11.4.2 23-Jan-2008  bouyer Sync with HEAD.
 1.11.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.16.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.16.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.16.2.1 24-Mar-2008  keiichi sync with head.
 1.18.4.1 16-May-2008  yamt sync with head.
 1.18.2.1 18-May-2008  yamt sync with head.
 1.19.60.1 10-Aug-2014  tls Rebase.
 1.19.56.1 26-Jun-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1086):
sys/compat/freebsd/freebsd_sched.c 1.20-1.21

Avoid NULL dereference and fix sched param conversion (at least make it
do something). Pointed out by Maxime Villard.

Simplify and clarify.
 1.19.48.1 30-Jun-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1909):
sys/compat/freebsd/freebsd_sched.c 1.20-1.21

Avoid NULL dereference and fix sched param conversion (at least make it
do something). Pointed out by Maxime Villard.
 1.19.46.1 26-Jun-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1086):
sys/compat/freebsd/freebsd_sched.c 1.20-1.21

Avoid NULL dereference and fix sched param conversion (at least make it
do something). Pointed out by Maxime Villard.

Simplify and clarify.
 1.19.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19.40.1 26-Jun-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1086):
sys/compat/freebsd/freebsd_sched.c 1.20-1.21

Avoid NULL dereference and fix sched param conversion (at least make it
do something). Pointed out by Maxime Villard.

Simplify and clarify.
 1.19.24.1 30-Jun-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1909):
sys/compat/freebsd/freebsd_sched.c 1.20-1.21

Avoid NULL dereference and fix sched param conversion (at least make it
do something). Pointed out by Maxime Villard.
 1.19.10.1 30-Jun-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1909):
sys/compat/freebsd/freebsd_sched.c 1.20-1.21

Avoid NULL dereference and fix sched param conversion (at least make it
do something). Pointed out by Maxime Villard.
 1.22.32.1 03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/freebsd/freebsd_machdep.c: revision 1.5
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/common/ieee80211_20.c: revision 1.7
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/common/if_media_80.c: revision 1.4
sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.22.20.1 21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.1 22-Dec-2002  gmcgarry branches: 1.1.2; 1.1.102; 1.1.104; 1.1.106;
Add stubs for scheduler syscalls.
 1.1.106.1 16-May-2008  yamt sync with head.
 1.1.104.1 18-May-2008  yamt sync with head.
 1.1.102.1 02-Jun-2008  mjf Sync with HEAD.
 1.1.2.2 29-Dec-2002  thorpej Sync with HEAD.
 1.1.2.1 22-Dec-2002  thorpej file freebsd_sched.h was added on branch nathanw_sa on 2002-12-29 19:49:11 +0000
 1.1 01-Aug-2017  maxv branches: 1.1.2; 1.1.4;
Move arch/i386/i386/freebsd_* into compat/freebsd/. COMPAT_FREEBSD is
i386-specific.
 1.1.4.2 03-Dec-2017  jdolecek update from HEAD
 1.1.4.1 01-Aug-2017  jdolecek file freebsd_sigcode.S was added on branch tls-maxphys on 2017-12-03 11:36:53 +0000
 1.1.2.2 28-Aug-2017  skrll Sync with HEAD
 1.1.2.1 01-Aug-2017  skrll file freebsd_sigcode.S was added on branch nick-nhusb on 2017-08-28 17:51:58 +0000
 1.8 04-Dec-2007  dsl Remove all the __P
 1.7 11-Dec-2005  christos branches: 1.7.44; 1.7.46; 1.7.52; 1.7.56;
merge ktrace-lwp.
 1.6 26-Mar-2004  drochner branches: 1.6.16;
all ports define __HAVE_SIGINFO now, so remove the CPP conditionals
 1.5 17-Nov-2003  keihan www.netbsd.org -> www.NetBSD.org
 1.4 25-Sep-2003  christos constify sendsig/trapsignal
 1.3 06-Sep-2003  christos SA_SIGINFO changes
 1.2 26-Nov-2002  christos branches: 1.2.6;
rename: s/sa_/<compat>sa/g
 1.1 18-Jul-2000  onoe branches: 1.1.2; 1.1.4; 1.1.16;
implement new signal syscalls in FreeBSD 4.0-RELEASE, using native syscalls:
sigaction, sigprocmask, sigsuspend, and sigpending.
 1.1.16.2 06-Mar-2002  he Pull up revision 1.1 (new, requested by jonathan):
Add support for FreeBSD 4.x signals; fixes PR#9769.
 1.1.16.1 18-Jul-2000  he file freebsd_signal.h was added on branch netbsd-1-5 on 2002-03-06 22:03:18 +0000
 1.1.4.1 11-Dec-2002  thorpej Sync with HEAD.
 1.1.2.2 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.1.2.1 18-Jul-2000  bouyer file freebsd_signal.h was added on branch thorpej_scsipi on 2000-11-20 18:08:10 +0000
 1.2.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.6.1 03-Aug-2004  skrll Sync with HEAD
 1.6.16.1 07-Dec-2007  yamt sync with head
 1.7.56.1 08-Dec-2007  ad Sync with head.
 1.7.52.1 08-Dec-2007  mjf Sync with HEAD.
 1.7.46.1 09-Jan-2008  matt sync with HEAD
 1.7.44.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.7 05-Oct-2023  ad Arrange to update cached LWP credentials in userret() rather than during
syscall/trap entry, eliminating a test+branch on every syscall/trap.

This wasn't possible in the 3.99.x timeframe when l->l_cred came about
because there wasn't a reliable/timely way to force an ONPROC LWP running on
a remote CPU into the kernel (which is just about the only new thing in
this scheme).
 1.6 06-Apr-2019  kre Revert previous (1.5) and return to the one before that (1.4), and
just allow things to be broken if this is used on a system where
register_t is int (32 bits) and long is 64 bits. Badly broken...
 1.5 06-Apr-2019  kre Revert previous. Instead change ufetch_long() to ufetch_int() in
both calls (and also remove the cast on the earlier).

These replaced fuword, to fetch a register_t (ie: int).
 1.4 06-Apr-2019  kre If using a cast for &code to make it a u_long * is acceptable a
few lines earlier, it should work here too.
 1.3 06-Apr-2019  thorpej Overhaul the API used to fetch and store individual memory cells in
userspace. The old fetch(9) and store(9) APIs (fubyte(), fuword(),
subyte(), suword(), etc.) are retired and replaced with new ufetch(9)
and ustore(9) APIs that can return proper error codes, etc. and are
implemented consistently across all platforms. The interrupt-safe
variants are no longer supported (and several of the existing attempts
at fuswintr(), etc. were buggy and not actually interrupt-safe).

Also augmement the ucas(9) API, making it consistently available on
all plaforms, supporting uniprocessor and multiprocessor systems, even
those that do not have CAS or LL/SC primitives.

Welcome to NetBSD 8.99.37.
 1.2 08-Aug-2017  maxv branches: 1.2.2; 1.2.4; 1.2.8;
Move freebsd_machdep.h into sys/compat/freebsd, and don't install it. Now,
the compat_freebsd files are all contained in sys/compat/freebsd.
 1.1 01-Aug-2017  maxv Move arch/i386/i386/freebsd_* into compat/freebsd/. COMPAT_FREEBSD is
i386-specific.
 1.2.8.1 10-Jun-2019  christos Sync with HEAD
 1.2.4.2 03-Dec-2017  jdolecek update from HEAD
 1.2.4.1 08-Aug-2017  jdolecek file freebsd_syscall.c was added on branch tls-maxphys on 2017-12-03 11:36:53 +0000
 1.2.2.2 28-Aug-2017  skrll Sync with HEAD
 1.2.2.1 08-Aug-2017  skrll file freebsd_syscall.c was added on branch nick-nhusb on 2017-08-28 17:51:58 +0000
 1.90 18-Jun-2019  christos regen
 1.89 10-Aug-2018  pgoyette Regen
 1.88 06-Jan-2018  kamil branches: 1.88.2; 1.88.4;
Revert vadvise(2) removal

This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
 1.87 19-Dec-2017  kamil compat/freebsd: Drop SYS_vadvise

The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
 1.86 19-Dec-2017  kamil compat/freebsd: Drop SYS_sbrk

sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
 1.85 19-Dec-2017  kamil compat freebsd: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
 1.84 10-May-2017  riastradh regen
 1.83 16-Jan-2017  christos branches: 1.83.4;
regen
 1.82 13-Jan-2017  christos branches: 1.82.2;
regen
 1.81 24-Sep-2015  christos branches: 1.81.2;
Regen
 1.80 07-Mar-2015  christos regen
 1.79 07-Nov-2013  njoly branches: 1.79.6;
Regen for dup/dup2/dup3 argument types fix.
 1.78 10-Mar-2012  joerg branches: 1.78.2; 1.78.4;
P1003_1B_SEMAPHORE is no longer optional.
 1.77 06-Mar-2011  bouyer branches: 1.77.4; 1.77.8;
merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.76 02-Mar-2010  pooka branches: 1.76.2; 1.76.4; 1.76.6;
regen:
- remove nfssvc / fs_nfs.h / #ifdef NFS
- make getfh unconditional
 1.75 02-Mar-2010  pooka regen for conditional lfs syscall removal
 1.74 14-Dec-2009  matt branches: 1.74.2;
Regen (new makesyscalls.sh)
 1.73 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.72 11-Jan-2009  christos merge christos-time_t
 1.71 19-Nov-2008  ad Regen.
 1.70 14-Nov-2008  ad Regen.
 1.69 20-Dec-2007  dsl branches: 1.69.6; 1.69.8; 1.69.12; 1.69.18; 1.69.20;
regen
 1.68 13-Jul-2007  dsl branches: 1.68.8; 1.68.16; 1.68.20;
Update generated files.
 1.67 04-Mar-2007  christos branches: 1.67.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.66 01-Sep-2006  matt branches: 1.66.8;
Regen.
 1.65 30-Aug-2006  matt Regen (for PTRACE).
 1.64 31-Jul-2006  martin Make filehandles opaque to userland
 1.63 26-Jun-2006  mrg regenerate.
 1.62 04-May-2006  christos branches: 1.62.4;
Regen
 1.61 11-Dec-2005  christos branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10; 1.61.12;
merge ktrace-lwp.
 1.60 13-Sep-2005  christos compat code reorg.
 1.59 19-Aug-2005  christos 64 bit inode changes.
 1.58 26-Feb-2005  perry branches: 1.58.4;
regen
 1.57 22-Feb-2005  heas Re-gen for sysctl emulation
 1.56 11-May-2004  drochner branches: 1.56.4; 1.56.6;
regen
 1.55 10-May-2004  jonathan Regen src/sys/compat/freebsd_sys{call.h,callargs.h,calls.c,ent.c} from
syscalls.master rev 1.45, with COMPAT_2.0 fix.
 1.54 21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.53 29-Jan-2004  tsarna uuidgen(2) syscall. Originally from FreeBSD, ported by John Franklin in
PR#23470, with minor updates by me. This is only the syscall support
from that PR, for now.

Changes: port over fix from FreeBSD for multicast address generation.
Changed bcopy to memcpy. For now, #ifdef notyet the portions of
kern_uuid.c that are meant to be used by (currently nonexistent) other
things in the kernel. Added syscall to COMPAT_FREEBSD as well, though
that's currently not useful, as any program new enough to use this call
also uses other syscalls we don't (yet) emulate.
 1.52 26-Nov-2003  jdolecek Regen: add new syscalls to the list
 1.51 18-Sep-2003  pooka regen
 1.50 18-Jan-2003  thorpej branches: 1.50.2;
Regen to get correct RCS ID.
 1.49 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.48 22-Dec-2002  gmcgarry Add stubs for scheduler syscalls.
 1.47 09-Oct-2002  pooka regen for rfork
 1.46 03-May-2002  eeh Regen.
 1.45 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.44 27-Oct-2001  jdolecek Regen:
Hook in minherit(2), fhstatfs(2), fhopen(2), fhstat(2).
Adresses kern/8622 by Paul Shupak.
 1.43 30-May-2001  mrg branches: 1.43.2; 1.43.6;
use _KERNEL_OPT.
 1.42 27-Jan-2001  thorpej branches: 1.42.2;
Regen; add sy_flags.
 1.41 17-Dec-2000  jdolecek regen
 1.40 09-Dec-2000  mycroft Regen.
 1.39 09-Dec-2000  mycroft Regen.
 1.38 09-Dec-2000  mycroft Regen.
 1.37 18-Aug-2000  cgd update for changed makesyscalls.master
 1.36 08-Aug-2000  itojun regen
 1.35 07-Aug-2000  bjh21 Second phase of changes to remove ntp_adjtime(2) from the kernel entirely if
NTP is not defined.

Also removes sysctl_ntptime, since that's unreferenced without NTP.

ntp_gettime(2) is left alone, since it doesn't raise SIGSYS, which sys_nosys()
does.
 1.34 18-Jul-2000  onoe implement new signal syscalls in FreeBSD 4.0-RELEASE, using native syscalls:
sigaction, sigprocmask, sigsuspend, and sigpending.
 1.33 23-May-2000  tv branches: 1.33.4;
Add names for many syscalls not yet implemented, including those in
FreeBSD 4.0-RELEASE. Also implement the following using existing NetBSD
syscalls: pread, pwrite, getsid, mlockall, munlockall, __getcwd.
 1.32 21-Apr-2000  minoura Regen.
 1.31 25-Aug-1999  thorpej branches: 1.31.2;
Regen.
 1.30 12-Jul-1999  kleink Regen.
 1.29 09-Jun-1999  drochner regen
 1.28 09-Feb-1999  christos branches: 1.28.4;
Regen
 1.27 10-Dec-1998  christos Regen
 1.26 19-Oct-1998  tron Regen.
 1.25 11-Sep-1998  mycroft Regen.
 1.24 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.23 25-Jun-1998  thorpej Regen: defopt KTRACE
 1.22 02-May-1998  christos regen.
 1.21 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.20 19-Feb-1998  thorpej Regen: syscalls.master and makesyscalls.sh changed.
 1.19 22-Jan-1998  mycroft Regen.
 1.18 22-Jan-1998  mycroft Put a local copy of the SysV IPC compatibility from compat/common in here, so
it's not dependent on COMPAT_10. Also, fix translation of shmctl(), since
FreeBSD's is a little different.
 1.17 09-Jan-1998  thorpej Regen.
 1.16 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.15 05-Jan-1998  perry regened with RCSIDs in place
 1.14 30-Nov-1997  veego Regen.
 1.13 18-Oct-1997  christos branches: 1.13.2;
Regen.
 1.12 16-Oct-1997  christos Regen.
 1.11 16-Oct-1997  mycroft Regen.
 1.10 10-Oct-1997  enami Regen from syscalls.master 1.9.
 1.9 10-Oct-1997  fvdl Regen.
 1.8 13-Jun-1997  thorpej branches: 1.8.4;
Regen: Use compat_12_sys_swapon().
 1.7 31-Jan-1997  thorpej Syscalls.master changed, regen. (NFSCLIENT -> NFS)
 1.6 13-Jan-1997  thorpej branches: 1.6.2;
Regen; makesyscalls.sh emits comments now.
 1.5 20-Sep-1996  christos regen
 1.4 23-Jun-1996  mycroft Catch up with setre[ug]id() changes.
 1.3 10-Oct-1995  mycroft branches: 1.3.4;
Fix minor oversight.
 1.2 10-Oct-1995  mycroft Fix typo.
 1.1 10-Oct-1995  mycroft Output of makesyscalls.sh.
 1.3.4.1 10-Dec-1996  mycroft Regen.
 1.6.2.1 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.8.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.2.2 30-Sep-1998  cgd regen after pull-up of syscalls.master rev 1.16 from trunk (tv)
 1.13.2.1 29-Jan-1998  mellon Regen
 1.28.4.2 02-Aug-1999  thorpej Regen.
 1.28.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.31.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.31.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.31.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.33.4.1 06-Mar-2002  he Pull up regenerated files (requested by jonathan):
Add support for FreeBSD 4.x signals; fixes PR#9769.
 1.42.2.7 29-Dec-2002  thorpej Sync with HEAD.
 1.42.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.42.2.5 29-May-2002  nathanw Regen.
 1.42.2.4 28-Feb-2002  nathanw Regen.
 1.42.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.42.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.42.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.43.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.43.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.43.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.50.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.50.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.50.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.50.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.50.2.1 03-Aug-2004  skrll Sync with HEAD
 1.56.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.56.4.1 29-Apr-2005  kent sync with -current
 1.58.4.4 21-Jan-2008  yamt sync with head
 1.58.4.3 03-Sep-2007  yamt sync with head.
 1.58.4.2 30-Dec-2006  yamt sync with head.
 1.58.4.1 21-Jun-2006  yamt sync with head.
 1.61.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.61.10.1 11-May-2006  elad sync with head
 1.61.8.3 03-Sep-2006  yamt sync with head.
 1.61.8.2 11-Aug-2006  yamt sync with head
 1.61.8.1 24-May-2006  yamt sync with head.
 1.61.6.1 01-Jun-2006  kardel Sync with head.
 1.61.4.1 09-Sep-2006  rpaulo sync with head
 1.62.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.66.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.67.2.1 15-Jul-2007  ad Sync with head.
 1.68.20.1 02-Jan-2008  bouyer Sync with HEAD
 1.68.16.1 26-Dec-2007  ad Sync with head.
 1.68.8.1 09-Jan-2008  matt sync with HEAD
 1.69.20.1 19-Jan-2009  skrll Sync with HEAD.
 1.69.18.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.69.12.2 11-Mar-2010  yamt sync with head
 1.69.12.1 04-May-2009  yamt sync with head.
 1.69.8.2 20-Nov-2008  christos merge with head.
 1.69.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.69.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.74.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.76.6.1 08-Feb-2011  bouyer Regen: quotactl compat
 1.76.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.76.2.1 21-Apr-2011  rmind sync with head
 1.77.8.1 11-Mar-2012  mrg sync to latest -current
 1.77.4.2 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.77.4.1 17-Apr-2012  yamt sync with head
 1.78.4.1 18-May-2014  rmind sync with head
 1.78.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.79.6.1 06-Apr-2015  skrll Sync with HEAD
 1.81.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.82.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.83.4.1 11-May-2017  pgoyette Sync with HEAD
 1.88.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.88.4.1 10-Jun-2019  christos Sync with HEAD
 1.88.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.93 18-Jun-2019  christos regen
 1.92 10-Aug-2018  pgoyette Regen
 1.91 06-Jan-2018  kamil branches: 1.91.2; 1.91.4;
Revert vadvise(2) removal

This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
 1.90 19-Dec-2017  kamil compat/freebsd: Drop SYS_vadvise

The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
 1.89 19-Dec-2017  kamil compat/freebsd: Drop SYS_sbrk

sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
 1.88 19-Dec-2017  kamil compat freebsd: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
 1.87 10-May-2017  riastradh regen
 1.86 16-Jan-2017  christos branches: 1.86.4;
regen
 1.85 13-Jan-2017  christos branches: 1.85.2;
regen
 1.84 24-Sep-2015  christos branches: 1.84.2;
Regen
 1.83 07-Mar-2015  christos regen
 1.82 07-Nov-2013  njoly branches: 1.82.6;
Regen for dup/dup2/dup3 argument types fix.
 1.81 10-Mar-2012  joerg branches: 1.81.2; 1.81.4;
P1003_1B_SEMAPHORE is no longer optional.
 1.80 06-Mar-2011  bouyer branches: 1.80.4; 1.80.8;
merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.79 02-Mar-2010  pooka branches: 1.79.2; 1.79.4; 1.79.6;
regen:
- remove nfssvc / fs_nfs.h / #ifdef NFS
- make getfh unconditional
 1.78 02-Mar-2010  pooka regen for conditional lfs syscall removal
 1.77 14-Dec-2009  matt branches: 1.77.2;
Regen (new makesyscalls.sh)
 1.76 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.75 11-Jan-2009  christos merge christos-time_t
 1.74 19-Nov-2008  ad Regen.
 1.73 14-Nov-2008  ad Regen.
 1.72 20-Dec-2007  dsl branches: 1.72.6; 1.72.8; 1.72.12; 1.72.18; 1.72.20;
regen
 1.71 13-Jul-2007  dsl branches: 1.71.8; 1.71.16; 1.71.20;
Update generated files.
 1.70 04-Mar-2007  christos branches: 1.70.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.69 01-Sep-2006  matt branches: 1.69.8;
Regen.
 1.68 30-Aug-2006  matt Regen (for PTRACE).
 1.67 31-Jul-2006  martin Make filehandles opaque to userland
 1.66 26-Jun-2006  mrg regenerate.
 1.65 14-May-2006  elad branches: 1.65.4;
integrate kauth.
 1.64 04-May-2006  christos Regen
 1.63 11-Dec-2005  christos branches: 1.63.4; 1.63.6; 1.63.8; 1.63.10; 1.63.12;
merge ktrace-lwp.
 1.62 13-Sep-2005  christos compat code reorg.
 1.61 19-Aug-2005  christos 64 bit inode changes.
 1.60 26-Feb-2005  perry branches: 1.60.4;
regen
 1.59 22-Feb-2005  heas Re-gen for sysctl emulation
 1.58 11-May-2004  drochner branches: 1.58.4; 1.58.6;
regen
 1.57 10-May-2004  jonathan Regen src/sys/compat/freebsd_sys{call.h,callargs.h,calls.c,ent.c} from
syscalls.master rev 1.45, with COMPAT_2.0 fix.
 1.56 21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.55 29-Jan-2004  tsarna uuidgen(2) syscall. Originally from FreeBSD, ported by John Franklin in
PR#23470, with minor updates by me. This is only the syscall support
from that PR, for now.

Changes: port over fix from FreeBSD for multicast address generation.
Changed bcopy to memcpy. For now, #ifdef notyet the portions of
kern_uuid.c that are meant to be used by (currently nonexistent) other
things in the kernel. Added syscall to COMPAT_FREEBSD as well, though
that's currently not useful, as any program new enough to use this call
also uses other syscalls we don't (yet) emulate.
 1.54 26-Nov-2003  jdolecek Regen: add new syscalls to the list
 1.53 18-Sep-2003  pooka regen
 1.52 18-Jan-2003  thorpej branches: 1.52.2;
Regen to get correct RCS ID.
 1.51 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.50 22-Dec-2002  gmcgarry Add stubs for scheduler syscalls.
 1.49 09-Oct-2002  pooka regen for rfork
 1.48 03-May-2002  eeh Regen.
 1.47 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.46 27-Oct-2001  jdolecek Regen:
Hook in minherit(2), fhstatfs(2), fhopen(2), fhstat(2).
Adresses kern/8622 by Paul Shupak.
 1.45 30-May-2001  mrg branches: 1.45.2; 1.45.6;
use _KERNEL_OPT.
 1.44 27-Jan-2001  thorpej branches: 1.44.2;
Regen; add sy_flags.
 1.43 17-Dec-2000  jdolecek regen
 1.42 09-Dec-2000  mycroft Regen.
 1.41 09-Dec-2000  mycroft Regen.
 1.40 09-Dec-2000  mycroft Regen.
 1.39 18-Aug-2000  cgd update for changed makesyscalls.master
 1.38 18-Aug-2000  cgd update for changed makesyscalls.sh
 1.37 08-Aug-2000  itojun regen
 1.36 08-Aug-2000  itojun s/#ifdefined/#ifdef/
 1.35 07-Aug-2000  bjh21 Second phase of changes to remove ntp_adjtime(2) from the kernel entirely if
NTP is not defined.

Also removes sysctl_ntptime, since that's unreferenced without NTP.

ntp_gettime(2) is left alone, since it doesn't raise SIGSYS, which sys_nosys()
does.
 1.34 18-Jul-2000  onoe implement new signal syscalls in FreeBSD 4.0-RELEASE, using native syscalls:
sigaction, sigprocmask, sigsuspend, and sigpending.
 1.33 23-May-2000  tv branches: 1.33.4;
Add names for many syscalls not yet implemented, including those in
FreeBSD 4.0-RELEASE. Also implement the following using existing NetBSD
syscalls: pread, pwrite, getsid, mlockall, munlockall, __getcwd.
 1.32 21-Apr-2000  minoura Regen.
 1.31 25-Aug-1999  thorpej branches: 1.31.2;
Regen.
 1.30 12-Jul-1999  kleink Regen.
 1.29 09-Jun-1999  drochner regen
 1.28 09-Feb-1999  christos branches: 1.28.4;
Regen
 1.27 10-Dec-1998  christos Regen
 1.26 19-Oct-1998  tron Regen.
 1.25 03-Oct-1998  eeh Fix big-endian syscall args.
 1.24 11-Sep-1998  mycroft Regen.
 1.23 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.22 25-Jun-1998  thorpej Regen: defopt KTRACE
 1.21 02-May-1998  christos regen.
 1.20 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.19 19-Feb-1998  thorpej Regen: syscalls.master and makesyscalls.sh changed.
 1.18 22-Jan-1998  mycroft Regen.
 1.17 22-Jan-1998  mycroft Put a local copy of the SysV IPC compatibility from compat/common in here, so
it's not dependent on COMPAT_10. Also, fix translation of shmctl(), since
FreeBSD's is a little different.
 1.16 09-Jan-1998  thorpej Regen.
 1.15 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.14 05-Jan-1998  perry regened with RCSIDs in place
 1.13 30-Nov-1997  veego Regen.
 1.12 18-Oct-1997  christos branches: 1.12.2;
Regen.
 1.11 16-Oct-1997  christos Regen.
 1.10 16-Oct-1997  mycroft Regen.
 1.9 10-Oct-1997  enami Regen from syscalls.master 1.9.
 1.8 10-Oct-1997  fvdl Regen.
 1.7 13-Jun-1997  thorpej branches: 1.7.4;
Regen: Use compat_12_sys_swapon().
 1.6 31-Jan-1997  thorpej branches: 1.6.2;
Syscalls.master changed, regen. (NFSCLIENT -> NFS)
 1.5 20-Sep-1996  christos branches: 1.5.2;
regen
 1.4 23-Jun-1996  mycroft Catch up with setre[ug]id() changes.
 1.3 10-Oct-1995  mycroft branches: 1.3.4;
Fix minor oversight.
 1.2 10-Oct-1995  mycroft branches: 1.2.2;
Fix typo.
 1.1 10-Oct-1995  mycroft Output of makesyscalls.sh.
 1.2.2.1 20-Oct-1995  pk getppid => sys_getppid; re-ran makesyscalls.sh. (PR#1643).
 1.3.4.1 10-Dec-1996  mycroft Regen.
 1.5.2.2 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.5.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.6.2.1 14-Feb-1997  mrg regen.
 1.7.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.2.2 30-Sep-1998  cgd regen after pull-up of syscalls.master rev 1.16 from trunk (tv)
 1.12.2.1 29-Jan-1998  mellon Regen
 1.28.4.2 02-Aug-1999  thorpej Regen.
 1.28.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.31.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.31.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.31.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.33.4.1 06-Mar-2002  he Pull up regenerated files (requested by jonathan):
Add support for FreeBSD 4.x signals; fixes PR#9769.
 1.44.2.8 29-Dec-2002  thorpej Sync with HEAD.
 1.44.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.44.2.6 20-Jun-2002  nathanw Catch up to -current.
 1.44.2.5 29-May-2002  nathanw Regen.
 1.44.2.4 28-Feb-2002  nathanw Regen.
 1.44.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.44.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.44.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.45.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.45.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.45.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.52.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.52.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.52.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.52.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.52.2.1 03-Aug-2004  skrll Sync with HEAD
 1.58.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.58.4.1 29-Apr-2005  kent sync with -current
 1.60.4.4 21-Jan-2008  yamt sync with head
 1.60.4.3 03-Sep-2007  yamt sync with head.
 1.60.4.2 30-Dec-2006  yamt sync with head.
 1.60.4.1 21-Jun-2006  yamt sync with head.
 1.63.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.63.10.1 11-May-2006  elad sync with head
 1.63.8.3 03-Sep-2006  yamt sync with head.
 1.63.8.2 11-Aug-2006  yamt sync with head
 1.63.8.1 24-May-2006  yamt sync with head.
 1.63.6.1 01-Jun-2006  kardel Sync with head.
 1.63.4.1 09-Sep-2006  rpaulo sync with head
 1.65.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.69.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.70.2.1 15-Jul-2007  ad Sync with head.
 1.71.20.1 02-Jan-2008  bouyer Sync with HEAD
 1.71.16.1 26-Dec-2007  ad Sync with head.
 1.71.8.1 09-Jan-2008  matt sync with HEAD
 1.72.20.1 19-Jan-2009  skrll Sync with HEAD.
 1.72.18.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.72.12.2 11-Mar-2010  yamt sync with head
 1.72.12.1 04-May-2009  yamt sync with head.
 1.72.8.2 20-Nov-2008  christos merge with head.
 1.72.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.72.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.77.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.79.6.1 08-Feb-2011  bouyer Regen: quotactl compat
 1.79.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.79.2.1 21-Apr-2011  rmind sync with head
 1.80.8.1 11-Mar-2012  mrg sync to latest -current
 1.80.4.2 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.80.4.1 17-Apr-2012  yamt sync with head
 1.81.4.1 18-May-2014  rmind sync with head
 1.81.2.2 03-Dec-2017  jdolecek update from HEAD
 1.81.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.82.6.2 28-Aug-2017  skrll Sync with HEAD
 1.82.6.1 06-Apr-2015  skrll Sync with HEAD
 1.84.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.85.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.86.4.1 11-May-2017  pgoyette Sync with HEAD
 1.91.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.91.4.1 10-Jun-2019  christos Sync with HEAD
 1.91.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.91 18-Jun-2019  christos regen
 1.90 10-Aug-2018  pgoyette Regen
 1.89 06-Jan-2018  kamil branches: 1.89.2; 1.89.4;
Revert vadvise(2) removal

This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
 1.88 19-Dec-2017  kamil compat/freebsd: Drop SYS_vadvise

The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
 1.87 19-Dec-2017  kamil compat/freebsd: Drop SYS_sbrk

sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
 1.86 19-Dec-2017  kamil compat freebsd: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
 1.85 08-Aug-2017  maxv Move freebsd_machdep.h into sys/compat/freebsd, and don't install it. Now,
the compat_freebsd files are all contained in sys/compat/freebsd.
 1.84 10-May-2017  riastradh regen
 1.83 16-Jan-2017  christos branches: 1.83.4;
regen
 1.82 13-Jan-2017  christos branches: 1.82.2;
regen
 1.81 24-Sep-2015  christos branches: 1.81.2;
Regen
 1.80 07-Mar-2015  christos regen
 1.79 07-Nov-2013  njoly branches: 1.79.6;
Regen for dup/dup2/dup3 argument types fix.
 1.78 10-Mar-2012  joerg branches: 1.78.2; 1.78.4;
P1003_1B_SEMAPHORE is no longer optional.
 1.77 06-Mar-2011  bouyer branches: 1.77.4; 1.77.8;
merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.76 02-Mar-2010  pooka branches: 1.76.2; 1.76.4; 1.76.6;
regen:
- remove nfssvc / fs_nfs.h / #ifdef NFS
- make getfh unconditional
 1.75 02-Mar-2010  pooka regen for conditional lfs syscall removal
 1.74 14-Dec-2009  matt branches: 1.74.2;
Regen (new makesyscalls.sh)
 1.73 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.72 11-Jan-2009  christos merge christos-time_t
 1.71 19-Nov-2008  ad Regen.
 1.70 14-Nov-2008  ad Regen.
 1.69 20-Dec-2007  dsl branches: 1.69.6; 1.69.8; 1.69.12; 1.69.18; 1.69.20;
regen
 1.68 13-Jul-2007  dsl branches: 1.68.8; 1.68.16; 1.68.20;
Update generated files.
 1.67 09-Feb-2007  ad branches: 1.67.6;
Merge newlock2 to head.
 1.66 01-Sep-2006  matt branches: 1.66.2;
Regen.
 1.65 30-Aug-2006  matt Regen (for PTRACE).
 1.64 31-Jul-2006  martin Make filehandles opaque to userland
 1.63 26-Jun-2006  mrg regenerate.
 1.62 04-May-2006  christos branches: 1.62.4;
Regen
 1.61 11-Dec-2005  christos branches: 1.61.4; 1.61.6; 1.61.8; 1.61.10; 1.61.12;
merge ktrace-lwp.
 1.60 13-Sep-2005  christos compat code reorg.
 1.59 19-Aug-2005  christos 64 bit inode changes.
 1.58 26-Feb-2005  perry branches: 1.58.4;
regen
 1.57 22-Feb-2005  heas Re-gen for sysctl emulation
 1.56 11-May-2004  drochner branches: 1.56.4; 1.56.6;
regen
 1.55 10-May-2004  jonathan Regen src/sys/compat/freebsd_sys{call.h,callargs.h,calls.c,ent.c} from
syscalls.master rev 1.45, with COMPAT_2.0 fix.
 1.54 21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.53 29-Jan-2004  tsarna uuidgen(2) syscall. Originally from FreeBSD, ported by John Franklin in
PR#23470, with minor updates by me. This is only the syscall support
from that PR, for now.

Changes: port over fix from FreeBSD for multicast address generation.
Changed bcopy to memcpy. For now, #ifdef notyet the portions of
kern_uuid.c that are meant to be used by (currently nonexistent) other
things in the kernel. Added syscall to COMPAT_FREEBSD as well, though
that's currently not useful, as any program new enough to use this call
also uses other syscalls we don't (yet) emulate.
 1.52 26-Nov-2003  jdolecek Regen: add new syscalls to the list
 1.51 18-Sep-2003  pooka regen
 1.50 18-Jan-2003  thorpej branches: 1.50.2;
Regen to get correct RCS ID.
 1.49 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.48 22-Dec-2002  gmcgarry Add stubs for scheduler syscalls.
 1.47 09-Oct-2002  pooka regen for rfork
 1.46 03-May-2002  eeh Regen.
 1.45 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.44 27-Oct-2001  jdolecek Regen:
Hook in minherit(2), fhstatfs(2), fhopen(2), fhstat(2).
Adresses kern/8622 by Paul Shupak.
 1.43 30-May-2001  mrg branches: 1.43.2; 1.43.6;
use _KERNEL_OPT.
 1.42 27-Jan-2001  thorpej branches: 1.42.2;
Regen; add sy_flags.
 1.41 17-Dec-2000  jdolecek regen
 1.40 09-Dec-2000  mycroft Regen.
 1.39 09-Dec-2000  mycroft Regen.
 1.38 09-Dec-2000  mycroft Regen.
 1.37 13-Nov-2000  jdolecek change the type of *syscallnames[] array to 'const char * const foo[]'
 1.36 18-Aug-2000  cgd update for changed makesyscalls.master
 1.35 08-Aug-2000  itojun regen
 1.34 07-Aug-2000  bjh21 Second phase of changes to remove ntp_adjtime(2) from the kernel entirely if
NTP is not defined.

Also removes sysctl_ntptime, since that's unreferenced without NTP.

ntp_gettime(2) is left alone, since it doesn't raise SIGSYS, which sys_nosys()
does.
 1.33 18-Jul-2000  onoe implement new signal syscalls in FreeBSD 4.0-RELEASE, using native syscalls:
sigaction, sigprocmask, sigsuspend, and sigpending.
 1.32 23-May-2000  tv branches: 1.32.4;
Add names for many syscalls not yet implemented, including those in
FreeBSD 4.0-RELEASE. Also implement the following using existing NetBSD
syscalls: pread, pwrite, getsid, mlockall, munlockall, __getcwd.
 1.31 21-Apr-2000  minoura Regen.
 1.30 25-Aug-1999  thorpej branches: 1.30.2;
Regen.
 1.29 12-Jul-1999  kleink Regen.
 1.28 09-Jun-1999  drochner regen
 1.27 09-Feb-1999  christos branches: 1.27.4;
Regen
 1.26 10-Dec-1998  christos Regen
 1.25 19-Oct-1998  tron Regen.
 1.24 11-Sep-1998  mycroft Regen.
 1.23 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.22 25-Jun-1998  thorpej Regen: defopt KTRACE
 1.21 02-May-1998  christos regen.
 1.20 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.19 19-Feb-1998  thorpej Regen: syscalls.master and makesyscalls.sh changed.
 1.18 22-Jan-1998  mycroft Regen.
 1.17 22-Jan-1998  mycroft Put a local copy of the SysV IPC compatibility from compat/common in here, so
it's not dependent on COMPAT_10. Also, fix translation of shmctl(), since
FreeBSD's is a little different.
 1.16 09-Jan-1998  thorpej Regen.
 1.15 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.14 05-Jan-1998  perry regened with RCSIDs in place
 1.13 30-Nov-1997  veego Regen.
 1.12 18-Oct-1997  christos branches: 1.12.2;
Regen.
 1.11 16-Oct-1997  christos Regen.
 1.10 16-Oct-1997  mycroft Regen.
 1.9 10-Oct-1997  enami Regen from syscalls.master 1.9.
 1.8 10-Oct-1997  fvdl Regen.
 1.7 13-Jun-1997  thorpej branches: 1.7.4;
Regen: Use compat_12_sys_swapon().
 1.6 31-Jan-1997  thorpej Syscalls.master changed, regen. (NFSCLIENT -> NFS)
 1.5 20-Sep-1996  christos branches: 1.5.2;
regen
 1.4 23-Jun-1996  mycroft Catch up with setre[ug]id() changes.
 1.3 10-Oct-1995  mycroft branches: 1.3.4;
Fix minor oversight.
 1.2 10-Oct-1995  mycroft Fix typo.
 1.1 10-Oct-1995  mycroft Output of makesyscalls.sh.
 1.3.4.1 10-Dec-1996  mycroft Regen.
 1.5.2.2 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.5.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.7.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.2.2 30-Sep-1998  cgd regen after pull-up of syscalls.master rev 1.16 from trunk (tv)
 1.12.2.1 29-Jan-1998  mellon Regen
 1.27.4.2 02-Aug-1999  thorpej Regen.
 1.27.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.30.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.30.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.30.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.30.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.32.4.1 06-Mar-2002  he Pull up regenerated files (requested by jonathan):
Add support for FreeBSD 4.x signals; fixes PR#9769.
 1.42.2.8 29-Dec-2002  thorpej Sync with HEAD.
 1.42.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.42.2.6 20-Jun-2002  nathanw Catch up to -current.
 1.42.2.5 29-May-2002  nathanw Regen.
 1.42.2.4 28-Feb-2002  nathanw Regen.
 1.42.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.42.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.42.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.43.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.43.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.43.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.50.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.50.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.50.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.50.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.50.2.1 03-Aug-2004  skrll Sync with HEAD
 1.56.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.56.4.1 29-Apr-2005  kent sync with -current
 1.58.4.5 21-Jan-2008  yamt sync with head
 1.58.4.4 03-Sep-2007  yamt sync with head.
 1.58.4.3 26-Feb-2007  yamt sync with head.
 1.58.4.2 30-Dec-2006  yamt sync with head.
 1.58.4.1 21-Jun-2006  yamt sync with head.
 1.61.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.61.10.1 11-May-2006  elad sync with head
 1.61.8.3 03-Sep-2006  yamt sync with head.
 1.61.8.2 11-Aug-2006  yamt sync with head
 1.61.8.1 24-May-2006  yamt sync with head.
 1.61.6.1 01-Jun-2006  kardel Sync with head.
 1.61.4.1 09-Sep-2006  rpaulo sync with head
 1.62.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.66.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.67.6.1 15-Jul-2007  ad Sync with head.
 1.68.20.1 02-Jan-2008  bouyer Sync with HEAD
 1.68.16.1 26-Dec-2007  ad Sync with head.
 1.68.8.1 09-Jan-2008  matt sync with HEAD
 1.69.20.1 19-Jan-2009  skrll Sync with HEAD.
 1.69.18.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.69.12.2 11-Mar-2010  yamt sync with head
 1.69.12.1 04-May-2009  yamt sync with head.
 1.69.8.2 20-Nov-2008  christos merge with head.
 1.69.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.69.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.74.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.76.6.1 08-Feb-2011  bouyer Regen: quotactl compat
 1.76.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.76.2.1 21-Apr-2011  rmind sync with head
 1.77.8.1 11-Mar-2012  mrg sync to latest -current
 1.77.4.2 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.77.4.1 17-Apr-2012  yamt sync with head
 1.78.4.1 18-May-2014  rmind sync with head
 1.78.2.2 03-Dec-2017  jdolecek update from HEAD
 1.78.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.79.6.3 28-Aug-2017  skrll Sync with HEAD
 1.79.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.79.6.1 06-Apr-2015  skrll Sync with HEAD
 1.81.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.82.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.83.4.1 11-May-2017  pgoyette Sync with HEAD
 1.89.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.89.4.1 10-Jun-2019  christos Sync with HEAD
 1.89.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.19 14-Feb-2015  dholland typo in comment
 1.18 18-Oct-2014  snj branches: 1.18.2;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.17 10-Oct-2014  maxv I'm not sure reading from an unsanitized userland pointer is a good idea.
Some users might be tempted to give 0x01, in which case the kernel will
crash.
 1.16 25-Feb-2014  pooka branches: 1.16.4;
Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
 1.15 19-Nov-2008  ad branches: 1.15.16; 1.15.22; 1.15.26; 1.15.28; 1.15.30; 1.15.36;
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.14 28-Apr-2008  martin branches: 1.14.2; 1.14.6; 1.14.8; 1.14.10; 1.14.16; 1.14.20;
Remove clause 3 and 4 from TNF licenses
 1.13 22-Apr-2008  ad branches: 1.13.2;
Repair copyright.
 1.12 07-Jan-2008  ad branches: 1.12.6; 1.12.8;
Patch up sysctl locking:

- Lock processes, credentials, filehead etc correctly.
- Acquire a read hold on sysctl_treelock if only doing a query.
- Don't wire down the output buffer. It doesn't work correctly and the code
regularly does long term sleeps with it held - it's not worth it.
- Don't hold locks other than sysctl_lock while doing copyout().
- Drop sysctl_lock while doing copyout / allocating memory in a few places.
- Don't take kernel_lock for sysctl.
- Fix a number of bugs spotted along the way
 1.11 20-Dec-2007  dsl Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.10 08-Dec-2007  dsl branches: 1.10.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.9 15-Aug-2007  ad branches: 1.9.2; 1.9.8; 1.9.10;
Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
 1.8 09-Feb-2007  ad branches: 1.8.6; 1.8.14; 1.8.18;
Merge newlock2 to head.
 1.7 24-Sep-2006  dbj use _KERNEL_OPT instead of _LKM to check whether to include "opt_ktrace.h"
 1.6 24-Sep-2006  dogcow opt_ktrace.h doesn't exist when building LKMs.
 1.5 23-Sep-2006  manu Add sysctl tracing to emulations.
While we are there, fix a bug in FreeBSD sysctl emulation: use copyin for
moving data to the kernel
 1.4 11-Dec-2005  christos branches: 1.4.20; 1.4.22;
merge ktrace-lwp.
 1.3 02-Sep-2005  rpaulo Add a SYSCTL_SETUP_PROTO() so that it compiles fine in the lkm.
 1.2 26-Feb-2005  perry branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8; 1.2.10;
nuke trailing whitespace
 1.1 22-Feb-2005  heas Add FreeBSD sysctl emulation for their undocumented special OIDs rooted at
OID 0. Only OID 0.3 is implemented for now, it 0.3 is the equivalent of
NetBSD's sysctlgetmibinfo().
This includes a new sysctl kern.osreldate with the value __NetBSD_Version__
for kernels with COMPAT_FREEBSD.

Both of these are used by 3ware's FreeBSD tw_cli, which seems to work now.
 1.2.10.5 21-Jan-2008  yamt sync with head
 1.2.10.4 03-Sep-2007  yamt sync with head.
 1.2.10.3 26-Feb-2007  yamt sync with head.
 1.2.10.2 30-Dec-2006  yamt sync with head.
 1.2.10.1 21-Jun-2006  yamt sync with head.
 1.2.8.2 29-Apr-2005  kent sync with -current
 1.2.8.1 26-Feb-2005  kent file freebsd_sysctl.c was added on branch kent-audio2 on 2005-04-29 11:28:31 +0000
 1.2.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.6.1 26-Feb-2005  yamt file freebsd_sysctl.c was added on branch yamt-km on 2005-03-19 08:33:31 +0000
 1.2.4.2 11-Nov-2006  bouyer Pull up following revision(s) (requested by manu in ticket #1528):
etc/MAKEDEV.tmpl: revision 1.66 via patch
sys/conf/majors: revision 1.30 via patch
sys/dev/pci/twareg.h: revision 1.6 via patch
sys/dev/pci/twa.c: revision 1.13 via patch
sys/dev/pci/twaio.h: revision 1.4 via patch
sys/compat/freebsd/freebsd_sysctl.c: revision 1.5 via patch
Tweak the twa(4) driver so that 3ware command line utility works with
it.
This includes:
- fixing various structure definitions so that the ioctl parameter match
- adding a hw.twa*.driver_version sysctl
- do not refuse multiple device openings, as the management tool will do
it.
I'm not sure we are safe. FreeBSD allows multiple openings, and use
the
open flag only when an attempt to detach the device is done.
Fix a bug in FreeBSD sysctl emulation: use copyin for
moving data to the kernel
 1.2.4.1 13-Sep-2005  tron Pull up following revision(s) (requested by rpaulo in ticket #764):
sys/compat/freebsd/freebsd_sysctl.c: revision 1.3
Add a SYSCTL_SETUP_PROTO() so that it compiles fine in the lkm.
 1.2.2.3 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.2.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.2.1 26-Feb-2005  skrll file freebsd_sysctl.c was added on branch ktrace-lwp on 2005-03-04 16:39:35 +0000
 1.4.22.1 22-Oct-2006  yamt sync with head
 1.4.20.2 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.4.20.1 18-Nov-2006  ad Sync with head.
 1.8.18.2 09-Dec-2007  jmcneill Sync with HEAD.
 1.8.18.1 16-Aug-2007  jmcneill Sync with HEAD.
 1.8.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.8.6.1 20-Aug-2007  ad Sync with HEAD.
 1.9.10.1 26-Dec-2007  ad Sync with head.
 1.9.8.1 18-Feb-2008  mjf Sync with HEAD.
 1.9.2.1 09-Jan-2008  matt sync with HEAD
 1.10.4.2 08-Jan-2008  bouyer Sync with HEAD
 1.10.4.1 02-Jan-2008  bouyer Sync with HEAD
 1.12.8.1 18-May-2008  yamt sync with head.
 1.12.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.12.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.2.2 04-May-2009  yamt sync with head.
 1.13.2.1 16-May-2008  yamt sync with head.
 1.14.20.1 27-Oct-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1926):
sys/compat/freebsd/freebsd_sysctl.c: revision 1.17
I'm not sure reading from an unsanitized userland pointer is a good idea.
Some users might be tempted to give 0x01, in which case the kernel will
crash.
 1.14.16.1 27-Oct-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1926):
sys/compat/freebsd/freebsd_sysctl.c: revision 1.17
I'm not sure reading from an unsanitized userland pointer is a good idea.
Some users might be tempted to give 0x01, in which case the kernel will
crash.
 1.14.10.1 27-Oct-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1926):
sys/compat/freebsd/freebsd_sysctl.c: revision 1.17
I'm not sure reading from an unsanitized userland pointer is a good idea.
Some users might be tempted to give 0x01, in which case the kernel will
crash.
 1.14.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.14.2.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.14.2.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.15.36.1 19-Oct-2014  snj Pull up following revision(s) (requested by maxv in ticket #1168):
sys/compat/freebsd/freebsd_sysctl.c: revision 1.17
I'm not sure reading from an unsanitized userland pointer is a good idea.
Some users might be tempted to give 0x01, in which case the kernel will
crash.
 1.15.30.1 18-May-2014  rmind sync with head
 1.15.28.1 19-Oct-2014  snj Pull up following revision(s) (requested by maxv in ticket #1168):
sys/compat/freebsd/freebsd_sysctl.c: revision 1.17
I'm not sure reading from an unsanitized userland pointer is a good idea.
Some users might be tempted to give 0x01, in which case the kernel will
crash.
 1.15.26.2 03-Dec-2017  jdolecek update from HEAD
 1.15.26.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.22.1 19-Oct-2014  snj Pull up following revision(s) (requested by maxv in ticket #1168):
sys/compat/freebsd/freebsd_sysctl.c: revision 1.17
I'm not sure reading from an unsanitized userland pointer is a good idea.
Some users might be tempted to give 0x01, in which case the kernel will
crash.
 1.15.16.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.16.4.1 18-Oct-2014  martin Pull up following revision(s) (requested by maxv in ticket #146):
sys/compat/freebsd/freebsd_sysctl.c: revision 1.17
I'm not sure reading from an unsanitized userland pointer is a good idea.
Some users might be tempted to give 0x01, in which case the kernel will
crash.
 1.18.2.1 06-Apr-2015  skrll Sync with HEAD
 1.1 19-Nov-2008  ad branches: 1.1.4; 1.1.6; 1.1.8; 1.1.12;
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.1.12.2 04-May-2009  yamt sync with head.
 1.1.12.1 19-Nov-2008  yamt file freebsd_sysctl.h was added on branch yamt-nfs-mp on 2009-05-04 08:12:18 +0000
 1.1.8.2 19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1 19-Nov-2008  skrll file freebsd_sysctl.h was added on branch nick-hppapmap on 2009-01-19 13:17:22 +0000
 1.1.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1 19-Nov-2008  mjf file freebsd_sysctl.h was added on branch mjf-devfs2 on 2009-01-17 13:28:42 +0000
 1.1.4.2 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.4.1 19-Nov-2008  haad file freebsd_sysctl.h was added on branch haad-dm on 2008-12-13 01:13:48 +0000
 1.93 18-Jun-2019  christos regen
 1.92 10-Aug-2018  pgoyette Regen
 1.91 06-Jan-2018  kamil branches: 1.91.2; 1.91.4;
Revert vadvise(2) removal

This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
 1.90 19-Dec-2017  kamil compat/freebsd: Drop SYS_vadvise

The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
 1.89 19-Dec-2017  kamil compat/freebsd: Drop SYS_sbrk

sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
 1.88 19-Dec-2017  kamil compat freebsd: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
 1.87 08-Aug-2017  maxv Move freebsd_machdep.h into sys/compat/freebsd, and don't install it. Now,
the compat_freebsd files are all contained in sys/compat/freebsd.
 1.86 10-May-2017  riastradh regen
 1.85 16-Jan-2017  christos branches: 1.85.4;
regen
 1.84 13-Jan-2017  christos branches: 1.84.2;
regen
 1.83 24-Sep-2015  christos branches: 1.83.2;
Regen
 1.82 07-Mar-2015  christos regen
 1.81 07-Nov-2013  njoly branches: 1.81.6;
Regen for dup/dup2/dup3 argument types fix.
 1.80 10-Mar-2012  joerg branches: 1.80.2; 1.80.4;
P1003_1B_SEMAPHORE is no longer optional.
 1.79 06-Mar-2011  bouyer branches: 1.79.4; 1.79.8;
merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.78 02-Mar-2010  pooka branches: 1.78.2; 1.78.4; 1.78.6;
regen:
- remove nfssvc / fs_nfs.h / #ifdef NFS
- make getfh unconditional
 1.77 02-Mar-2010  pooka regen for conditional lfs syscall removal
 1.76 14-Dec-2009  matt branches: 1.76.2;
Regen (new makesyscalls.sh)
 1.75 13-Jan-2009  pooka Regen to prove I didn't screw up the conversion: purely RCSID changes.
 1.74 11-Jan-2009  christos merge christos-time_t
 1.73 19-Nov-2008  ad Regen.
 1.72 14-Nov-2008  ad Regen.
 1.71 20-Dec-2007  dsl branches: 1.71.6; 1.71.8; 1.71.12; 1.71.18; 1.71.20;
regen
 1.70 13-Jul-2007  dsl branches: 1.70.8; 1.70.16; 1.70.20;
Update generated files.
 1.69 09-Feb-2007  ad branches: 1.69.6;
Merge newlock2 to head.
 1.68 01-Sep-2006  matt branches: 1.68.2;
Regen.
 1.67 30-Aug-2006  matt Regen (for PTRACE).
 1.66 31-Jul-2006  martin Make filehandles opaque to userland
 1.65 26-Jun-2006  mrg regenerate.
 1.64 04-May-2006  christos branches: 1.64.4;
Regen
 1.63 11-Dec-2005  christos branches: 1.63.4; 1.63.6; 1.63.8; 1.63.10; 1.63.12;
merge ktrace-lwp.
 1.62 13-Sep-2005  christos compat code reorg.
 1.61 19-Aug-2005  christos 64 bit inode changes.
 1.60 26-Feb-2005  perry branches: 1.60.4;
regen
 1.59 22-Feb-2005  heas Re-gen for sysctl emulation
 1.58 11-May-2004  drochner branches: 1.58.4; 1.58.6;
regen
 1.57 10-May-2004  jonathan Regen src/sys/compat/freebsd_sys{call.h,callargs.h,calls.c,ent.c} from
syscalls.master rev 1.45, with COMPAT_2.0 fix.
 1.56 21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.55 29-Jan-2004  tsarna uuidgen(2) syscall. Originally from FreeBSD, ported by John Franklin in
PR#23470, with minor updates by me. This is only the syscall support
from that PR, for now.

Changes: port over fix from FreeBSD for multicast address generation.
Changed bcopy to memcpy. For now, #ifdef notyet the portions of
kern_uuid.c that are meant to be used by (currently nonexistent) other
things in the kernel. Added syscall to COMPAT_FREEBSD as well, though
that's currently not useful, as any program new enough to use this call
also uses other syscalls we don't (yet) emulate.
 1.54 26-Nov-2003  jdolecek Regen: add new syscalls to the list
 1.53 18-Sep-2003  pooka regen
 1.52 18-Jan-2003  thorpej branches: 1.52.2;
Regen to get correct RCS ID.
 1.51 18-Jan-2003  thorpej Regen: Merge the nathanw_sa branch.
 1.50 22-Dec-2002  gmcgarry Add stubs for scheduler syscalls.
 1.49 09-Oct-2002  pooka regen for rfork
 1.48 03-May-2002  eeh Regen.
 1.47 13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.46 27-Oct-2001  jdolecek Regen:
Hook in minherit(2), fhstatfs(2), fhopen(2), fhstat(2).
Adresses kern/8622 by Paul Shupak.
 1.45 30-May-2001  mrg branches: 1.45.2; 1.45.6;
use _KERNEL_OPT.
 1.44 27-Jan-2001  thorpej branches: 1.44.2;
Regen; add sy_flags.
 1.43 17-Dec-2000  jdolecek regen
 1.42 09-Dec-2000  mycroft Regen.
 1.41 09-Dec-2000  mycroft Regen.
 1.40 09-Dec-2000  mycroft Regen.
 1.39 30-Nov-2000  jdolecek LKMify
 1.38 18-Aug-2000  cgd update for changed makesyscalls.master
 1.37 08-Aug-2000  itojun regen
 1.36 07-Aug-2000  bjh21 Second phase of changes to remove ntp_adjtime(2) from the kernel entirely if
NTP is not defined.

Also removes sysctl_ntptime, since that's unreferenced without NTP.

ntp_gettime(2) is left alone, since it doesn't raise SIGSYS, which sys_nosys()
does.
 1.35 18-Jul-2000  onoe implement new signal syscalls in FreeBSD 4.0-RELEASE, using native syscalls:
sigaction, sigprocmask, sigsuspend, and sigpending.
 1.34 23-May-2000  tv branches: 1.34.4;
Add names for many syscalls not yet implemented, including those in
FreeBSD 4.0-RELEASE. Also implement the following using existing NetBSD
syscalls: pread, pwrite, getsid, mlockall, munlockall, __getcwd.
 1.33 21-Apr-2000  minoura Regen.
 1.32 25-Aug-1999  thorpej branches: 1.32.2;
Regen.
 1.31 12-Jul-1999  kleink Regen.
 1.30 09-Jun-1999  drochner regen
 1.29 09-Feb-1999  christos branches: 1.29.4;
Regen
 1.28 10-Dec-1998  christos Regen
 1.27 19-Oct-1998  tron Regen.
 1.26 11-Sep-1998  mycroft Regen.
 1.25 25-Jun-1998  thorpej Regen: defopt NFSSERVER
 1.24 25-Jun-1998  thorpej Regen: defopt KTRACE
 1.23 02-May-1998  christos regen.
 1.22 19-Feb-1998  thorpej Regen: makesyscalls.sh changed.
 1.21 19-Feb-1998  thorpej Regen: syscalls.master and makesyscalls.sh changed.
 1.20 22-Jan-1998  mycroft Regen.
 1.19 22-Jan-1998  mycroft Put a local copy of the SysV IPC compatibility from compat/common in here, so
it's not dependent on COMPAT_10. Also, fix translation of shmctl(), since
FreeBSD's is a little different.
 1.18 09-Jan-1998  thorpej Regen.
 1.17 09-Jan-1998  thorpej Regen.
 1.16 08-Jan-1998  thorpej Regen: back out RCD ID related changes.
 1.15 05-Jan-1998  perry regened with RCSIDs in place
 1.14 30-Nov-1997  veego Regen.
 1.13 18-Oct-1997  christos branches: 1.13.2;
Regen.
 1.12 16-Oct-1997  christos Regen.
 1.11 16-Oct-1997  mycroft Regen.
 1.10 10-Oct-1997  enami Regen from syscalls.master 1.9.
 1.9 10-Oct-1997  fvdl Regen.
 1.8 13-Jun-1997  thorpej branches: 1.8.4;
Regen: Use compat_12_sys_swapon().
 1.7 31-Jan-1997  thorpej branches: 1.7.2;
Syscalls.master changed, regen. (NFSCLIENT -> NFS)
 1.6 20-Sep-1996  christos branches: 1.6.2;
regen
 1.5 23-Jun-1996  mycroft Catch up with setre[ug]id() changes.
 1.4 10-Oct-1995  mycroft branches: 1.4.4;
Fix minor oversight.
 1.3 10-Oct-1995  mycroft branches: 1.3.2;
Fix typo.
 1.2 10-Oct-1995  mycroft Oops; remove something.
 1.1 10-Oct-1995  mycroft Output of makesyscalls.sh.
 1.3.2.1 20-Oct-1995  pk getppid => sys_getppid; re-ran makesyscalls.sh. (PR#1643).
 1.4.4.1 10-Dec-1996  mycroft Regen.
 1.6.2.2 14-Jan-1997  thorpej syscalls.master changed; regen.
 1.6.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.7.2.1 14-Feb-1997  mrg regen.
 1.8.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.2.2 30-Sep-1998  cgd regen after pull-up of syscalls.master rev 1.16 from trunk (tv)
 1.13.2.1 29-Jan-1998  mellon Regen
 1.29.4.2 02-Aug-1999  thorpej Regen.
 1.29.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.32.2.5 11-Feb-2001  bouyer Sync with HEAD.
 1.32.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.32.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.32.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.32.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.34.4.1 06-Mar-2002  he Pull up regenerated files (requested by jonathan):
Add support for FreeBSD 4.x signals; fixes PR#9769.
 1.44.2.8 29-Dec-2002  thorpej Sync with HEAD.
 1.44.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.44.2.6 20-Jun-2002  nathanw Catch up to -current.
 1.44.2.5 29-May-2002  nathanw Regen.
 1.44.2.4 28-Feb-2002  nathanw Regen.
 1.44.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.44.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.44.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.45.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.45.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.45.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.52.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.52.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.52.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.52.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.52.2.1 03-Aug-2004  skrll Sync with HEAD
 1.58.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.58.4.1 29-Apr-2005  kent sync with -current
 1.60.4.5 21-Jan-2008  yamt sync with head
 1.60.4.4 03-Sep-2007  yamt sync with head.
 1.60.4.3 26-Feb-2007  yamt sync with head.
 1.60.4.2 30-Dec-2006  yamt sync with head.
 1.60.4.1 21-Jun-2006  yamt sync with head.
 1.63.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.63.10.1 11-May-2006  elad sync with head
 1.63.8.3 03-Sep-2006  yamt sync with head.
 1.63.8.2 11-Aug-2006  yamt sync with head
 1.63.8.1 24-May-2006  yamt sync with head.
 1.63.6.1 01-Jun-2006  kardel Sync with head.
 1.63.4.1 09-Sep-2006  rpaulo sync with head
 1.64.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.68.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.69.6.1 15-Jul-2007  ad Sync with head.
 1.70.20.1 02-Jan-2008  bouyer Sync with HEAD
 1.70.16.1 26-Dec-2007  ad Sync with head.
 1.70.8.1 09-Jan-2008  matt sync with HEAD
 1.71.20.1 19-Jan-2009  skrll Sync with HEAD.
 1.71.18.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.71.12.2 11-Mar-2010  yamt sync with head
 1.71.12.1 04-May-2009  yamt sync with head.
 1.71.8.2 20-Nov-2008  christos merge with head.
 1.71.8.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.71.6.1 17-Jan-2009  mjf Sync with HEAD.
 1.76.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.78.6.1 08-Feb-2011  bouyer Regen: quotactl compat
 1.78.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.78.2.1 21-Apr-2011  rmind sync with head
 1.79.8.1 11-Mar-2012  mrg sync to latest -current
 1.79.4.2 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.79.4.1 17-Apr-2012  yamt sync with head
 1.80.4.1 18-May-2014  rmind sync with head
 1.80.2.2 03-Dec-2017  jdolecek update from HEAD
 1.80.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.81.6.3 28-Aug-2017  skrll Sync with HEAD
 1.81.6.2 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.81.6.1 06-Apr-2015  skrll Sync with HEAD
 1.83.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.84.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.85.4.1 11-May-2017  pgoyette Sync with HEAD
 1.91.4.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.91.4.1 10-Jun-2019  christos Sync with HEAD
 1.91.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.4 04-Dec-2007  dsl Remove all the __P
 1.3 16-Sep-2001  wiz branches: 1.3.34; 1.3.90; 1.3.92; 1.3.98; 1.3.102;
Spell 'occurred' with two 'r's.
 1.2 05-Jan-1998  perry branches: 1.2.26; 1.2.28; 1.2.30;
RCSID Police.
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.2.30.1 01-Oct-2001  fvdl Catch up with -current.
 1.2.28.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.26.1 21-Sep-2001  nathanw Catch up to -current.
 1.3.102.1 08-Dec-2007  ad Sync with head.
 1.3.98.1 08-Dec-2007  mjf Sync with HEAD.
 1.3.92.1 09-Jan-2008  matt sync with HEAD
 1.3.90.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.3.34.1 07-Dec-2007  yamt sync with head
 1.3 01-Dec-2000  jdolecek add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.2 05-Sep-1998  christos branches: 1.2.12;
Assign copyright to TNF.
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.2.12.1 08-Dec-2000  bouyer Sync with HEAD.
 1.3 09-Dec-2000  mycroft Round up the sysent table size.
 1.2 10-Oct-1995  mycroft branches: 1.2.32;
Oops; remove something.
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.2.32.1 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.73 18-Jun-2019  christos add quota option
 1.72 06-Jan-2018  kamil branches: 1.72.4;
Revert vadvise(2) removal

This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
 1.71 19-Dec-2017  kamil compat/freebsd: Drop SYS_vadvise

The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
 1.70 19-Dec-2017  kamil compat/freebsd: Drop SYS_sbrk

sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
 1.69 19-Dec-2017  kamil compat freebsd: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
 1.68 08-Aug-2017  maxv Move freebsd_machdep.h into sys/compat/freebsd, and don't install it. Now,
the compat_freebsd files are all contained in sys/compat/freebsd.
 1.67 07-Nov-2013  njoly branches: 1.67.6;
Fix dup/dup2/dup3 argument types (u_int -> int).
 1.66 10-Mar-2012  joerg branches: 1.66.2; 1.66.4;
P1003_1B_SEMAPHORE is no longer optional.
 1.65 06-Mar-2011  bouyer branches: 1.65.4; 1.65.8;
merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.64 02-Mar-2010  pooka branches: 1.64.2; 1.64.4; 1.64.6;
Kill fs_nfs.h and #ifdef NFS by making getfh() support unconditional
and nfssvc unsupport unconditional. nfs server was just a fancy
NOP anyway for all except Ultrix. I know I'm boring but I couldn't
imagine why someone would want to run an Ultrix nfs server (and I
also doubt that it would work anymore with all the changes to fs
exporting etc).
 1.63 02-Mar-2010  pooka Remove lfs syscall support from compat. I can't really imagine
anyone wanting to run lfs megamaid as a e.g. FreeBSD binary.
Besides, the real action has been in fcntl() for >5 years now.
The only place where the compat syscalls might have made the tiniest
bit of sense was netbsd32, but they were unimplemented there.
 1.62 13-Jan-2009  pooka branches: 1.62.4;
Convert the syscalls.master to a format from which it is easier
to parse and generate the compat name and basename (e.g. __stat50
and stat). Use this to autogenerate __RENAME()'s to the rump_syscalls
header so that they can be called e.g. rump_sys_socket() instead
of rump_sys___socket30().
 1.61 11-Jan-2009  christos merge christos-time_t
 1.60 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.59 14-Nov-2008  ad Replace semid_t with intptr_t. No function change. This is a libc/kernel
private interface and so the name change should not affect any third
party code.
 1.58 13-Jul-2007  dsl branches: 1.58.28; 1.58.30; 1.58.34; 1.58.36; 1.58.40; 1.58.44;
Remove all the syscall stubs that were only there to get files lookup
up in the alternate path.
 1.57 04-Mar-2007  christos branches: 1.57.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.56 09-Feb-2007  ad branches: 1.56.2;
Merge newlock2 to head.
 1.55 01-Sep-2006  matt branches: 1.55.2;
Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
 1.54 30-Aug-2006  matt Update for options PTRACE
 1.53 31-Jul-2006  martin Step 1 to make filehandles completely opaque to userland
 1.52 26-Jun-2006  mrg version the socket(2) syscall. for compat30 socket, we use
EPROTONOSUPPORT instead of EAFNOSUPPORT.

from pavel@ with a little bit of clean up from myself.

XXX: netbsd32 (and perhaps other emulations) should be able
XXX: to call the standard socket calls for this i think, but
XXX: revisit this at another time.
 1.51 04-May-2006  christos branches: 1.51.4;
fhstat needs to be versioned too (for ino_t). Pointed out by Izumi Tsutsui
 1.50 11-Dec-2005  christos branches: 1.50.4; 1.50.6; 1.50.8; 1.50.10; 1.50.12;
merge ktrace-lwp.
 1.49 13-Sep-2005  christos compat code reorg.
 1.48 19-Aug-2005  christos 64 bit inode changes.
 1.47 22-Feb-2005  heas branches: 1.47.4;
Add FreeBSD sysctl emulation for their undocumented special OIDs rooted at
OID 0. Only OID 0.3 is implemented for now, it 0.3 is the equivalent of
NetBSD's sysctlgetmibinfo().
This includes a new sysctl kern.osreldate with the value __NetBSD_Version__
for kernels with COMPAT_FREEBSD.

Both of these are used by 3ware's FreeBSD tw_cli, which seems to work now.
 1.46 11-May-2004  drochner branches: 1.46.4; 1.46.6;
FreeBSD emulation should not depend on NetBSD binary compatibility
options. Include compat_20_sys_*statfs* unconditionally.
 1.45 10-May-2004  christos Add opt_compat_netbsd.h because we need it for COMPAT_20; pointed out
by Jonathan Stone.
 1.44 21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.43 29-Jan-2004  tsarna uuidgen(2) syscall. Originally from FreeBSD, ported by John Franklin in
PR#23470, with minor updates by me. This is only the syscall support
from that PR, for now.

Changes: port over fix from FreeBSD for multicast address generation.
Changed bcopy to memcpy. For now, #ifdef notyet the portions of
kern_uuid.c that are meant to be used by (currently nonexistent) other
things in the kernel. Added syscall to COMPAT_FREEBSD as well, though
that's currently not useful, as any program new enough to use this call
also uses other syscalls we don't (yet) emulate.
 1.42 26-Nov-2003  jdolecek add the new syscalls to the list
 1.41 18-Sep-2003  pooka Add a good enuf emulation of the MAP_STACK flag to the mmap()
syscall. This allows programs which use MAP_STACK to work instead
of failing in weird and wonderous ways.
 1.40 18-Jan-2003  thorpej branches: 1.40.2;
Merge the nathanw_sa branch.
 1.39 22-Dec-2002  gmcgarry Add scheduler syscalls.
 1.38 09-Oct-2002  pooka FreeBSD rfork emulation
 1.37 03-May-2002  eeh Use #if defined(_LP64) to determine if we're generating 64-bit binaries,
not #if defined(alpha).
 1.36 27-Oct-2001  jdolecek Hook in minherit(2), fhstatfs(2), fhopen(2), fhstat(2).
Adresses kern/8622 by Paul Shupak.
 1.35 30-May-2001  mrg branches: 1.35.2; 1.35.6;
use _KERNEL_OPT.
 1.34 17-Dec-2000  jdolecek branches: 1.34.2;
add emulation of FreeBSD utrace(2)
 1.33 09-Dec-2000  mycroft Get rid of the damn EMUL_GET* flags.
 1.32 09-Dec-2000  mycroft Add the %% separators.
 1.31 30-Nov-2000  jdolecek LKMify
 1.30 08-Aug-2000  itojun s/#ifdefined/#ifdef/
 1.29 07-Aug-2000  bjh21 Changes to syscalls.master to exclude ntp_adjtime(2) entirely if NTP is not
defined. Changes to other files will follow in a moment.
 1.28 18-Jul-2000  onoe implement new signal syscalls in FreeBSD 4.0-RELEASE, using native syscalls:
sigaction, sigprocmask, sigsuspend, and sigpending.
 1.27 23-May-2000  tv branches: 1.27.4;
Add names for many syscalls not yet implemented, including those in
FreeBSD 4.0-RELEASE. Also implement the following using existing NetBSD
syscalls: pread, pwrite, getsid, mlockall, munlockall, __getcwd.
 1.26 21-Apr-2000  minoura We have now native issetugid.
 1.25 25-Aug-1999  thorpej branches: 1.25.2;
Update for new msgctl()/semctl()/shmctl().
 1.24 12-Jul-1999  kleink XSH5: change function signature to `void *sbrk(intptr_t)'.
 1.23 09-Jun-1999  drochner add "sys_" prefix to LFS syscalls
 1.22 09-Feb-1999  christos branches: 1.22.4;
PR/6962: Paul Shupak: FreeBSD-3.0 additions
- const poisoning
 1.21 10-Dec-1998  christos Defopt COMPAT_43
 1.20 19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.19 11-Sep-1998  mycroft Substantial signal handling changes:
* Increase the size of sigset_t to accomodate 128 signals -- adding new
versions of sys_setprocmask(), sys_sigaction(), sys_sigpending() and
sys_sigsuspend() to handle the changed arguments.
* Abstract the guts of sys_sigaltstack(), sys_setprocmask(), sys_sigaction(),
sys_sigpending() and sys_sigsuspend() into separate functions, and call them
from all the emulations rather than hard-coding everything. (Avoids uses
the stackgap crap for these system calls.)
* Add a new flag (p_checksig) to indicate that a process may have signals
pending and userret() needs to do the full (slow) check.
* Eliminate SAS_ALTSTACK; it's exactly the inverse of SS_DISABLE.
* Correct emulation bugs with restoring SS_ONSTACK.
* Make the signal mask in the sigcontext always use the emulated mask format.
* Store signals internally in sigaction structures, rather than maintaining a
bunch of little sigsets for each SA_* bit.
* Keep track of where we put the signal trampoline, rather than figuring it out
in *_sendsig().
* Issue a warning when a non-emulated sigaction bit is observed.
* Add missing emulated signals, and a native SIGPWR (currently not used).
* Implement the `not reset when caught' semantics for relevant signals.

Note: Only code touched by the i386 port has been modified. Other ports and
emulations need to be updated.
 1.18 25-Jun-1998  thorpej defopt NFSSERVER
 1.17 25-Jun-1998  thorpej defopt KTRACE
 1.16 02-May-1998  christos PR/5350: Minoura Makoto: add issetugid() syscall. (with fixes from me)
 1.15 19-Feb-1998  thorpej Include the NFS option header.
 1.14 22-Jan-1998  mycroft Put a local copy of the SysV IPC compatibility from compat/common in here, so
it's not dependent on COMPAT_10. Also, fix translation of shmctl(), since
FreeBSD's is a little different.
 1.13 30-Nov-1997  veego Change syscall table to use the 1.3 compatibility sigaltstack() function
(fix from kleink).
 1.12 18-Oct-1997  christos branches: 1.12.2;
Use stat12; from Enami Tsugutomo
 1.11 16-Oct-1997  christos ostat -> stat43
 1.10 15-Oct-1997  mycroft Fix a typo inherited from kern/syscalls.master.
 1.9 10-Oct-1997  enami lchown at #254.
 1.8 10-Oct-1997  fvdl Channel FreeBSD getdirentries to our now obsolete getdirentries call.
 1.7 13-Jun-1997  thorpej branches: 1.7.4;
Use compat_12_sys_swapon().
 1.6 31-Jan-1997  thorpej branches: 1.6.2;
NFSCLIENT -> NFS
 1.5 20-Sep-1996  christos branches: 1.5.2;
getlogin -> __getlogin
 1.4 23-Jun-1996  mycroft Catch up with setre[ug]id() changes.
 1.3 10-Oct-1995  mycroft branches: 1.3.4;
Fix minor oversight.
 1.2 10-Oct-1995  mycroft branches: 1.2.2;
Fix typo.
 1.1 10-Oct-1995  mycroft FreeBSD binary compatibility module, from Noriyuki Soda.
 1.2.2.1 20-Oct-1995  pk getppid => sys_getppid; re-ran makesyscalls.sh. (PR#1643).
 1.3.4.1 10-Dec-1996  mycroft From trunk:
Implement setre[ug]id() for real.
 1.5.2.1 14-Jan-1997  thorpej Snapshot of work-in-progress, committed to private branch.

These changes implement machine-independent root device and file system
selection. Notable features:

- All ports behave in a consistent manner regarding root
device selection.
- No more "options GENERIC"; all kernels have the ability
to boot with RB_ASKNAME to select root device and file system
type.
- Root file system type can be wildcarded; a machine-independent
function will try all possible file systems for the selected
root device until one succeeds.
- If the root file system fails to mount, the operator will
be given the chance to select a new root device and file
system type, rather than having the machine simply panic.
- nfs_mountroot() no longer panics if any part of the NFS
mount process fails; it now returns an error, giving the
operator a chance to recover.
- New, more consistent, config(8) grammar. The constructs:

config netbsd swap generic
config netbsd root on nfs

have been replaced with:

config netbsd root on ? type ?
config netbsd root on ? type nfs

Additionally, the operator may select or wildcard root file
system type in the kernel configuration file:

config netbsd root on cd0a type cd9660

config(8) now requires that a "root" specification be
made. "root" may be wired down or wildcarded. "swap" and
"dump" specifications are optional, and follow previous
semantics.

- config(8) has a new "file-system" keyword, used to configure
file systems into the kernel. Eventually, this will be used
to generate the default vfssw[].

- "options NFSCLIENT" is obsolete, and is replaced by
"file-system NFS". "options NFSSERVER" still exists, since
NFS server support is independent of the NFS file system
client.

- sys/arch/<foo>/<foo>/swapgeneric.c is no longer used, and
will be removed; all information is now generated by config(8).

As of this commit, all ports except arm32 have been updated to use
the new setroot(). Only SPARC, i386, and Alpha ports have been
tested at this time. Port masters should test these changes on their
ports, and report any problems back to me.

More changes are on their way, including RB_ASKNAME support in
nfs_mountroot() (to prompt for server address and path) and, potentially,
the ability to select rarp/bootparam or bootp in nfs_mountroot().
 1.6.2.1 12-Feb-1997  mrg initial work for dynamic swap additions.
 1.7.4.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.12.2.2 30-Sep-1998  cgd pull up rev 1.16 from trunk (tv)
 1.12.2.1 29-Jan-1998  mellon Pull up 1.14 (mycroft)
 1.22.4.2 02-Aug-1999  thorpej Update from trunk.
 1.22.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.25.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.25.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.25.2.2 08-Dec-2000  bouyer Sync with HEAD.
 1.25.2.1 20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.27.4.1 06-Mar-2002  he Pull up revisions 1.28-1.30 (requested by jonathan):
Add support for FreeBSD 4.x signals; fixes PR#9769.
 1.34.2.7 29-Dec-2002  thorpej Sync with HEAD.
 1.34.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.34.2.5 20-Jun-2002  nathanw Catch up to -current.
 1.34.2.4 29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.34.2.3 28-Feb-2002  nathanw sys_setlogin() -> sys___setlogin()
 1.34.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.34.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.35.6.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.35.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.35.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.40.2.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.40.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.40.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.40.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.40.2.1 03-Aug-2004  skrll Sync with HEAD
 1.46.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.46.4.1 29-Apr-2005  kent sync with -current
 1.47.4.4 03-Sep-2007  yamt sync with head.
 1.47.4.3 26-Feb-2007  yamt sync with head.
 1.47.4.2 30-Dec-2006  yamt sync with head.
 1.47.4.1 21-Jun-2006  yamt sync with head.
 1.50.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.50.10.1 11-May-2006  elad sync with head
 1.50.8.2 11-Aug-2006  yamt sync with head
 1.50.8.1 24-May-2006  yamt sync with head.
 1.50.6.1 01-Jun-2006  kardel Sync with head.
 1.50.4.1 09-Sep-2006  rpaulo sync with head
 1.51.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.55.2.1 30-Jan-2007  ad Remove support for SA. Ok core@.
 1.56.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.57.2.1 15-Jul-2007  ad Sync with head.
 1.58.44.1 19-Jan-2009  skrll Sync with HEAD.
 1.58.40.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.58.36.2 14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.58.36.1 10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.58.34.2 11-Mar-2010  yamt sync with head
 1.58.34.1 04-May-2009  yamt sync with head.
 1.58.30.2 20-Nov-2008  christos merge with head.
 1.58.30.1 29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.58.28.1 17-Jan-2009  mjf Sync with HEAD.
 1.62.4.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.64.6.1 08-Feb-2011  bouyer freebsd quotactl uses our COMPAT_50 syscall.
 1.64.4.1 06-Jun-2011  jruoho Sync with HEAD.
 1.64.2.1 21-Apr-2011  rmind sync with head
 1.65.8.1 11-Mar-2012  mrg sync to latest -current
 1.65.4.2 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.65.4.1 17-Apr-2012  yamt sync with head
 1.66.4.1 18-May-2014  rmind sync with head
 1.66.2.2 03-Dec-2017  jdolecek update from HEAD
 1.66.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.67.6.1 28-Aug-2017  skrll Sync with HEAD
 1.72.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411

RSS XML Feed