Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/netbsd32 de-static netbsd32_exec_aout_prep_[zno]m...
details: https://anonhg.NetBSD.org/src/rev/5714d69d40d9
branches: trunk
changeset: 503172:5714d69d40d9
user: mrg <mrg%NetBSD.org@localhost>
date: Fri Feb 02 07:08:17 2001 +0000
description:
de-static netbsd32_exec_aout_prep_[zno]magic().
de-static netbsd32_from_stat43().
move the guts of netbsd32_execve() into netbsd32_execve2().
all of are for the forthcoming sunos32 compat mode (for sparc64).
diffstat:
sys/compat/netbsd32/netbsd32.h | 7 ++++++-
sys/compat/netbsd32/netbsd32_compat_43.c | 5 ++---
sys/compat/netbsd32/netbsd32_exec.h | 5 ++++-
sys/compat/netbsd32/netbsd32_exec_aout.c | 8 +-------
sys/compat/netbsd32/netbsd32_netbsd.c | 32 +++++++++++++++++++++-----------
5 files changed, 34 insertions(+), 23 deletions(-)
diffs (165 lines):
diff -r ddda43b9d1d1 -r 5714d69d40d9 sys/compat/netbsd32/netbsd32.h
--- a/sys/compat/netbsd32/netbsd32.h Fri Feb 02 06:27:44 2001 +0000
+++ b/sys/compat/netbsd32/netbsd32.h Fri Feb 02 07:08:17 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32.h,v 1.15 2000/12/03 13:15:38 fvdl Exp $ */
+/* $NetBSD: netbsd32.h,v 1.16 2001/02/02 07:08:17 mrg Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@@ -40,6 +40,8 @@
#include <sys/systm.h>
#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/syscallargs.h>
#include <sys/ipc.h>
#include <sys/shm.h>
@@ -526,5 +528,8 @@
* random other stuff
*/
#include <compat/common/compat_util.h>
+
+void netbsd32_from_stat43 __P((struct stat43 *, struct netbsd32_stat43 *));
+int netbsd32_execve2(struct proc *, struct sys_execve_args *, register_t *);
#endif /* _COMPAT_NETBSD32_NETBSD32_H_ */
diff -r ddda43b9d1d1 -r 5714d69d40d9 sys/compat/netbsd32/netbsd32_compat_43.c
--- a/sys/compat/netbsd32/netbsd32_compat_43.c Fri Feb 02 06:27:44 2001 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_43.c Fri Feb 02 07:08:17 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_43.c,v 1.13 2000/12/03 14:47:27 fvdl Exp $ */
+/* $NetBSD: netbsd32_compat_43.c,v 1.14 2001/02/02 07:08:17 mrg Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@@ -49,13 +49,12 @@
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
-static void netbsd32_from_stat43 __P((struct stat43 *, struct netbsd32_stat43 *));
int compat_43_netbsd32_sethostid __P((struct proc *, void *, register_t *));
int compat_43_netbsd32_killpg __P((struct proc *, void *, register_t *retval));
int compat_43_netbsd32_sigblock __P((struct proc *, void *, register_t *retval));
int compat_43_netbsd32_sigblock __P((struct proc *, void *, register_t *retval));
-static void
+void
netbsd32_from_stat43(sp43, sp32)
struct stat43 *sp43;
struct netbsd32_stat43 *sp32;
diff -r ddda43b9d1d1 -r 5714d69d40d9 sys/compat/netbsd32/netbsd32_exec.h
--- a/sys/compat/netbsd32/netbsd32_exec.h Fri Feb 02 06:27:44 2001 +0000
+++ b/sys/compat/netbsd32/netbsd32_exec.h Fri Feb 02 07:08:17 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_exec.h,v 1.7 2000/12/01 22:05:18 jdolecek Exp $ */
+/* $NetBSD: netbsd32_exec.h,v 1.8 2001/02/02 07:08:17 mrg Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@@ -53,6 +53,9 @@
extern const struct emul emul_netbsd32;
#ifdef EXEC_AOUT
+int netbsd32_exec_aout_prep_zmagic __P((struct proc *, struct exec_package *));
+int netbsd32_exec_aout_prep_nmagic __P((struct proc *, struct exec_package *));
+int netbsd32_exec_aout_prep_omagic __P((struct proc *, struct exec_package *));
int exec_netbsd32_makecmds __P((struct proc *, struct exec_package *));
#endif
#ifdef EXEC_ELF32
diff -r ddda43b9d1d1 -r 5714d69d40d9 sys/compat/netbsd32/netbsd32_exec_aout.c
--- a/sys/compat/netbsd32/netbsd32_exec_aout.c Fri Feb 02 06:27:44 2001 +0000
+++ b/sys/compat/netbsd32/netbsd32_exec_aout.c Fri Feb 02 07:08:17 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_exec_aout.c,v 1.2 2000/12/18 14:50:04 mrg Exp $ */
+/* $NetBSD: netbsd32_exec_aout.c,v 1.3 2001/02/02 07:08:18 mrg Exp $ */
/* from: NetBSD: exec_aout.c,v 1.15 1996/09/26 23:34:46 cgd Exp */
/*
@@ -54,12 +54,6 @@
int netbsd32_copyinargs __P((struct exec_package *, struct ps_strings *,
void *, size_t, const void *, const void *));
-static int netbsd32_exec_aout_prep_zmagic __P((struct proc *,
- struct exec_package *));
-static int netbsd32_exec_aout_prep_nmagic __P((struct proc *,
- struct exec_package *));
-static int netbsd32_exec_aout_prep_omagic __P((struct proc *,
- struct exec_package *));
int netbsd32_exec_aout_setup_stack __P((struct proc *p,
struct exec_package *epp));
diff -r ddda43b9d1d1 -r 5714d69d40d9 sys/compat/netbsd32/netbsd32_netbsd.c
--- a/sys/compat/netbsd32/netbsd32_netbsd.c Fri Feb 02 06:27:44 2001 +0000
+++ b/sys/compat/netbsd32/netbsd32_netbsd.c Fri Feb 02 07:08:17 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_netbsd.c,v 1.48 2001/01/22 20:08:05 jdolecek Exp $ */
+/* $NetBSD: netbsd32_netbsd.c,v 1.49 2001/02/02 07:08:18 mrg Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@@ -1800,6 +1800,22 @@
} */ *uap = v;
struct sys_execve_args ua;
caddr_t sg;
+
+ NETBSD32TOP_UAP(path, const char);
+ NETBSD32TOP_UAP(argp, char *);
+ NETBSD32TOP_UAP(envp, char *);
+ sg = stackgap_init(p->p_emul);
+ CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
+
+ return netbsd32_execve2(p, &ua, retval);
+}
+
+int
+netbsd32_execve2(p, uap, retval)
+ struct proc *p;
+ struct sys_execve_args *uap;
+ register_t *retval;
+{
/* Function args */
int error, i;
struct exec_package pack;
@@ -1819,20 +1835,14 @@
int szsigcode;
struct exec_vmcmd *base_vcp = NULL;
- NETBSD32TOP_UAP(path, const char);
- NETBSD32TOP_UAP(argp, char *);
- NETBSD32TOP_UAP(envp, char *);
- sg = stackgap_init(p->p_emul);
- CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
-
/* init the namei data to point the file user's program name */
/* XXX cgd 960926: why do this here? most will be clobbered. */
- NDINIT(&nid, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(&ua, path), p);
+ NDINIT(&nid, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
/*
* initialize the fields of the exec package.
*/
- pack.ep_name = SCARG(&ua, path);
+ pack.ep_name = SCARG(uap, path);
pack.ep_hdr = malloc(exec_maxhdrsz, M_EXEC, M_WAITOK);
pack.ep_hdrlen = exec_maxhdrsz;
pack.ep_hdrvalid = 0;
@@ -1879,7 +1889,7 @@
}
/* Now get argv & environment */
- if (!(cpp = (netbsd32_charp *)SCARG(&ua, argp))) {
+ if (!(cpp = (netbsd32_charp *)SCARG(uap, argp))) {
error = EINVAL;
goto bad;
}
@@ -1906,7 +1916,7 @@
envc = 0;
/* environment need not be there */
- if ((cpp = (netbsd32_charp *)SCARG(&ua, envp)) != NULL ) {
+ if ((cpp = (netbsd32_charp *)SCARG(uap, envp)) != NULL ) {
while (1) {
len = argp + ARG_MAX - dp;
if ((error = copyin(cpp, &sp, sizeof(sp))) != 0)
Home |
Main Index |
Thread Index |
Old Index