Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Update to 32-bit compatibility routines.



details:   https://anonhg.NetBSD.org/src/rev/a281d0d351bd
branches:  trunk
changeset: 480010:a281d0d351bd
user:      eeh <eeh%NetBSD.org@localhost>
date:      Thu Dec 30 15:40:45 1999 +0000

description:
Update to 32-bit compatibility routines.

diffstat:

 sys/compat/netbsd32/netbsd32.h             |   41 +-
 sys/compat/netbsd32/netbsd32_compat_13.c   |   44 +-
 sys/compat/netbsd32/netbsd32_compat_14.c   |   18 +-
 sys/compat/netbsd32/netbsd32_compat_43.c   |   10 +-
 sys/compat/netbsd32/netbsd32_exec.c        |  213 ++++++---
 sys/compat/netbsd32/netbsd32_exec.h        |    8 +-
 sys/compat/netbsd32/netbsd32_ioctl.c       |   14 +-
 sys/compat/netbsd32/netbsd32_netbsd.c      |  631 ++++++++++++++++++++++++++--
 sys/compat/netbsd32/netbsd32_syscall.h     |   57 ++-
 sys/compat/netbsd32/netbsd32_syscallargs.h |   97 ++++-
 sys/compat/netbsd32/netbsd32_syscalls.c    |   37 +-
 sys/compat/netbsd32/netbsd32_sysent.c      |   55 ++-
 sys/compat/netbsd32/syscalls.master        |   45 +-
 13 files changed, 1081 insertions(+), 189 deletions(-)

diffs (truncated from 2033 to 300 lines):

diff -r b2530ea286a1 -r a281d0d351bd sys/compat/netbsd32/netbsd32.h
--- a/sys/compat/netbsd32/netbsd32.h    Thu Dec 30 15:39:40 1999 +0000
+++ b/sys/compat/netbsd32/netbsd32.h    Thu Dec 30 15:40:45 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32.h,v 1.9 1999/10/11 01:36:22 eeh Exp $ */
+/*     $NetBSD: netbsd32.h,v 1.10 1999/12/30 15:40:45 eeh Exp $        */
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -87,10 +87,11 @@
 
 /* from <sys/time.h> */
 typedef int32_t netbsd32_timer_t;
+typedef        int32_t netbsd32_time_t;
 
 typedef u_int32_t netbsd32_timespecp_t;
 struct netbsd32_timespec {
-       time_t  tv_sec;                 /* seconds */
+       netbsd32_time_t tv_sec;                 /* seconds */
        netbsd32_long   tv_nsec;        /* and nanoseconds */
 };
 
@@ -206,9 +207,9 @@
        netbsd32_msglen_t       msg_qbytes;     /* max # of bytes in the queue */
        pid_t           msg_lspid;      /* process ID of last msgsend() */
        pid_t           msg_lrpid;      /* process ID of last msgrcv() */
-       time_t          msg_stime;      /* time of last msgsend() */
-       time_t          msg_rtime;      /* time of last msgrcv() */
-       time_t          msg_ctime;      /* time of last change */
+       netbsd32_time_t         msg_stime;      /* time of last msgsend() */
+       netbsd32_time_t         msg_rtime;      /* time of last msgrcv() */
+       netbsd32_time_t         msg_ctime;      /* time of last change */
 
        /*
         * These members are private and used only in the internal
@@ -227,11 +228,11 @@
        netbsd32_u_long msg_qbytes;     /* max # of bytes on the queue */
        pid_t msg_lspid;                /* pid of last msgsnd() */
        pid_t msg_lrpid;                /* pid of last msgrcv() */
-       time_t  msg_stime;              /* time of last msgsnd() */
+       netbsd32_time_t msg_stime;              /* time of last msgsnd() */
        netbsd32_long   msg_pad1;
-       time_t  msg_rtime;              /* time of last msgrcv() */
+       netbsd32_time_t msg_rtime;              /* time of last msgrcv() */
        netbsd32_long   msg_pad2;
-       time_t  msg_ctime;              /* time of last msgctl() */
+       netbsd32_time_t msg_ctime;              /* time of last msgctl() */
        netbsd32_long   msg_pad3;
        netbsd32_long   msg_pad4[4];
 };
