Subject: Re: execsw/emul struct: move setregs hook?
To: None <tech-kern@netbsd.org>
From: Jaromír <jdolecek@netbsd.org>
List: tech-kern
Date: 09/17/2001 20:00:50
--ELM709718613-3618-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

Hi,
since the ecoff execution code really seems to need some setup run after the
common setregs(), it seems per-exec setregs hook is really necessary.
Thus, I've kept the hook in execsw, and struct emul now has a separate
setregs hook. The emul hook is supposed to setup emulation-specific stuff,
the execsw hook is supposed to setup any executable format specific stuff
(only needed for ecoff).

I think this most closely matches intended behaviour, and would keep
ecoff working.

Let me know if you have a problem with this :)

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
NetBSD - just plain best OS! -=*=- Got spare MCA cards or docs? Hand me them!

--ELM709718613-3618-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=ISO-8859-2
Content-Disposition: attachment; filename=ff

Index: arch/alpha/alpha/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/alpha/machdep.c,v
retrieving revision 1.250
diff -u -p -r1.250 machdep.c
--- arch/alpha/alpha/machdep.c	2001/09/17 17:40:40	1.250
+++ arch/alpha/alpha/machdep.c	2001/09/17 17:50:25
@@ -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;
 }
 
Index: arch/mips/mips/cpu_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/mips/mips/cpu_exec.c,v
retrieving revision 1.28
diff -u -p -r1.28 cpu_exec.c
--- arch/mips/mips/cpu_exec.c	2001/09/17 17:43:06	1.28
+++ arch/mips/mips/cpu_exec.c	2001/09/17 17:50:25
@@ -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;
 }
 
Index: kern/exec_conf.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/exec_conf.c,v
retrieving revision 1.58
diff -u -p -r1.58 exec_conf.c
--- kern/exec_conf.c	2001/07/14 02:06:34	1.58
+++ kern/exec_conf.c	2001/09/17 17:50:25
@@ -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 }, /* 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 },	/* 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 },	/* coff binaries */
 #endif
 #ifdef EXEC_ECOFF
 #ifdef COMPAT_OSF1
@@ -192,17 +192,17 @@ const struct execsw execsw_builtin[] = {
 	  &emul_osf1, EXECSW_PRIO_ANY,
   	  howmany(OSF1_MAX_AUX_ENTRIES * sizeof (struct osf1_auxv) +
 	    2 * (MAXPATHLEN + 1), sizeof (char *)), /* exec & loader names */
-	  osf1_copyargs, cpu_exec_ecoff_setregs }, /* OSF1 ecoff binaries */
+	  osf1_copyargs }, 	/* OSF1 ecoff binaries */
 #endif /* COMPAT_OSF1 */
 	{ ECOFF_HDR_SIZE, exec_ecoff_makecmds,
 	  { .ecoff_probe_func = cpu_exec_ecoff_probe },
 	  &emul_netbsd, EXECSW_PRIO_ANY,
-	  0, copyargs, cpu_exec_ecoff_setregs },	/* ecoff binaries */
+	  0, copyargs },	/* ecoff binaries */
 #ifdef COMPAT_ULTRIX
 	{ ECOFF_HDR_SIZE, exec_ecoff_makecmds,
 	  { .ecoff_probe_func = ultrix_exec_ecoff_probe },
 	  &emul_ultrix, EXECSW_PRIO_LAST, /* XXX probe func alw. succeeds */
-  	  0, copyargs, cpu_exec_ecoff_setregs }, /* Ultrix ecoff binaries */
+  	  0, copyargs }, 	/* Ultrix ecoff binaries */
 #endif /* COMPAT_ULTRIX */
 #endif
 #ifdef EXEC_ELF32
@@ -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 }, /* 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 },	/* 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 },	/* 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 },	/* 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 },		/* 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 },	/* 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 },	/* 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 },
 				/* 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 },  	/* 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 }, 	/* 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 }, /* 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 },	/* 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 }, /* 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 }, 	/* 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 }, 		/* 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 }, /* 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 },	/* coff binaries */
 	{ XOUT_HDR_SIZE, exec_ibcs2_xout_makecmds, { NULL },
 	  &emul_ibcs2, EXECSW_PRIO_ANY,
-	  0, copyargs, ibcs2_setregs },	/* x.out binaries */
+	  0, copyargs },	/* 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 },	/* 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 },	/* 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 },	/* 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 },	/* 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 },	/* Win32/CE PE/COFF */
 #endif
 };
 int nexecs_builtin = (sizeof(execsw_builtin) / sizeof(struct execsw));
