Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/netbsd32 SPARC32->NETBSD32



details:   https://anonhg.NetBSD.org/src/rev/7d36e540f534
branches:  trunk
changeset: 467532:7d36e540f534
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Mar 25 16:58:39 1999 +0000

description:
SPARC32->NETBSD32

diffstat:

 sys/compat/netbsd32/netbsd32.h           |   40 +-
 sys/compat/netbsd32/netbsd32_compat_09.c |    4 +-
 sys/compat/netbsd32/netbsd32_compat_12.c |   26 +-
 sys/compat/netbsd32/netbsd32_compat_43.c |  134 +++---
 sys/compat/netbsd32/netbsd32_exec.h      |    8 +-
 sys/compat/netbsd32/netbsd32_ioctl.c     |    8 +-
 sys/compat/netbsd32/netbsd32_netbsd.c    |  550 +++++++++++++++---------------
 7 files changed, 389 insertions(+), 381 deletions(-)

diffs (truncated from 1904 to 300 lines):

diff -r 7b3f5e0fe7b7 -r 7d36e540f534 sys/compat/netbsd32/netbsd32.h
--- a/sys/compat/netbsd32/netbsd32.h    Thu Mar 25 16:50:51 1999 +0000
+++ b/sys/compat/netbsd32/netbsd32.h    Thu Mar 25 16:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32.h,v 1.5 1999/03/25 16:27:56 mrg Exp $ */
+/*     $NetBSD: netbsd32.h,v 1.6 1999/03/25 16:58:39 mrg Exp $ */
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -28,14 +28,14 @@
  * SUCH DAMAGE.
  */
 
-#ifndef _COMPAT_SPARC32_SPARC32_H_
-#define _COMPAT_SPARC32_SPARC32_H_
+#ifndef _COMPAT_NETBSD32_NETBSD32_H_
+#define _COMPAT_NETBSD32_NETBSD32_H_
 /* We need to change the size of register_t */
 #ifdef syscallargs
 #undef syscallargs
 #endif
 /*
- * SPARC 32-bit compatibility module.
+ * NetBSD 32-bit compatibility module.
  */
 
 #include <sys/mount.h>
@@ -415,8 +415,16 @@
 
 /*
  * machine depedant section; must define:
- *     netbsd32_sigcontextp_t  - point to sigcontext
- *     <arch32>_sigcontext
+ *     struct netbsd32_sigcontext
+ *             - 32bit compatibility sigcontext for this arch.
+ *     netbsd32_sigcontextp_t
+ *             - type of pointer to above, normally u_int32_t
+ *     void netbsd32_setregs(struct proc *p, struct exec_package *pack,
+ *         u_long stack /* XXX */);
+ *     int compat_netbsd32_sigreturn(struct proc *p, void *v,
+ *         register_t *retval);
+ *     void netbsd32_sendsig(sig_t catcher, int sig, int mask, u_long code);
+ *             - the above are
  */
 
 #include <machine/netbsd32_machdep.h>
@@ -426,20 +434,20 @@
  * note that they do *NOT* act like good macros and put ()'s around all
  * arguments cuz this _breaks_ SCARG().
  */
-#define SPARC32TO64(s32uap, uap, name) \
+#define NETBSD32TO64(s32uap, uap, name) \
            SCARG(uap, name) = SCARG(s32uap, name)
-#define SPARC32TOP(s32uap, uap, name, type) \
+#define NETBSD32TOP(s32uap, uap, name, type) \
            SCARG(uap, name) = (type *)(u_long)(u_int)SCARG(s32uap, name)
-#define SPARC32TOX(s32uap, uap, name, type) \
+#define NETBSD32TOX(s32uap, uap, name, type) \
            SCARG(uap, name) = (type)SCARG(s32uap, name)
-#define SPARC32TOX64(s32uap, uap, name, type) \
+#define NETBSD32TOX64(s32uap, uap, name, type) \
            SCARG(uap, name) = (type)(u_long)SCARG(s32uap, name)
 
 /* and some standard versions */