@@ -243,8 +244,8 @@
 struct netbsd32_semid_ds {
        struct netbsd32_ipc_perm        sem_perm;/* operation permission struct */
        unsigned short  sem_nsems;      /* number of sems in set */
-       time_t          sem_otime;      /* last operation time */
-       time_t          sem_ctime;      /* last change time */
+       netbsd32_time_t         sem_otime;      /* last operation time */
+       netbsd32_time_t         sem_ctime;      /* last change time */
 
        /*
         * These members are private and used only in the internal
@@ -257,9 +258,9 @@
        struct netbsd32_ipc_perm        sem_perm;/* operation permission struct */
        netbsd32_semp_t sem_base;       /* pointer to first semaphore in set */
        unsigned short  sem_nsems;      /* number of sems in set */
-       time_t  sem_otime;              /* last operation time */
+       netbsd32_time_t sem_otime;              /* last operation time */
        netbsd32_long   sem_pad1;       /* SVABI/386 says I need this here */
-       time_t  sem_ctime;              /* last change time */
+       netbsd32_time_t sem_ctime;              /* last change time */
                                        /* Times measured in secs since */
                                        /* 00:00:00 GMT, Jan. 1, 1970 */
        netbsd32_long   sem_pad2;       /* SVABI/386 says I need this here */
@@ -288,13 +289,14 @@
        pid_t           shm_lpid;       /* process ID of last shm op */
        pid_t           shm_cpid;       /* process ID of creator */
        short           shm_nattch;     /* number of current attaches */
-       time_t          shm_atime;      /* time of last shmat() */
-       time_t          shm_dtime;      /* time of last shmdt() */
-       time_t          shm_ctime;      /* time of last change by shmctl() */
+       netbsd32_time_t         shm_atime;      /* time of last shmat() */
+       netbsd32_time_t         shm_dtime;      /* time of last shmdt() */
+       netbsd32_time_t         shm_ctime;      /* time of last change by shmctl() */
        netbsd32_voidp  _shm_internal;  /* sysv stupidity */
 };
 
 /* from <sys/signal.h> */
+typedef u_int32_t netbsd32_sigsetp_t;
 typedef u_int32_t netbsd32_sigactionp_t;
 struct netbsd32_sigaction {
        netbsd32_voidp sa_handler;      /* signal handler */
@@ -403,9 +405,9 @@
        uid_t     st_uid;               /* user ID of the file's owner */
        gid_t     st_gid;               /* group ID of the file's group */
        dev_t     st_rdev;              /* device type */
-       struct    timespec st_atimespec;/* time of last access */
-       struct    timespec st_mtimespec;/* time of last data modification */
-       struct    timespec st_ctimespec;/* time of last file status change */
+       struct    netbsd32_timespec st_atimespec;/* time of last access */
+       struct    netbsd32_timespec st_mtimespec;/* time of last data modification */
+       struct    netbsd32_timespec st_ctimespec;/* time of last file status change */
        off_t     st_size;              /* file size, in bytes */
        blkcnt_t  st_blocks;            /* blocks allocated for file */
        blksize_t st_blksize;           /* optimal blocksize for I/O */
@@ -505,6 +507,7 @@
 extern const char netbsd32_emul_path[];
   
 #define NETBSD32_CHECK_ALT_EXIST(p, sgp, path) \
-    emul_find(p, sgp, netbsd32_emul_path, (char *)path, (char **)&path, 0)
+    emul_find(p, sgp, netbsd32_emul_path, (const char *)path, \
+       (const char **)&path, 0)
 
 #endif /* _COMPAT_NETBSD32_NETBSD32_H_ */
diff -r b2530ea286a1 -r a281d0d351bd sys/compat/netbsd32/netbsd32_compat_13.c
--- a/sys/compat/netbsd32/netbsd32_compat_13.c  Thu Dec 30 15:39:40 1999 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_13.c  Thu Dec 30 15:40:45 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_compat_13.c,v 1.4 1999/10/11 01:36:22 eeh Exp $       */
+/*     $NetBSD: netbsd32_compat_13.c,v 1.5 1999/12/30 15:40:45 eeh Exp $       */
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -71,3 +71,45 @@
 
        return (rv);
 }
