Home | History | Annotate | Download | only in ultrix
History log of /src/sys/compat/ultrix/ultrix_misc.c
RevisionDateAuthorComments
 1.127  03-Aug-2023  mrg avoid uninitialised accesses

found by GCC 12.
 1.126  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.125  10-Aug-2018  pgoyette branches: 1.125.4;
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.124  06-May-2018  kamil branches: 1.124.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.123  09-Jan-2018  maya branches: 1.123.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.122  19-Feb-2012  rmind branches: 1.122.32;
Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.121  07-Jul-2010  chs branches: 1.121.8; 1.121.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.120  03-Mar-2010  pooka branches: 1.120.2;
Remove nfssvc non-emulations I missed yesterday.
 1.119  02-Mar-2010  pooka remove nfssvc emulation (or non-emulation)
 1.118  17-Jan-2009  he branches: 1.118.4;
Adapt to the state after the recent time_t change.
Type changes:
timeval -> timeval50
itimerval -> itimerval50
rusage -> rusage50
and use of the compat_50 calls where appropriate.
Untested, but at least it builds.

Discussed with christos@
 1.117  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.116  15-Oct-2008  wrstuden branches: 1.116.2;
Merge wrstuden-revivesa into HEAD.
 1.115  08-Aug-2008  bjs 'if (error = 0)' -> 'if (error == 0)'
 1.114  07-Aug-2008  plunky convert some [left behind] compat code to use new sockopt API
 1.113  24-Jun-2008  ad branches: 1.113.2;
Replace references to getsock/getvnode.
 1.112  23-Apr-2008  christos branches: 1.112.2; 1.112.4; 1.112.6;
Make this compile again, from Jan-Benedict Glaw jbglaw at lug-owl dot de
 1.111  21-Mar-2008  ad branches: 1.111.2;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.110  27-Dec-2007  christos branches: 1.110.6;
make this compile again.
 1.109  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.108  13-May-2007  dsl branches: 1.108.8; 1.108.14; 1.108.16; 1.108.20;
Delete fom stackgap lines that seem to have got left in.
 1.107  12-May-2007  dsl Split the fcntl locking code out from its copyin/out.
Use to avoid all the stackgap stuff in compat code.
 1.106  04-Mar-2007  christos branches: 1.106.2; 1.106.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.105  09-Feb-2007  ad branches: 1.105.2;
Merge newlock2 to head.
 1.104  11-Dec-2005  christos branches: 1.104.20;
merge ktrace-lwp.
 1.103  16-Sep-2005  christos add <compat/sys/signal*.h>
 1.102  19-Aug-2005  christos 64 bit inode changes.
 1.101  10-Jul-2005  christos define syscall again.
 1.100  10-Jul-2005  christos No point in declaring syscall_intern and syscall in a zillion places.
 1.99  26-Mar-2005  fvdl branches: 1.99.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.98  26-Feb-2005  perry branches: 1.98.2;
nuke trailing whitespace
 1.97  25-Jan-2005  drochner Hmm - vax is different. sendsig_sigcontext() is for __mips only.
Should fix build error found by Havard Eidnes.
 1.96  24-Jan-2005  drochner branches: 1.96.2;
use sendsig_sigcontext() directly instead of the generic sendsig()
 1.95  27-Oct-2004  david branches: 1.95.4;
Bounds check syscall arguments where appropriate
 1.94  25-Apr-2004  matt Constify a few read-only arrays/variables.
 1.93  21-Apr-2004  simonb ANSIfy, some KNF.
 1.92  20-Dec-2003  fvdl branches: 1.92.2;
Put back Emmanuel's sigfilter hooks, as decided by Core.
 1.91  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.90  05-Dec-2003  jdolecek back the sigfilter emulation hook change off
 1.89  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.88  27-Oct-2003  simonb Fix bogus uninitialised warnings.
 1.87  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.86  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.85  29-Jun-2003  fvdl branches: 1.85.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.84  29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.83  29-Jan-2003  atatat Cull unused variables. Sigh.

PS - Cross compilers are cool.
 1.82  28-Jan-2003  atatat No need to pick a "default address" for mmap in compat code, since we
merely call sys_mmap() at the end anyway, and that will pick the
address for us, if it's needed.

Likewise for checking if /dev/zero is being mapped.
 1.81  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.80  01-Nov-2002  jdolecek set struct emul's nsysent to compat SYS_NSYSENT, not SYS_MAXSYSCALL
 1.79  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.78  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.77  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.76  16-Mar-2002  christos branches: 1.76.4; 1.76.6;