-#define        SPARC32TO64_UAP(name)           SPARC32TO64(uap, &ua, name);
-#define        SPARC32TOP_UAP(name, type)      SPARC32TOP(uap, &ua, name, type);
-#define        SPARC32TOX_UAP(name, type)      SPARC32TOX(uap, &ua, name, type);
-#define        SPARC32TOX64_UAP(name, type)    SPARC32TOX64(uap, &ua, name, type);
+#define        NETBSD32TO64_UAP(name)          NETBSD32TO64(uap, &ua, name);
+#define        NETBSD32TOP_UAP(name, type)     NETBSD32TOP(uap, &ua, name, type);
+#define        NETBSD32TOX_UAP(name, type)     NETBSD32TOX(uap, &ua, name, type);
+#define        NETBSD32TOX64_UAP(name, type)   NETBSD32TOX64(uap, &ua, name, type);
 
 /*
  * random other stuff
@@ -448,7 +456,7 @@
  
 extern const char netbsd32_emul_path[];
   
-#define SPARC32_CHECK_ALT_EXIST(p, sgp, path) \
+#define NETBSD32_CHECK_ALT_EXIST(p, sgp, path) \
     emul_find(p, sgp, netbsd32_emul_path, (char *)path, (char **)&path, 0)
 
-#endif /* _COMPAT_SPARC32_SPARC32_H_ */
+#endif /* _COMPAT_NETBSD32_NETBSD32_H_ */
diff -r 7b3f5e0fe7b7 -r 7d36e540f534 sys/compat/netbsd32/netbsd32_compat_09.c
--- a/sys/compat/netbsd32/netbsd32_compat_09.c  Thu Mar 25 16:50:51 1999 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_09.c  Thu Mar 25 16:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_compat_09.c,v 1.2 1999/03/25 16:22:49 mrg Exp $       */
+/*     $NetBSD: netbsd32_compat_09.c,v 1.3 1999/03/25 16:58:39 mrg Exp $       */
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -89,6 +89,6 @@
        } */ *uap = v;
        struct compat_09_sys_uname_args ua;
 
-       SPARC32TOP_UAP(name, struct outsname);
+       NETBSD32TOP_UAP(name, struct outsname);
        return (compat_09_sys_uname(p, &ua, retval));
 }
diff -r 7b3f5e0fe7b7 -r 7d36e540f534 sys/compat/netbsd32/netbsd32_compat_12.c
--- a/sys/compat/netbsd32/netbsd32_compat_12.c  Thu Mar 25 16:50:51 1999 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_12.c  Thu Mar 25 16:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_compat_12.c,v 1.4 1999/03/25 16:22:49 mrg Exp $       */
+/*     $NetBSD: netbsd32_compat_12.c,v 1.5 1999/03/25 16:58:39 mrg Exp $       */
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -82,7 +82,7 @@
        } */ *uap = v;
        struct compat_12_sys_reboot_args ua;
 
-       SPARC32TO64_UAP(opt);
+       NETBSD32TO64_UAP(opt);
        return (compat_12_sys_reboot(p, &ua, retval));
 }
 
@@ -98,8 +98,8 @@
        } */ *uap = v;
        struct sys___msync13_args ua;
 
-       SPARC32TOX64_UAP(addr, caddr_t);
-       SPARC32TOX_UAP(len, size_t);
+       NETBSD32TOX64_UAP(addr, caddr_t);
+       NETBSD32TOX_UAP(len, size_t);
        SCARG(&ua, flags) = MS_SYNC | MS_INVALIDATE;
        return (sys___msync13(p, &ua, retval));
 }
@@ -138,10 +138,10 @@
        caddr_t sg;
        int rv;
 
-       SPARC32TOP_UAP(path, const char);
+       NETBSD32TOP_UAP(path, const char);
        SCARG(&ua, ub) = &sb12;
        sg = stackgap_init(p->p_emul);
-       SPARC32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
+       NETBSD32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
 
        rv = compat_12_sys_stat(p, &ua, retval);
 
@@ -167,7 +167,7 @@
        struct compat_12_sys_fstat_args ua;
        int rv;
 
-       SPARC32TO64_UAP(fd);
+       NETBSD32TO64_UAP(fd);
        SCARG(&ua, sb) = &sb12;
        rv = compat_12_sys_fstat(p, &ua, retval);
 
@@ -194,10 +194,10 @@
        caddr_t sg;
        int rv;
 
-       SPARC32TOP_UAP(path, const char);
+       NETBSD32TOP_UAP(path, const char);
        SCARG(&ua, ub) = &sb12;
        sg = stackgap_init(p->p_emul);
-       SPARC32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
+       NETBSD32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
 
        rv = compat_12_sys_lstat(p, &ua, retval);
 
@@ -221,10 +221,10 @@
        } */ *uap = v;
        struct compat_12_sys_getdirentries_args ua;
 
-       SPARC32TO64_UAP(fd);
-       SPARC32TOP_UAP(buf, char);
-       SPARC32TO64_UAP(count);
-       SPARC32TOP_UAP(basep, long);
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(buf, char);
+       NETBSD32TO64_UAP(count);
+       NETBSD32TOP_UAP(basep, long);
 
        return (compat_12_sys_getdirentries(p, &ua, retval));
 }