+
+
+int
+compat_13_netbsd32_sigprocmask(p, v, retval)
+       register struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       struct compat_13_netbsd32_sigprocmask_args /* {
+               syscallarg(int) how;
+               syscallarg(int) mask;
+       } */ *uap = v;
+       sigset13_t ness, oess;
+       sigset_t nbss, obss;
+       int error;
+
+       ness = SCARG(uap, mask);
+       native_sigset13_to_sigset(&ness, &nbss);
+       error = sigprocmask1(p, SCARG(uap, how), &nbss, &obss);
+       if (error)
+               return (error);
+       native_sigset_to_sigset13(&obss, &oess);
+       *retval = oess;
+       return (0);
+}
+
+int
+compat_13_netbsd32_sigsuspend(p, v, retval)
+       register struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       struct compat_13_netbsd32_sigsuspend_args /* {
+               syscallarg(sigset13_t) mask;
+       } */ *uap = v;
+       sigset13_t ess;
+       sigset_t bss;
+
+       ess = SCARG(uap, mask);
+       native_sigset13_to_sigset(&ess, &bss);
+       return (sigsuspend1(p, &bss));
+}
diff -r b2530ea286a1 -r a281d0d351bd sys/compat/netbsd32/netbsd32_compat_14.c
--- a/sys/compat/netbsd32/netbsd32_compat_14.c  Thu Dec 30 15:39:40 1999 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_14.c  Thu Dec 30 15:40:45 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_compat_14.c,v 1.1 1999/10/11 01:36:22 eeh Exp $       */
+/*     $NetBSD: netbsd32_compat_14.c,v 1.2 1999/12/30 15:40:45 eeh Exp $       */
 
 /*
  * Copyright (c) 1999 Eduardo E. Horvath
@@ -127,7 +127,7 @@
 }
 
 int
-compat_14_netbsd32_sys_msgctl(p, v, retval)
+compat_14_netbsd32_msgctl(p, v, retval)
        struct proc *p;
        void *v;
        register_t *retval;
@@ -193,7 +193,7 @@
 }
 
 int
-compat_14_netbsd32_sys___semctl(p, v, retval)
+compat_14_netbsd32___semctl(p, v, retval)
        struct proc *p;
        void *v;
        register_t *retval;
@@ -250,12 +250,12 @@
 
 
 void
-shmid_ds14_to_native(oshmbuf, shmbuf)
+netbsd32_shmid_ds14_to_native(oshmbuf, shmbuf)
        struct shmid_ds14 *oshmbuf;
        struct shmid_ds *shmbuf;
 {
 
-       ipc_perm14_to_native(&oshmbuf->shm_perm, &shmbuf->shm_perm);
+       netbsd32_ipc_perm14_to_native(&oshmbuf->shm_perm, &shmbuf->shm_perm);
 
 #define        CVT(x)  shmbuf->x = oshmbuf->x
        CVT(shm_segsz);
@@ -269,7 +269,7 @@
 }
 
 void
-native_to_shmid_ds14(shmbuf, oshmbuf)
+native_to_netbsd32_shmid_ds14(shmbuf, oshmbuf)
        struct shmid_ds *shmbuf;
        struct shmid_ds14 *oshmbuf;
 {
@@ -288,7 +288,7 @@
 }
 
 int
-compat_14_netbsd32_sys_shmctl(p, v, retval)
+compat_14_netbsd32_shmctl(p, v, retval)
        struct proc *p;
        void *v;
        register_t *retval;
@@ -308,14 +308,14 @@
                error = copyin(SCARG(uap, buf), &oshmbuf, sizeof(oshmbuf));
                if (error) 
                        return (error);
-               shmid_ds14_to_native(&oshmbuf, &shmbuf);
+               netbsd32_shmid_ds14_to_native(&oshmbuf, &shmbuf);
        }
 
        error = shmctl1(p, SCARG(uap, shmid), cmd,
            (cmd == IPC_SET || cmd == IPC_STAT) ? &shmbuf : NULL);
 
        if (error == 0 && cmd == IPC_STAT) {
-               native_to_shmid_ds14(&shmbuf, &oshmbuf);     
+               native_to_netbsd32_shmid_ds14(&shmbuf, &oshmbuf);     
                error = copyout(&oshmbuf, SCARG(uap, buf), sizeof(oshmbuf));
        }
 
diff -r b2530ea286a1 -r a281d0d351bd sys/compat/netbsd32/netbsd32_compat_43.c
--- a/sys/compat/netbsd32/netbsd32_compat_43.c  Thu Dec 30 15:39:40 1999 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_43.c  Thu Dec 30 15:40:45 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_compat_43.c,v 1.8 1999/10/11 01:36:22 eeh Exp $       */
+/*     $NetBSD: netbsd32_compat_43.c,v 1.9 1999/12/30 15:40:45 eeh Exp $       */
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -45,7 +45,13 @@
 #include <compat/netbsd32/netbsd32.h>
 #include <compat/netbsd32/netbsd32_syscallargs.h>
 
-static void
+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 
 netbsd32_from_stat43(sp43, sp32)
        struct stat43 *sp43;
        struct netbsd32_stat43 *sp32;
diff -r b2530ea286a1 -r a281d0d351bd sys/compat/netbsd32/netbsd32_exec.c
--- a/sys/compat/netbsd32/netbsd32_exec.c       Thu Dec 30 15:39:40 1999 +0000
+++ b/sys/compat/netbsd32/netbsd32_exec.c       Thu Dec 30 15:40:45 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_exec.c,v 1.16 1999/10/11 01:36:22 eeh Exp $   */
+/*     $NetBSD: netbsd32_exec.c,v 1.17 1999/12/30 15:40:45 eeh Exp $   */
 /*     from: NetBSD: exec_aout.c,v 1.15 1996/09/26 23:34:46 cgd Exp */
 
 /*
@@ -32,6 +32,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#define        ELFSIZE         32
+
 #include "opt_compat_sunos.h"
 
 #include <sys/param.h>
@@ -40,6 +42,7 @@
 #include <sys/malloc.h>
 #include <sys/vnode.h>
 #include <sys/exec.h>
+#include <sys/exec_elf.h>
 #include <sys/resourcevar.h>
 #include <sys/signal.h>
 #include <sys/signalvar.h>
@@ -61,8 +64,10 @@
 #endif
 void *netbsd32_copyargs __P((struct exec_package *, struct ps_strings *,
        void *, void *));
-int netbsd32_copyinargs __P((struct ps_strings *, void *, size_t,



Home | Main Index | Thread Index | Old Index