get rid of STACKGAP* shit.
 1.75  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.74  13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.73  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.72  17-Sep-2001  jdolecek g/c dead code
 1.71  18-Jun-2001  christos branches: 1.71.2; 1.71.4;
Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.70  14-Jun-2001  thorpej Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads. What we do is stick descriptors in the table, but
mark them as "larval". This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again. When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
 1.69  30-May-2001  mrg use _KERNEL_OPT.
 1.68  15-Jan-2001  thorpej branches: 1.68.2;
Grok __HAVE_MINIMAL_EMUL and __HAVE_SYSCALL_INTERN.
 1.67  07-Jan-2001  simonb Move prototypes for mips_user_cachectl() and mips_user_cacheflush()
to <mips/cachectl.h>.
 1.66  16-Dec-2000  jdolecek adapt to recent struct emul changes
 1.65  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.64  09-Dec-2000  jdolecek split ecoff specific code to separate file ultrix_exec_ecoff.c
 1.63  01-Dec-2000  jdolecek make LKM safe
 1.62  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.61  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.60  19-Nov-2000  simonb Update extern declarations of {hpux,ultrix}_syscallnames for change
to e_syscallnames in struct emul. Untested on HP, but should be ok.
 1.59  20-Jul-2000  nisimura version[] string was const'ifed. Pointed out by Izumi Tsutsui.
 1.58  28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.57  28-Apr-2000  simonb branches: 1.57.4;
The size of the members of struct ultrix_utsname were nothing like
reality - adjust and fill in "version" the same way that some other
compat routines do. An Ultrix "uname -a" returns something meaninful
now instead of just "NetBSD ".
 1.56  30-Mar-2000  augustss Kill register declarations.
 1.55  28-Mar-2000  simonb Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.
 1.54  26-Mar-2000  kleink Merge parts of chs-ubc2 into the trunk:
* Remove the casts to vaddr_t from the round_page() and trunc_page() macros to
make them type-generic, which is necessary i.e. to operate on file offsets
without truncating them.
* In due course, cast pointer arguments to these macros to an appropriate
integral type (paddr_t, vaddr_t).

Originally done by Chuck Silvers, updated by myself.
 1.53  25-Aug-1999  thorpej branches: 1.53.2;
Update for new msgctl()/semctl()/shmctl() calls.
 1.52  30-Jul-1999  drochner emulate fcntl(F_SETLK) & Co.
(seti@home works now:-)
 1.51  05-May-1999  thorpej Add "use counting" to file entries. When closing a file, and it's reference
count is 0, wait for use count to drain before finishing the close.

This is necessary in order for multiple processes to safely share file
descriptor tables.
 1.50  09-Feb-1999  christos branches: 1.50.2; 1.50.4;
Regen
 1.49  26-Oct-1998  sommerfe s/SunOS/Ultrix/ in comment
 1.48  20-Oct-1998  matt vax -> __vax__ (and mips to __mips__ in ultrix_misc.c)
 1.47  19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.46  03-Oct-1998  drochner Use a private implementation of sys_sigvec(). Ultrix uses an sv_flags bit
unknown to NetBSD and sigaction1() does (now?) complain about it.
 1.45  02-Oct-1998  drochner repair signal handling:
-use own sigcode since the native one uses a sigreturn syscall not present
in Ultrix
-route sigreturn to compat_13_sigreturn
 1.44  26-Sep-1998  drochner Make Ultrix emulation private functions for sigreturn and sigsuspend
because the NetBSD implementation differs now.
 1.43  26-Sep-1998  drochner Update for sigmask changes.
 1.42  13-Aug-1998  eeh Merge paddr_t changes into the main branch.
 1.41  09-Aug-1998  perry bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.40  03-Jul-1998  mhitch branches: 1.40.2;
Add missing include of "opt_nfsserver.h".
 1.39  19-Feb-1998  thorpej Include the NFS option header.
 1.38  19-Oct-1997  jonathan Use void* not caddr_t for 'addr' argument to native mmap().
 1.37  10-Oct-1997  jonathan Correct name of author in license clause 3, as per email with mrg.
 1.36  24-Sep-1997  mhitch Fix a missed *setregs() change.
 1.35  09-Jun-1997  jonathan branches: 1.35.4;