diff -r 7b3f5e0fe7b7 -r 7d36e540f534 sys/compat/netbsd32/netbsd32_compat_43.c
--- a/sys/compat/netbsd32/netbsd32_compat_43.c  Thu Mar 25 16:50:51 1999 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_43.c  Thu Mar 25 16:58:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_compat_43.c,v 1.5 1999/03/25 16:22:49 mrg Exp $       */
+/*     $NetBSD: netbsd32_compat_43.c,v 1.6 1999/03/25 16:58:39 mrg Exp $       */
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -85,11 +85,11 @@
        struct sys_open_args  ua;
        caddr_t sg;
 
-       SPARC32TOP_UAP(path, const char);
-       SPARC32TO64_UAP(mode);
+       NETBSD32TOP_UAP(path, const char);
+       NETBSD32TO64_UAP(mode);
        SCARG(&ua, flags) = O_WRONLY | O_CREAT | O_TRUNC;
        sg = stackgap_init(p->p_emul);
-       SPARC32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
+       NETBSD32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
 
        return (sys_open(p, &ua, retval));
 }
@@ -110,8 +110,8 @@
        off_t rt;
 
        SCARG(&ua, fd) = SCARG(uap, fd);
-       SPARC32TOX_UAP(offset, long);
-       SPARC32TO64_UAP(whence);
+       NETBSD32TOX_UAP(offset, long);
+       NETBSD32TO64_UAP(whence);
        rv = sys_lseek(p, &ua, (register_t *)&rt);
        *(netbsd32_long *)retval = rt;
 
@@ -135,10 +135,10 @@
        caddr_t sg;
        int rv;
 
-       SPARC32TOP_UAP(path, const char);
+       NETBSD32TOP_UAP(path, const char);
        SCARG(&ua, ub) = &sb43;
        sg = stackgap_init(p->p_emul);
-       SPARC32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
+       NETBSD32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
 
        rv = compat_43_sys_stat(p, &ua, retval);
 
@@ -165,10 +165,10 @@
        caddr_t sg;
        int rv;
 
-       SPARC32TOP_UAP(path, const char);
+       NETBSD32TOP_UAP(path, const char);
        SCARG(&ua, ub) = &sb43;
        sg = stackgap_init(p->p_emul);
-       SPARC32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
+       NETBSD32_CHECK_ALT_EXIST(p, &sg, SCARG(&ua, path));
 
        rv = compat_43_sys_stat(p, &ua, retval);
 
@@ -194,7 +194,7 @@
        struct compat_43_sys_fstat_args ua;
        int rv;
 
-       SPARC32TO64_UAP(fd);
+       NETBSD32TO64_UAP(fd);
        SCARG(&ua, sb) = &sb43;
        rv = compat_43_sys_fstat(p, &ua, retval);
 
@@ -216,8 +216,8 @@
        } */ *uap = v;
        struct sys_truncate_args ua;
 
-       SPARC32TOP_UAP(path, const char);
-       SPARC32TO64_UAP(length);
+       NETBSD32TOP_UAP(path, const char);
+       NETBSD32TO64_UAP(length);
        return (sys_ftruncate(p, &ua, retval));
 }
 
@@ -233,8 +233,8 @@
        } */ *uap = v;
        struct sys_ftruncate_args ua;
 
-       SPARC32TO64_UAP(fd);
-       SPARC32TO64_UAP(length);
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TO64_UAP(length);
        return (sys_ftruncate(p, &ua, retval));
 }
 
@@ -252,10 +252,10 @@
        } */ *uap = v;
        struct compat_43_sys_getdirentries_args ua;
 
-       SPARC32TO64_UAP(fd);
-       SPARC32TOP_UAP(buf, char);
-       SPARC32TO64_UAP(count);
-       SPARC32TOP_UAP(basep, long);
+       NETBSD32TO64_UAP(fd);
+       NETBSD32TOP_UAP(buf, char);
+       NETBSD32TO64_UAP(count);
+       NETBSD32TOP_UAP(basep, long);
        return (compat_43_sys_getdirentries(p, &ua, retval));
 }
 
@@ -274,10 +274,10 @@
        } */ *uap = v;
        struct compat_43_sys_getkerninfo_args ua;
 
-       SPARC32TO64_UAP(op);
-       SPARC32TOP_UAP(where, char);
-       SPARC32TOP_UAP(size, int);
-       SPARC32TO64_UAP(arg);
+       NETBSD32TO64_UAP(op);
+       NETBSD32TOP_UAP(where, char);
+       NETBSD32TOP_UAP(size, int);
+       NETBSD32TO64_UAP(arg);



Home | Main Index | Thread Index | Old Index