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).
This commit is contained in:
parent
2c07dd9842
commit
ef8abe0767
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.251 2001/09/18 18:15:50 wiz Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.252 2001/09/18 19:36:34 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
|
||||
@ -75,7 +75,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.251 2001/09/18 18:15:50 wiz Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.252 2001/09/18 19:36:34 jdolecek Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -1998,7 +1998,6 @@ cpu_exec_ecoff_setregs(p, epp, stack)
|
||||
{
|
||||
struct ecoff_exechdr *execp = (struct ecoff_exechdr *)epp->ep_hdr;
|
||||
|
||||
setregs(p, epp, stack);
|
||||
p->p_md.md_tf->tf_regs[FRAME_GP] = execp->a.gp_value;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpu_exec.c,v 1.28 2001/09/17 17:43:06 jdolecek Exp $ */
|
||||
/* $NetBSD: cpu_exec.c,v 1.29 2001/09/18 19:36:34 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -144,7 +144,6 @@ cpu_exec_ecoff_setregs(p, epp, stack)
|
||||
struct ecoff_exechdr *execp = (struct ecoff_exechdr *)epp->ep_hdr;
|
||||
struct frame *f = (struct frame *)p->p_md.md_regs;
|
||||
|
||||
setregs(p, epp, stack);
|
||||
f->f_regs[GP] = (register_t)execp->a.gp_value;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: aout_exec.c,v 1.11 2001/06/18 02:00:52 christos Exp $ */
|
||||
/* $NetBSD: aout_exec.c,v 1.12 2001/09/18 19:36:38 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -78,6 +78,7 @@ struct emul emul_netbsd_aout = {
|
||||
trapsignal,
|
||||
sigcode,
|
||||
esigcode,
|
||||
setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: aoutm68k_exec.c,v 1.6 2001/06/18 02:00:52 christos Exp $ */
|
||||
/* $NetBSD: aoutm68k_exec.c,v 1.7 2001/09/18 19:36:38 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
@ -73,6 +73,7 @@ struct emul emul_netbsd_aoutm68k = {
|
||||
trapsignal,
|
||||
sigcode,
|
||||
esigcode,
|
||||
setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: freebsd_exec.c,v 1.15 2001/06/18 02:00:52 christos Exp $ */
|
||||
/* $NetBSD: freebsd_exec.c,v 1.16 2001/09/18 19:36:39 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, 1994 Christopher G. Demetriou
|
||||
@ -62,6 +62,7 @@ const struct emul emul_freebsd = {
|
||||
trapsignal,
|
||||
freebsd_sigcode,
|
||||
freebsd_esigcode,
|
||||
freebsd_setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hpux_exec.c,v 1.26 2001/06/18 02:00:52 christos Exp $ */
|
||||
/* $NetBSD: hpux_exec.c,v 1.27 2001/09/18 19:36:39 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||
@ -113,6 +113,7 @@ const struct emul emul_hpux = {
|
||||
trapsignal,
|
||||
sigcode,
|
||||
esigcode,
|
||||
hpux_setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ibcs2_exec.c,v 1.47 2001/06/18 02:00:52 christos Exp $ */
|
||||
/* $NetBSD: ibcs2_exec.c,v 1.48 2001/09/18 19:36:39 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995, 1998 Scott Bartram
|
||||
@ -81,6 +81,7 @@ const struct emul emul_ibcs2 = {
|
||||
trapsignal,
|
||||
ibcs2_sigcode,
|
||||
ibcs2_esigcode,
|
||||
ibcs2_setregs,
|
||||
ibcs2_e_proc_exec,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_exec.c,v 1.52 2001/06/18 02:00:53 christos Exp $ */
|
||||
/* $NetBSD: linux_exec.c,v 1.53 2001/09/18 19:36:39 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994, 1995, 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -124,6 +124,7 @@ const struct emul emul_linux = {
|
||||
linux_trapsignal,
|
||||
linux_sigcode,
|
||||
linux_esigcode,
|
||||
linux_setregs,
|
||||
linux_e_proc_exec,
|
||||
linux_e_proc_fork,
|
||||
linux_e_proc_exit,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mach_exec.c,v 1.2 2001/07/29 21:26:07 christos Exp $ */
|
||||
/* $NetBSD: mach_exec.c,v 1.3 2001/09/18 19:36:40 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -77,6 +77,7 @@ const struct emul emul_mach = {
|
||||
trapsignal,
|
||||
sigcode,
|
||||
esigcode,
|
||||
setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: netbsd32_netbsd.c,v 1.60 2001/06/19 00:36:21 fvdl Exp $ */
|
||||
/* $NetBSD: netbsd32_netbsd.c,v 1.61 2001/09/18 19:36:40 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998, 2001 Matthew R. Green
|
||||
@ -120,6 +120,7 @@ const struct emul emul_netbsd32 = {
|
||||
trapsignal,
|
||||
netbsd32_sigcode,
|
||||
netbsd32_esigcode,
|
||||
netbsd32_setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: osf1_exec.c,v 1.25 2001/06/18 02:00:53 christos Exp $ */
|
||||
/* $NetBSD: osf1_exec.c,v 1.26 2001/09/18 19:36:40 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
|
||||
@ -63,6 +63,7 @@ const struct emul emul_osf1 = {
|
||||
trapsignal,
|
||||
osf1_sigcode,
|
||||
osf1_esigcode,
|
||||
setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sunos_exec.c,v 1.34 2001/06/18 02:00:54 christos Exp $ */
|
||||
/* $NetBSD: sunos_exec.c,v 1.35 2001/09/18 19:36:40 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Theo de Raadt
|
||||
@ -37,6 +37,7 @@
|
||||
#include <sys/mount.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/exec.h>
|
||||
|
||||
#include <compat/sunos/sunos.h>
|
||||
#include <compat/sunos/sunos_syscall.h>
|
||||
@ -66,6 +67,7 @@ struct emul emul_sunos = {
|
||||
trapsignal,
|
||||
sunos_sigcode,
|
||||
sunos_esigcode,
|
||||
setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sunos32_exec.c,v 1.7 2001/06/18 02:00:54 christos Exp $ */
|
||||
/* $NetBSD: sunos32_exec.c,v 1.8 2001/09/18 19:36:41 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Matthew R. Green
|
||||
@ -64,6 +64,7 @@ struct emul emul_sunos = {
|
||||
trapsignal,
|
||||
sunos_sigcode,
|
||||
sunos_esigcode,
|
||||
netbsd32_setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: svr4_exec.c,v 1.45 2001/06/18 02:00:54 christos Exp $ */
|
||||
/* $NetBSD: svr4_exec.c,v 1.46 2001/09/18 19:36:41 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994, 2000 The NetBSD Foundation, Inc.
|
||||
@ -46,6 +46,7 @@
|
||||
#include <compat/svr4/svr4_syscall.h>
|
||||
#include <compat/svr4/svr4_errno.h>
|
||||
#include <compat/svr4/svr4_signal.h>
|
||||
#include <compat/svr4/svr4_exec.h>
|
||||
|
||||
extern char svr4_sigcode[], svr4_esigcode[];
|
||||
extern struct sysent svr4_sysent[];
|
||||
@ -69,6 +70,7 @@ const struct emul emul_svr4 = {
|
||||
trapsignal,
|
||||
svr4_sigcode,
|
||||
svr4_esigcode,
|
||||
svr4_setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: svr4_32_exec.c,v 1.4 2001/06/18 02:00:54 christos Exp $ */
|
||||
/* $NetBSD: svr4_32_exec.c,v 1.5 2001/09/18 19:36:41 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994, 2000 The NetBSD Foundation, Inc.
|
||||
@ -71,6 +71,7 @@ const struct emul emul_svr4_32 = {
|
||||
trapsignal,
|
||||
svr4_32_sigcode,
|
||||
svr4_32_esigcode,
|
||||
svr4_32_setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ultrix_misc.c,v 1.72 2001/09/17 17:47:47 jdolecek Exp $ */
|
||||
/* $NetBSD: ultrix_misc.c,v 1.73 2001/09/18 19:36:41 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995, 1997 Jonathan Stone (hereinafter referred to as the author)
|
||||
@ -172,6 +172,7 @@ const struct emul emul_ultrix = {
|
||||
trapsignal,
|
||||
ultrix_sigcode,
|
||||
ultrix_esigcode,
|
||||
setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: exec_conf.c,v 1.58 2001/07/14 02:06:34 christos Exp $ */
|
||||
/* $NetBSD: exec_conf.c,v 1.59 2001/09/18 19:36:33 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, 1994 Christopher G. Demetriou
|
||||
@ -167,7 +167,7 @@ const struct execsw execsw_builtin[] = {
|
||||
#ifdef COMPAT_NETBSD32
|
||||
{ sizeof(struct netbsd32_exec), exec_netbsd32_makecmds, { NULL },
|
||||
&emul_netbsd32, EXECSW_PRIO_FIRST,
|
||||
0, netbsd32_copyargs, netbsd32_setregs }, /* sparc 32 bit */
|
||||
0, netbsd32_copyargs, NULL }, /* sparc 32 bit */
|
||||
#endif
|
||||
{ sizeof(struct exec), exec_aout_makecmds, { NULL },
|
||||
#ifdef COMPAT_AOUT
|
||||
@ -178,12 +178,12 @@ const struct execsw execsw_builtin[] = {
|
||||
&emul_netbsd,
|
||||
#endif /* COMPAT_AOUT */
|
||||
EXECSW_PRIO_ANY,
|
||||
0, copyargs, setregs }, /* a.out binaries */
|
||||
0, copyargs, NULL }, /* a.out binaries */
|
||||
#endif
|
||||
#ifdef EXEC_COFF
|
||||
{ COFF_HDR_SIZE, exec_coff_makecmds, { NULL },
|
||||
&emul_netbsd, EXECSW_PRIO_ANY,
|
||||
0, copyargs, setregs }, /* coff binaries */
|
||||
0, copyargs, NULL }, /* coff binaries */
|
||||
#endif
|
||||
#ifdef EXEC_ECOFF
|
||||
#ifdef COMPAT_OSF1
|
||||
@ -212,61 +212,61 @@ const struct execsw execsw_builtin[] = {
|
||||
{ ELF32NAME2(netbsd32,probe) },
|
||||
&emul_netbsd32, EXECSW_PRIO_FIRST,
|
||||
howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
|
||||
netbsd32_elf32_copyargs, netbsd32_setregs }, /* NetBSD32 32bit ELF bins */
|
||||
netbsd32_elf32_copyargs, NULL }, /* NetBSD32 32bit ELF bins */
|
||||
/* This one should go first so it matches instead of netbsd */
|
||||
#endif
|
||||
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
||||
{ ELF32NAME2(netbsd,probe) },
|
||||
&emul_netbsd, EXECSW_PRIO_ANY,
|
||||
howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
|
||||
elf32_copyargs, setregs }, /* NetBSD 32bit ELF bins */
|
||||
elf32_copyargs, NULL }, /* NetBSD 32bit ELF bins */
|
||||
#ifdef COMPAT_FREEBSD
|
||||
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
||||
{ ELF32NAME2(freebsd,probe) },
|
||||
&emul_freebsd, EXECSW_PRIO_ANY,
|
||||
FREEBSD_ELF_AUX_ARGSIZ,
|
||||
elf32_copyargs, freebsd_setregs }, /* FreeBSD 32bit ELF bins (not 64bit safe )*/
|
||||
elf32_copyargs, NULL }, /* FreeBSD 32bit ELF bins (not 64bit safe )*/
|
||||
#endif
|
||||
#ifdef COMPAT_LINUX
|
||||
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
||||
{ ELF32NAME2(linux,probe) },
|
||||
&emul_linux, EXECSW_PRIO_ANY,
|
||||
LINUX_ELF_AUX_ARGSIZ,
|
||||
LINUX_COPYARGS_FUNCTION, setregs }, /* Linux 32bit ELF bins */
|
||||
LINUX_COPYARGS_FUNCTION, NULL }, /* Linux 32bit ELF bins */
|
||||
#endif
|
||||
#if defined(EXEC_MACHO) && defined(COMPAT_MACH)
|
||||
{ sizeof (struct exec_macho_fat_header), exec_macho_makecmds,
|
||||
{ .mach_probe_func = exec_mach_probe },
|
||||
&emul_mach, EXECSW_PRIO_ANY,
|
||||
MAXPATHLEN + 1,
|
||||
exec_mach_copyargs, setregs }, /* Mach 32bit MACH-O bins */
|
||||
exec_mach_copyargs, NULL }, /* Mach 32bit MACH-O bins */
|
||||
#endif
|
||||
#ifdef COMPAT_SVR4_32
|
||||
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
||||
{ ELF32NAME2(svr4_32,probe) },
|
||||
&emul_svr4_32, EXECSW_PRIO_ANY,
|
||||
SVR4_32_AUX_ARGSIZ,
|
||||
svr4_32_copyargs, svr4_32_setregs }, /* SVR4 32bit ELF bins (not 64bit safe) */
|
||||
svr4_32_copyargs, NULL }, /* SVR4 32bit ELF bins (not 64bit safe) */
|
||||
#endif
|
||||
#ifdef COMPAT_SVR4
|
||||
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
||||
{ ELF32NAME2(svr4,probe) },
|
||||
&emul_svr4, EXECSW_PRIO_ANY,
|
||||
SVR4_AUX_ARGSIZ,
|
||||
svr4_copyargs, svr4_setregs }, /* SVR4 32bit ELF bins (not 64bit safe) */
|
||||
svr4_copyargs, NULL }, /* SVR4 32bit ELF bins (not 64bit safe) */
|
||||
#endif
|
||||
#ifdef COMPAT_IBCS2
|
||||
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
||||
{ ELF32NAME2(ibcs2,probe) },
|
||||
&emul_ibcs2, EXECSW_PRIO_ANY,
|
||||
IBCS2_ELF_AUX_ARGSIZ, elf32_copyargs, setregs },
|
||||
IBCS2_ELF_AUX_ARGSIZ, elf32_copyargs, NULL },
|
||||
/* SCO 32bit ELF bins (not 64bit safe) */
|
||||
#endif
|
||||
#ifdef EXEC_ELF_CATCHALL
|
||||
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds, { NULL },
|
||||
&emul_netbsd, EXECSW_PRIO_LAST,
|
||||
howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
|
||||
elf32_copyargs, setregs }, /* catch all - run as NetBSD 32bit ELF */
|
||||
elf32_copyargs, NULL }, /* catch all - run as NetBSD 32bit ELF */
|
||||
#endif
|
||||
#endif /* EXEC_ELF32 */
|
||||
#ifdef EXEC_ELF64
|
||||
@ -275,77 +275,77 @@ const struct execsw execsw_builtin[] = {
|
||||
{ ELF64NAME2(netbsd,probe) },
|
||||
&emul_netbsd, EXECSW_PRIO_ANY,
|
||||
howmany(ELF_AUX_ENTRIES * sizeof(Aux64Info), sizeof (Elf64_Addr)),
|
||||
elf64_copyargs, setregs }, /* NetBSD 64bit ELF bins */
|
||||
elf64_copyargs, NULL }, /* NetBSD 64bit ELF bins */
|
||||
#ifdef COMPAT_LINUX
|
||||
{ sizeof (Elf64_Ehdr), exec_elf64_makecmds,
|
||||
{ ELF64NAME2(linux,probe) },
|
||||
&emul_linux, EXECSW_PRIO_ANY,
|
||||
LINUX_ELF_AUX_ARGSIZ,
|
||||
linux_elf64_copyargs, setregs }, /* Linux 64bit ELF bins */
|
||||
linux_elf64_copyargs, NULL }, /* Linux 64bit ELF bins */
|
||||
#endif
|
||||
#ifdef COMPAT_SVR4
|
||||
{ sizeof (Elf64_Ehdr), exec_elf64_makecmds,
|
||||
{ ELF64NAME2(svr4,probe) },
|
||||
&emul_svr4, EXECSW_PRIO_ANY,
|
||||
SVR4_AUX_ARGSIZ64,
|
||||
svr4_copyargs64, svr4_setregs }, /* SVR4 64bit ELF bins (not 64bit safe) */
|
||||
svr4_copyargs64, NULL }, /* SVR4 64bit ELF bins (not 64bit safe) */
|
||||
#endif
|
||||
#ifdef EXEC_ELF_CATCHALL
|
||||
{ sizeof (Elf64_Ehdr), exec_elf64_makecmds, { NULL },
|
||||
&emul_netbsd, EXECSW_PRIO_ANY,
|
||||
howmany(ELF_AUX_ENTRIES * sizeof(Aux64Info), sizeof (Elf64_Addr)),
|
||||
elf64_copyargs, setregs }, /* catch all - run as NetBSD 64bit ELF */
|
||||
elf64_copyargs, NULL }, /* catch all - run as NetBSD 64bit ELF */
|
||||
#endif
|
||||
#endif /* EXEC_ELF64 */
|
||||
#ifdef COMPAT_SUNOS
|
||||
#ifdef COMPAT_NETBSD32
|
||||
{ SUNOS32_AOUT_HDR_SIZE, exec_sunos32_aout_makecmds, { NULL },
|
||||
&emul_sunos, EXECSW_PRIO_ANY,
|
||||
0, netbsd32_copyargs, netbsd32_setregs }, /* SunOS a.out, 64-bit kernel */
|
||||
0, netbsd32_copyargs, NULL }, /* SunOS a.out, 64-bit kernel */
|
||||
#else
|
||||
{ SUNOS_AOUT_HDR_SIZE, exec_sunos_aout_makecmds, { NULL },
|
||||
&emul_sunos, EXECSW_PRIO_ANY,
|
||||
0, copyargs, setregs }, /* SunOS a.out */
|
||||
0, copyargs, NULL }, /* SunOS a.out */
|
||||
#endif
|
||||
#endif
|
||||
#if defined(COMPAT_LINUX) && defined(EXEC_AOUT)
|
||||
{ LINUX_AOUT_HDR_SIZE, exec_linux_aout_makecmds, { NULL },
|
||||
&emul_linux, EXECSW_PRIO_ANY,
|
||||
LINUX_AOUT_AUX_ARGSIZ, linux_aout_copyargs, linux_setregs }, /* linux a.out */
|
||||
LINUX_AOUT_AUX_ARGSIZ, linux_aout_copyargs, NULL }, /* linux a.out */
|
||||
#endif
|
||||
#ifdef COMPAT_IBCS2
|
||||
{ COFF_HDR_SIZE, exec_ibcs2_coff_makecmds, { NULL },
|
||||
&emul_ibcs2, EXECSW_PRIO_ANY,
|
||||
0, copyargs, ibcs2_setregs }, /* coff binaries */
|
||||
0, copyargs, NULL }, /* coff binaries */
|
||||
{ XOUT_HDR_SIZE, exec_ibcs2_xout_makecmds, { NULL },
|
||||
&emul_ibcs2, EXECSW_PRIO_ANY,
|
||||
0, copyargs, ibcs2_setregs }, /* x.out binaries */
|
||||
0, copyargs, NULL }, /* x.out binaries */
|
||||
#endif
|
||||
#if defined(COMPAT_FREEBSD) && defined(EXEC_AOUT)
|
||||
{ FREEBSD_AOUT_HDR_SIZE, exec_freebsd_aout_makecmds, { NULL },
|
||||
&emul_freebsd, EXECSW_PRIO_ANY,
|
||||
0, copyargs, freebsd_setregs }, /* a.out */
|
||||
0, copyargs, NULL }, /* a.out */
|
||||
#endif
|
||||
#ifdef COMPAT_HPUX
|
||||
{ HPUX_EXEC_HDR_SIZE, exec_hpux_makecmds, { NULL },
|
||||
&emul_hpux, EXECSW_PRIO_ANY,
|
||||
0, copyargs, hpux_setregs }, /* HP-UX a.out */
|
||||
0, copyargs, NULL }, /* HP-UX a.out */
|
||||
#endif
|
||||
#ifdef COMPAT_M68K4K
|
||||
{ sizeof(struct exec), exec_m68k4k_makecmds, { NULL },
|
||||
&emul_netbsd, EXECSW_PRIO_ANY,
|
||||
0, copyargs, setregs }, /* m68k4k a.out */
|
||||
0, copyargs, NULL }, /* m68k4k a.out */
|
||||
#endif
|
||||
#ifdef COMPAT_VAX1K
|
||||
{ sizeof(struct exec), exec_vax1k_makecmds, { NULL },
|
||||
&emul_netbsd, EXECSW_PRIO_ANY,
|
||||
0, copyargs, setregs }, /* vax1k a.out */
|
||||
0, copyargs, NULL }, /* vax1k a.out */
|
||||
#endif
|
||||
#ifdef COMPAT_PECOFF
|
||||
{ sizeof(struct exec), exec_pecoff_makecmds, { NULL },
|
||||
&emul_netbsd, EXECSW_PRIO_ANY, /* XXX emul_pecoff once it's different */
|
||||
howmany(sizeof(struct pecoff_args), sizeof(char *)),
|
||||
pecoff_copyargs, setregs }, /* Win32/CE PE/COFF */
|
||||
pecoff_copyargs, NULL }, /* Win32/CE PE/COFF */
|
||||
#endif
|
||||
};
|
||||
int nexecs_builtin = (sizeof(execsw_builtin) / sizeof(struct execsw));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_exec.c,v 1.144 2001/07/29 21:22:42 christos Exp $ */
|
||||
/* $NetBSD: kern_exec.c,v 1.145 2001/09/18 19:36:33 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1993, 1994, 1996 Christopher G. Demetriou
|
||||
@ -140,6 +140,7 @@ const struct emul emul_netbsd = {
|
||||
trapsignal,
|
||||
sigcode,
|
||||
esigcode,
|
||||
setregs,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
@ -639,7 +640,9 @@ sys_execve(struct proc *p, void *v, register_t *retval)
|
||||
vput(pack.ep_vp);
|
||||
|
||||
/* setup new registers and do misc. setup. */
|
||||
(*pack.ep_es->es_setregs)(p, &pack, (u_long) stack);
|
||||
(*pack.ep_es->es_emul->e_setregs)(p, &pack, (u_long) stack);
|
||||
if (pack.ep_es->es_setregs)
|
||||
(*pack.ep_es->es_setregs)(p, &pack, (u_long) stack);
|
||||
|
||||
if (p->p_flag & P_TRACED)
|
||||
psignal(p, SIGTRAP);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_emul.c,v 1.2 2000/12/13 11:18:37 enami Exp $ */
|
||||
/* $NetBSD: lkminit_emul.c,v 1.3 2001/09/18 19:36:34 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -63,7 +63,7 @@ static struct execsw exec_netbsd_aout =
|
||||
{ sizeof(struct exec), exec_aout_makecmds, { NULL },
|
||||
&emul_netbsd_aout,
|
||||
EXECSW_PRIO_FIRST, /* Note: this differs from exec_conf.c entry */
|
||||
0, copyargs, setregs }; /* a.out binaries */
|
||||
0, copyargs }; /* a.out binaries */
|
||||
|
||||
/*
|
||||
* declare the executable format
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_emul.c,v 1.2 2000/12/13 11:18:38 enami Exp $ */
|
||||
/* $NetBSD: lkminit_emul.c,v 1.3 2001/09/18 19:36:35 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -63,7 +63,7 @@ static struct execsw exec_netbsd_aoutm68k =
|
||||
{ sizeof(struct exec), exec_aout_makecmds, { NULL },
|
||||
&emul_netbsd_aoutm68k,
|
||||
EXECSW_PRIO_FIRST, /* Note: this differs from exec_conf.c entry */
|
||||
0, copyargs, setregs }; /* a.out binaries */
|
||||
0, copyargs }; /* a.out binaries */
|
||||
|
||||
/*
|
||||
* declare the executable format
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2001/06/06 20:45:59 mrg Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:35 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -55,7 +55,7 @@ static struct execsw exec_elf =
|
||||
{ netbsd_elf32_probe },
|
||||
&emul_netbsd, EXECSW_PRIO_ANY,
|
||||
howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
|
||||
elf32_copyargs, setregs }; /* NetBSD 32bit ELF bins */
|
||||
elf32_copyargs }; /* NetBSD 32bit ELF bins */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:35 jdolecek Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:35 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -52,7 +52,7 @@ int exec_freebsd_aout_lkmentry __P((struct lkm_table *, int, int));
|
||||
static struct execsw exec_freebsd_aout =
|
||||
{ FREEBSD_AOUT_HDR_SIZE, exec_freebsd_aout_makecmds, { NULL },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
0, copyargs, freebsd_setregs }; /* a.out */
|
||||
0, copyargs }; /* a.out */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.3 2001/05/15 02:00:13 lukem Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.4 2001/09/18 19:36:35 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -56,7 +56,7 @@ static struct execsw exec_freebsd_elf =
|
||||
{ ELFNAME2(freebsd,probe) },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
FREEBSD_ELF_AUX_ARGSIZ,
|
||||
elf32_copyargs, freebsd_setregs }; /* FreeBSD 32bit ELF bins (not 64bit safe )*/
|
||||
elf32_copyargs }; /* FreeBSD 32bit ELF bins (not 64bit safe )*/
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:36 jdolecek Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:35 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -52,7 +52,7 @@ int exec_hpux_aout_lkmentry __P((struct lkm_table *, int, int));
|
||||
static struct execsw exec_hpux_aout =
|
||||
{ HPUX_EXEC_HDR_SIZE, exec_hpux_makecmds, { NULL },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
0, copyargs, hpux_setregs }; /* HP-UX a.out */
|
||||
0, copyargs }; /* HP-UX a.out */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:37 jdolecek Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:36 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -52,7 +52,7 @@ int exec_ibcs2_coff_lkmentry __P((struct lkm_table *, int, int));
|
||||
static struct execsw exec_ibcs2_coff =
|
||||
{ COFF_HDR_SIZE, exec_ibcs2_coff_makecmds, { NULL },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
0, copyargs, ibcs2_setregs }; /* coff binaries */
|
||||
0, copyargs }; /* coff binaries */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/05/15 02:00:13 lukem Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.3 2001/09/18 19:36:36 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -55,7 +55,7 @@ static struct execsw exec_ibcs2_elf =
|
||||
{ sizeof (Elf32_Ehdr), exec_elf32_makecmds,
|
||||
{ ELFNAME2(ibcs2,probe) },
|
||||
&emul_ibcs2, EXECSW_PRIO_ANY,
|
||||
IBCS2_ELF_AUX_ARGSIZ, elf32_copyargs, setregs };
|
||||
IBCS2_ELF_AUX_ARGSIZ, elf32_copyargs };
|
||||
/* SCO 32bit ELF bins (not 64bit safe) */
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:39 jdolecek Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:36 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -51,7 +51,7 @@ int exec_ibcs2_xout_lkmentry __P((struct lkm_table *, int, int));
|
||||
static struct execsw exec_ibcs2_xout =
|
||||
{ XOUT_HDR_SIZE, exec_ibcs2_xout_makecmds, { NULL },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
0, copyargs, ibcs2_setregs }; /* x.out binaries */
|
||||
0, copyargs }; /* x.out binaries */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:40 jdolecek Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:36 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -52,7 +52,7 @@ int exec_linux_aout_lkmentry __P((struct lkm_table *, int, int));
|
||||
static struct execsw exec_linux_aout =
|
||||
{ LINUX_AOUT_HDR_SIZE, exec_linux_aout_makecmds, { NULL },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
LINUX_AOUT_AUX_ARGSIZ, linux_aout_copyargs, linux_setregs }; /* linux a.out */
|
||||
LINUX_AOUT_AUX_ARGSIZ, linux_aout_copyargs }; /* linux a.out */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/05/15 02:00:13 lukem Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.3 2001/09/18 19:36:36 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -57,7 +57,7 @@ static struct execsw exec_linux_elf =
|
||||
NULL, /* will be set by exec_add() */
|
||||
EXECSW_PRIO_ANY,
|
||||
LINUX_ELF_AUX_ARGSIZ,
|
||||
LINUX_COPYARGS_FUNCTION, setregs }; /* Linux 32bit ELF bins */
|
||||
LINUX_COPYARGS_FUNCTION };/* Linux 32bit ELF bins */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:42 jdolecek Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:37 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -50,7 +50,7 @@ int exec_m68k4k_lkmentry __P((struct lkm_table *, int, int));
|
||||
static struct execsw exec_m68k4k =
|
||||
{ sizeof(struct exec), exec_m68k4k_makecmds, { NULL },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
0, copyargs, setregs }; /* m68k4k a.out */
|
||||
0, copyargs }; /* m68k4k a.out */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:43 jdolecek Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:37 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -51,7 +51,7 @@ int exec_netbsd32_aout_lkmentry __P((struct lkm_table *, int, int));
|
||||
static struct execsw exec_netbsd32_aout =
|
||||
{ sizeof(struct netbsd32_exec), exec_netbsd32_makecmds, { NULL },
|
||||
NULL, EXECSW_PRIO_FIRST,
|
||||
0, netbsd32_copyargs, netbsd32_setregs }; /* sparc 32 bit */
|
||||
0, netbsd32_copyargs }; /* sparc 32 bit */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/05/15 02:00:14 lukem Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.3 2001/09/18 19:36:37 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -56,7 +56,7 @@ static struct execsw exec_netbsd32_elf =
|
||||
{ ELFNAME2(netbsd32,probe) },
|
||||
NULL, EXECSW_PRIO_FIRST,
|
||||
howmany(ELF_AUX_ENTRIES * sizeof(Aux32Info), sizeof (Elf32_Addr)),
|
||||
netbsd32_elf32_copyargs, netbsd32_setregs }; /* NetBSD32 32bit ELF bins */
|
||||
netbsd32_elf32_copyargs }; /* NetBSD32 32bit ELF bins */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2001/02/07 13:35:39 mrg Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:37 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -51,7 +51,7 @@ int exec_sunos32_aout_lkmentry __P((struct lkm_table *, int, int));
|
||||
static struct execsw exec_sunos32_aout =
|
||||
{ SUNOS32_AOUT_HDR_SIZE, exec_sunos32_aout_makecmds, { NULL },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
0, netbsd32_copyargs, netbsd32_setregs }; /* SunOS a.out, 64-bit kernel */
|
||||
0, netbsd32_copyargs }; /* SunOS a.out, 64-bit kernel */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:46 jdolecek Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:37 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -50,7 +50,7 @@ int exec_sunos_aout_lkmentry __P((struct lkm_table *, int, int));
|
||||
static struct execsw exec_sunos_aout =
|
||||
{ SUNOS_AOUT_HDR_SIZE, exec_sunos_aout_makecmds, { NULL },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
0, copyargs, setregs }; /* SunOS a.out */
|
||||
0, copyargs }; /* SunOS a.out */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2001/06/05 14:49:00 mrg Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:38 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -57,7 +57,7 @@ static struct execsw exec_svr4_32_elf =
|
||||
{ ELFNAME2(svr4_32,probe) },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
SVR4_32_AUX_ARGSIZ,
|
||||
svr4_32_copyargs, svr4_32_setregs }; /* SVR4_32 32bit ELF bins (not 64bit safe) */
|
||||
svr4_32_copyargs }; /* SVR4_32 32bit ELF bins (not 64bit safe) */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.3 2001/07/18 16:53:34 mrg Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.4 2001/09/18 19:36:38 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -59,13 +59,13 @@ static struct execsw exec_svr4_elf =
|
||||
{ ELFNAME2(svr4,probe) },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
SVR4_AUX_ARGSIZ,
|
||||
svr4_copyargs, svr4_setregs }; /* SVR4 32bit ELF bins (not 64bit safe) */
|
||||
svr4_copyargs }; /* SVR4 32bit ELF bins (not 64bit safe) */
|
||||
#else
|
||||
{ sizeof (Elf64_Ehdr), exec_elf64_makecmds,
|
||||
{ ELFNAME2(svr4,probe) },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
SVR4_AUX_ARGSIZ64,
|
||||
svr4_copyargs64, svr4_setregs }; /* SVR4 64bit ELF bins (not 64bit safe) */
|
||||
svr4_copyargs64 }; /* SVR4 64bit ELF bins (not 64bit safe) */
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lkminit_exec.c,v 1.1 2000/12/08 23:05:49 jdolecek Exp $ */
|
||||
/* $NetBSD: lkminit_exec.c,v 1.2 2001/09/18 19:36:38 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -50,7 +50,7 @@ int exec_vax1k_lkmentry __P((struct lkm_table *, int, int));
|
||||
static struct execsw exec_vax1k =
|
||||
{ sizeof(struct exec), exec_vax1k_makecmds, { NULL },
|
||||
NULL, EXECSW_PRIO_ANY,
|
||||
0, copyargs, setregs }; /* vax1k a.out */
|
||||
0, copyargs }; /* vax1k a.out */
|
||||
|
||||
/*
|
||||
* declare the exec
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: proc.h,v 1.133 2001/06/18 02:00:55 christos Exp $ */
|
||||
/* $NetBSD: proc.h,v 1.134 2001/09/18 19:36:32 jdolecek Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1986, 1989, 1991, 1993
|
||||
@ -105,6 +105,9 @@ struct emul {
|
||||
void (*e_trapsignal) __P((struct proc *, int, u_long));
|
||||
char *e_sigcode; /* Start of sigcode */
|
||||
char *e_esigcode; /* End of sigcode */
|
||||
/* Set registers before execution */
|
||||
void (*e_setregs) __P((struct proc *, struct exec_package *,
|
||||
u_long));
|
||||
|
||||
/* Per-process hooks */
|
||||
void (*e_proc_exec) __P((struct proc *,
|
||||
|
Loading…
Reference in New Issue
Block a user