Index: kern/kern_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/kern/kern_exec.c,v
retrieving revision 1.144
diff -u -p -r1.144 kern_exec.c
--- kern/kern_exec.c	2001/07/29 21:22:42	1.144
+++ kern/kern_exec.c	2001/09/17 17:50:27
@@ -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, regi
 	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);
Index: compat/aout/aout_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/aout/aout_exec.c,v
retrieving revision 1.11
diff -u -p -r1.11 aout_exec.c
--- compat/aout/aout_exec.c	2001/06/18 02:00:52	1.11
+++ compat/aout/aout_exec.c	2001/09/17 17:50:36
@@ -78,6 +78,7 @@ struct emul emul_netbsd_aout = {
 	trapsignal,
 	sigcode,
 	esigcode,
+	setregs,
 	NULL,
 	NULL,
 	NULL,
Index: compat/aoutm68k/aoutm68k_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/aoutm68k/aoutm68k_exec.c,v
retrieving revision 1.6
diff -u -p -r1.6 aoutm68k_exec.c
--- compat/aoutm68k/aoutm68k_exec.c	2001/06/18 02:00:52	1.6
+++ compat/aoutm68k/aoutm68k_exec.c	2001/09/17 17:50:36
@@ -73,6 +73,7 @@ struct emul emul_netbsd_aoutm68k = {
 	trapsignal,
 	sigcode,
 	esigcode,
+	setregs,
 	NULL,
 	NULL,
 	NULL,
Index: compat/freebsd/freebsd_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/freebsd/freebsd_exec.c,v
retrieving revision 1.15
diff -u -p -r1.15 freebsd_exec.c
--- compat/freebsd/freebsd_exec.c	2001/06/18 02:00:52	1.15
+++ compat/freebsd/freebsd_exec.c	2001/09/17 17:50:36
@@ -62,6 +62,7 @@ const struct emul emul_freebsd = {
 	trapsignal,
 	freebsd_sigcode,
 	freebsd_esigcode,
+	freebsd_setregs,
 	NULL,
 	NULL,
 	NULL,
Index: compat/hpux/hpux_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/hpux/hpux_exec.c,v
retrieving revision 1.26
diff -u -p -r1.26 hpux_exec.c
--- compat/hpux/hpux_exec.c	2001/06/18 02:00:52	1.26
+++ compat/hpux/hpux_exec.c	2001/09/17 17:50:36
@@ -113,6 +113,7 @@ const struct emul emul_hpux = {
 	trapsignal,
 	sigcode,
 	esigcode,
+	hpux_setregs,
 	NULL,
 	NULL,
 	NULL,
Index: compat/ibcs2/ibcs2_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/ibcs2/ibcs2_exec.c,v
retrieving revision 1.47
diff -u -p -r1.47 ibcs2_exec.c
--- compat/ibcs2/ibcs2_exec.c	2001/06/18 02:00:52	1.47
+++ compat/ibcs2/ibcs2_exec.c	2001/09/17 17:50:36
@@ -81,6 +81,7 @@ const struct emul emul_ibcs2 = {
 	trapsignal,
 	ibcs2_sigcode,
 	ibcs2_esigcode,
+	ibcs2_setregs,
 	ibcs2_e_proc_exec,
 	NULL,
 	NULL,
Index: compat/linux/common/linux_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/linux/common/linux_exec.c,v
retrieving revision 1.52
diff -u -p -r1.52 linux_exec.c
--- compat/linux/common/linux_exec.c	2001/06/18 02:00:53	1.52
+++ compat/linux/common/linux_exec.c	2001/09/17 17:50:36
@@ -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,
Index: compat/mach/mach_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/mach/mach_exec.c,v
retrieving revision 1.2
diff -u -p -r1.2 mach_exec.c
--- compat/mach/mach_exec.c	2001/07/29 21:26:07	1.2
+++ compat/mach/mach_exec.c	2001/09/17 17:50:45
@@ -77,6 +77,7 @@ const struct emul emul_mach = {
 	trapsignal,
 	sigcode,
 	esigcode,
+	setregs,
 	NULL,
 	NULL,
 	NULL,
Index: compat/netbsd32/netbsd32_netbsd.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/netbsd32/netbsd32_netbsd.c,v
retrieving revision 1.60
diff -u -p -r1.60 netbsd32_netbsd.c
--- compat/netbsd32/netbsd32_netbsd.c	2001/06/19 00:36:21	1.60
+++ compat/netbsd32/netbsd32_netbsd.c	2001/09/17 17:50:45
@@ -120,6 +120,7 @@ const struct emul emul_netbsd32 = {
 	trapsignal,
 	netbsd32_sigcode,
 	netbsd32_esigcode,
+	netbsd32_setregs,
 	NULL,
 	NULL,
 	NULL,
Index: compat/osf1/osf1_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/osf1/osf1_exec.c,v
retrieving revision 1.25
diff -u -p -r1.25 osf1_exec.c
--- compat/osf1/osf1_exec.c	2001/06/18 02:00:53	1.25
+++ compat/osf1/osf1_exec.c	2001/09/17 17:50:45
@@ -63,6 +64,7 @@ const struct emul emul_osf1 = {
 	trapsignal,
 	osf1_sigcode,
 	osf1_esigcode,
+	setregs,
 	NULL,
 	NULL,
 	NULL,
Index: compat/sunos/sunos_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/sunos/sunos_exec.c,v
retrieving revision 1.34
diff -u -p -r1.34 sunos_exec.c
--- compat/sunos/sunos_exec.c	2001/06/18 02:00:54	1.34
+++ compat/sunos/sunos_exec.c	2001/09/17 17:50:45
@@ -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,
Index: compat/sunos32/sunos32_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/sunos32/sunos32_exec.c,v
retrieving revision 1.7
diff -u -p -r1.7 sunos32_exec.c
--- compat/sunos32/sunos32_exec.c	2001/06/18 02:00:54	1.7
+++ compat/sunos32/sunos32_exec.c	2001/09/17 17:50:45
@@ -64,6 +64,7 @@ struct emul emul_sunos = {
 	trapsignal,
 	sunos_sigcode,
 	sunos_esigcode,
+	netbsd32_setregs,
 	NULL,
 	NULL,
 	NULL,
Index: compat/svr4/svr4_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/svr4/svr4_exec.c,v
retrieving revision 1.45
diff -u -p -r1.45 svr4_exec.c
--- compat/svr4/svr4_exec.c	2001/06/18 02:00:54	1.45
+++ compat/svr4/svr4_exec.c	2001/09/17 17:50:45
@@ -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,
Index: compat/svr4_32/svr4_32_exec.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/svr4_32/svr4_32_exec.c,v
retrieving revision 1.4
diff -u -p -r1.4 svr4_32_exec.c
--- compat/svr4_32/svr4_32_exec.c	2001/06/18 02:00:54	1.4
+++ compat/svr4_32/svr4_32_exec.c	2001/09/17 17:50:45
@@ -71,6 +71,7 @@ const struct emul emul_svr4_32 = {
 	trapsignal,
 	svr4_32_sigcode,
 	svr4_32_esigcode,
+	svr4_32_setregs,
 	NULL,
 	NULL,
 	NULL,
Index: compat/ultrix/ultrix_misc.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/ultrix/ultrix_misc.c,v
retrieving revision 1.72
diff -u -p -r1.72 ultrix_misc.c
--- compat/ultrix/ultrix_misc.c	2001/09/17 17:47:47	1.72
+++ compat/ultrix/ultrix_misc.c	2001/09/17 17:50:45
@@ -172,6 +172,7 @@ const struct emul emul_ultrix = {
 	trapsignal,
 	ultrix_sigcode,
 	ultrix_esigcode,
+	setregs,
 	NULL,
 	NULL,
 	NULL,
Index: sys/proc.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/proc.h,v
retrieving revision 1.133
diff -u -p -r1.133 proc.h
--- sys/proc.h	2001/06/18 02:00:55	1.133
+++ sys/proc.h	2001/09/17 17:51:12
@@ -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 *,

--ELM709718613-3618-0_--