Emulate RISC Ultrix cacheflush() and cachectl() syscalls on mips.
 1.34  25-May-1997  jonathan GC old ultrix-emul syscall stub used to debug ultrix signals.
 1.33  24-May-1997  jonathan Add prototype for cpu_exec_ecoff_setregs() to mips/inuclde/ecoff_machdep.h.
Use it in compat/ultrix/ultrix_misc.c (setting emul type on mips).
 1.32  24-May-1997  jonathan lint: add explicit return type to ultrix_sys_shmsys().
 1.31  26-Apr-1997  jonathan Correct shm ifdefs for when SVSHM is defined. Fix from Ted Lemon in PR 3542.
 1.30  06-Apr-1997  jonathan Add changes to make vic-2.8 Ultrix binaries work on NetBSD with COMPAT_ULTRIX:
* Add IPmulticast setsockopt emulation.
* Add Ultrix shmsys emulation (untested).
* tidy up use of stackgap.
 1.29  31-Jan-1997  thorpej NFSCLIENT -> NFS
 1.28  19-Oct-1996  jonathan branches: 1.28.2;
Update copyright.
 1.27  13-Oct-1996  christos Backout previous kprintf change.
 1.26  10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.25  10-Aug-1996  mycroft sys/dir.h -> sys/dirent.h
 1.24  14-Jun-1996  cgd avoid unnecessary checks of m_get/MGET/etc.'s return values. When
they're called with M_WAIT, they are defined to never return NULL.
 1.23  07-Apr-1996  jonathan branches: 1.23.4;
Remove gcc -Wall lint from ultrix emulation.-
Mostly adding explicit != comparison to "if (error = copyin/out( ... ))".
Fix comment glitch in ultrix_fs.c
 1.22  07-Apr-1996  jonathan Add vax setregs() support for exec'ing vax ultrix a.out binaries.
 1.21  19-Feb-1996  pk Adapt to NFSv3.
 1.20  07-Jan-1996  jonathan Add '/emul/ultrix' pathname processing to Ultrix emulation, and move
Ultrix syscalls that require that processing out of ultrix_misc.c
to ultrix_pathname.c.
 1.19  03-Jan-1996  jonathan Add sigcode and esigcode to emul_ultrix, so that signal trampoline
code is set up for emul_ultrix processes.
 1.18  26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.17  30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.16  07-Oct-1995  mycroft branches: 1.16.2;
