Home | History | Annotate | Download | only in aoutm68k
History log of /src/sys/compat/aoutm68k/aoutm68k_exec.c
RevisionDateAuthorComments
 1.30  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.29  06-May-2018  kamil branches: 1.29.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.28  09-Jan-2018  maya branches: 1.28.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.27  19-Feb-2012  rmind Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.26  15-Oct-2010  tsutsui branches: 1.26.8; 1.26.12;
compat_aoutm68k doesn't require alternative emul path lookup.
 1.25  07-Jul-2010  chs 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.24  02-Jun-2009  pooka branches: 1.24.2; 1.24.4;
Declare extern syscallnames in a header.
 1.23  19-Nov-2008  ad branches: 1.23.4;
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.22  28-Apr-2008  martin branches: 1.22.6; 1.22.8;
Remove clause 3 and 4 from TNF licenses
 1.21  04-Dec-2007  dsl branches: 1.21.12; 1.21.14; 1.21.16;
Remove all the __P
 1.20  11-Dec-2005  christos branches: 1.20.44; 1.20.46; 1.20.52; 1.20.56;
merge ktrace-lwp.
 1.19  26-Mar-2005  fvdl branches: 1.19.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.18  12-Sep-2004  jdolecek branches: 1.18.4; 1.18.6; 1.18.10;
use native syscallnames[] for SYSCALL_DEBUG
 1.17  20-Dec-2003  fvdl Put back Emmanuel's sigfilter hooks, as decided by Core.
 1.16  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.15  05-Dec-2003  jdolecek back the sigfilter emulation hook change off
 1.14  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.13  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.12  10-Nov-2002  jdolecek branches: 1.12.6;
handle __HAVE_MINIMAL_EMUL
 1.11  01-Nov-2002  jdolecek set struct emul's nsysent to compat SYS_NSYSENT, not SYS_MAXSYSCALL
 1.10  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.9  13-Jul-2002  scw m68k syscall rototill:

- Switch all m68k-based ports over to __HAVE_SYSCALL_INTERN.
- Add systrace glue.
- Define struct mdproc in <m68k/proc.h> instead of <machine/proc.h>.
(They were all defined exactly the same anyway, other than a couple
of the MDP_* flags.)
 1.8  13-Nov-2001  lukem branches: 1.8.8;
add RCSIDs (including regeneration of files as appropriate)
 1.7  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.6  18-Jun-2001  christos branches: 1.6.2; 1.6.4;
Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
 1.5  30-May-2001  mrg use _KERNEL_OPT.
 1.4  11-Dec-2000  mycroft branches: 1.4.2; 1.4.4;
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.3  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.2  08-Dec-2000  jdolecek change emulation name from 'netbsd' to 'aoutm68k'
 1.1  02-Dec-2000  scw Initial cut of COMPAT_AOUT_M68K.
This gets most existing m68k a.out binaries working with m68k ELF
kernels.

There are still some remaining ABI issues to track down; most notably,
some ioctl(2) calls are affected by the change.
 1.4.4.6  11-Nov-2002  nathanw Catch up to -current
 1.4.4.5  18-Oct-2002  nathanw Catch up to -current.
 1.4.4.4  01-Aug-2002  nathanw Catch up to -current.
 1.4.4.3  14-Nov-2001  nathanw Catch up to -current.
 1.4.4.2  21-Sep-2001  nathanw Catch up to -current.
 1.4.4.1  21-Jun-2001  nathanw Catch up to -current.
 1.4.2.2  08-Jan-2001  bouyer Files added on trunk.
 1.4.2.1  11-Dec-2000  bouyer file aoutm68k_exec.c was added on branch thorpej_scsipi on 2001-01-08 14:56:43 +0000
 1.6.4.1  01-Oct-2001  fvdl Catch up with -current.
 1.6.2.3  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.6.2.2  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.6.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.8.1  15-Jul-2002  gehenna catch up with -current.
 1.12.6.4  01-Apr-2005  skrll Sync with HEAD.
 1.12.6.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.6.2  18-Sep-2004  skrll Sync with HEAD.
 1.12.6.1  03-Aug-2004  skrll Sync with HEAD
 1.18.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.18.6.1  26-Mar-2005  yamt sync with head.
 1.18.4.1  29-Apr-2005  kent sync with -current
 1.19.2.1  07-Dec-2007  yamt sync with head
 1.20.56.1  08-Dec-2007  ad Sync with head.
 1.20.52.1  08-Dec-2007  mjf Sync with HEAD.
 1.20.46.1  09-Jan-2008  matt sync with HEAD
 1.20.44.1  09-Dec-2007  jmcneill Sync with HEAD.
 1.21.16.4  11-Aug-2010  yamt sync with head.
 1.21.16.3  20-Jun-2009  yamt sync with head
 1.21.16.2  04-May-2009  yamt sync with head.
 1.21.16.1  16-May-2008  yamt sync with head.
 1.21.14.1  18-May-2008  yamt sync with head.
 1.21.12.2  17-Jan-2009  mjf Sync with HEAD.
 1.21.12.1  02-Jun-2008  mjf Sync with HEAD.
 1.22.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.22.6.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.23.4.1  23-Jul-2009  jym Sync with HEAD.
 1.24.4.1  05-Mar-2011  rmind sync with head
 1.24.2.2  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.24.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.26.12.1  24-Feb-2012  mrg sync to -current.
 1.26.8.1  17-Apr-2012  yamt sync with head
 1.28.2.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.28.2.1  21-May-2018  pgoyette Sync with HEAD
 1.29.2.1  10-Jun-2019  christos Sync with HEAD

RSS XML Feed