Prefix names of system call implementation functions with `sys_'.
 1.15  19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.14  18-Jun-1995  cgd don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN
 1.13  01-Jun-1995  mellon Clear up name conflict between Ultrix syscall 103 and 139.
 1.12  25-Apr-1995  mellon sigcode and esigcode aren't defined for ultrix emulation
 1.11  22-Apr-1995  christos - added struct emul to all emulations.
- removed all setup functions.
- added copyargs() functions where needed.
 1.10  09-Mar-1995  mycroft copy*str() should use size_t.
 1.9  18-Jan-1995  mellon Fix up non-ANSI code (which was a no-op anyway)
 1.8  23-Nov-1994  dean {get,set}rlimit functions (From Jonathan Stone)
 1.7  20-Oct-1994  cgd pay a small amount of lip service to the new syscall args mechanism.
In reality, none of these will compile.
 1.6  01-Aug-1994  glass ultrix_{get,set}info from Arne H Juul <arnej@dsl.unit.no>
 1.5  29-Jun-1994  cgd branches: 1.5.2;
New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.4  25-Jun-1994  glass oops
 1.3  22-Jun-1994  glass update for getdtablesize change, and track compat_sunos
 1.2  15-Jun-1994  glass much works but untested w/new fs. expect more tomorrow
 1.1  02-Jun-1994  glass first swipe at ultrix compat. expect many bug fixes. very related to compat/sunos
 1.5.2.1  01-Aug-1994  cgd From trunk.
 1.16.2.1  18-Oct-1995  jonathan Fix arg mismatch in ultrix-compat open(), which broke groff. (there is no
version of gcc that both compiles for NetBSD/mips and also compiles groff,
so I use an groff binary compiled on Ultrix.)
 1.23.4.1  10-Dec-1996  mycroft From trunk:
sys/dir.h -> sys/dirent.h
 1.28.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.35.4.2  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.35.4.1  29-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.40.2.1  30-Jul-1998  eeh Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.
 1.50.4.2  02-Aug-1999  thorpej Update from trunk.
 1.50.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.50.2.1  31-Jan-2000  he Pull up revision 1.52 (requested by mhitch):
Emulate Ultrix fcntl(F_SETLK) & Co. so the Ultrix seti@home client
works.
 1.53.2.6  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.53.2.5  05-Jan-2001  bouyer Sync with HEAD
 1.53.2.4  13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.53.2.3  08-Dec-2000  bouyer Sync with HEAD.
 1.53.2.2  22-Nov-2000  bouyer Sync with HEAD.
 1.53.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.57.4.1  21-Jul-2000  nisimura Pull up 1.59 with approval notice from thorpej.

version[] string was const'ifed.
 1.68.2.11  11-Nov-2002  nathanw Catch up to -current
 1.68.2.10  18-Oct-2002  nathanw Catch up to -current.
 1.68.2.9  17-Sep-2002  nathanw Catch up to -current.
 1.68.2.8  01-Aug-2002  nathanw Catch up to -current.
 1.68.2.7  12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.68.2.6  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.68.2.5  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.68.2.4  06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_ULTRIX support
 1.68.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.68.2.2  21-Sep-2001  nathanw Catch up to -current.
 1.68.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.71.4.1  01-Oct-2001  fvdl Catch up with -current.
 1.71.2.4  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.71.2.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.71.2.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.71.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.76.6.1  16-Dec-2004  jmc Pullup patch (requested by david in ticket #1800)

Bounds check syscall arguments where appropriate.
 1.76.4.2  15-Jul-2002  gehenna catch up with -current.
 1.76.4.1  16-May-2002  gehenna Get rid of iszerodev. Use the 'zerodev' (dev_t for /dev/zero).
 1.85.2.9  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.85.2.8  01-Apr-2005  skrll Sync with HEAD.
 1.85.2.7  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.85.2.6  04-Feb-2005  skrll Sync with HEAD.
 1.85.2.5  28-Nov-2004  skrll Adapt to branch
 1.85.2.4  02-Nov-2004  skrll Sync with HEAD.
 1.85.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.85.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.85.2.1  03-Aug-2004  skrll Sync with HEAD
 1.92.2.1  12-Nov-2004  jmc Pullup rev 1.95 (requested by david in ticket #946)

Bounds check syscall arguments where appropriate.
 1.95.4.1  29-Apr-2005  kent sync with -current
 1.96.2.3  26-Mar-2005  yamt sync with head.
 1.96.2.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.96.2.1  12-Feb-2005  yamt sync with head.
 1.98.2.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.99.2.5  24-Mar-2008  yamt sync with head.
 1.99.2.4  21-Jan-2008  yamt sync with head
 1.99.2.3  03-Sep-2007  yamt sync with head.
 1.99.2.2  26-Feb-2007  yamt sync with head.
 1.99.2.1  21-Jun-2006  yamt sync with head.
 1.104.20.2  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.104.20.1  29-Dec-2006  ad Checkpoint work in progress.
 1.105.2.2  17-May-2007  yamt sync with head.
 1.105.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.106.4.1  11-Jul-2007  mjf Sync with head.
 1.106.2.1  08-Jun-2007  ad Sync with head.
 1.108.20.1  02-Jan-2008  bouyer Sync with HEAD
 1.108.16.1  26-Dec-2007  ad Sync with head.
 1.108.14.1  18-Feb-2008  mjf Sync with HEAD.
 1.108.8.1  09-Jan-2008  matt sync with HEAD
 1.110.6.5  17-Jan-2009  mjf Sync with HEAD.
 1.110.6.4  28-Sep-2008  mjf Sync with HEAD.
 1.110.6.3  29-Jun-2008  mjf Sync with HEAD.
 1.110.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.110.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.111.2.1  18-May-2008  yamt sync with head.
 1.112.6.1  27-Jun-2008  simonb Sync with head.
 1.112.4.3  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.112.4.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.112.4.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.112.2.3  11-Aug-2010  yamt sync with head.
 1.112.2.2  11-Mar-2010  yamt sync with head
 1.112.2.1  04-May-2009  yamt sync with head.
 1.113.2.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.113.2.1  19-Oct-2008  haad Sync with HEAD.
 1.116.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.118.4.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.118.4.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.120.2.1  05-Mar-2011  rmind sync with head
 1.121.12.1  24-Feb-2012  mrg sync to -current.
 1.121.8.1  17-Apr-2012  yamt sync with head
 1.122.32.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.123.2.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.123.2.1  21-May-2018  pgoyette Sync with HEAD
 1.124.2.1  10-Jun-2019  christos Sync with HEAD
 1.125.4.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.

RSS XML Feed