Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/compat/osf1 pull up rev(s) 1.1-1.5 (new file) from ...



details:   https://anonhg.NetBSD.org/src/rev/c9a67fa4a168
branches:  netbsd-1-4
changeset: 468847:c9a67fa4a168
user:      cgd <cgd%NetBSD.org@localhost>
date:      Mon Jun 21 19:24:49 1999 +0000

description:
pull up rev(s) 1.1-1.5 (new file) from trunk. (cgd)

diffstat:

 sys/compat/osf1/osf1_cvt.c |  560 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 560 insertions(+), 0 deletions(-)

diffs (truncated from 564 to 300 lines):

diff -r de90d27981aa -r c9a67fa4a168 sys/compat/osf1/osf1_cvt.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/osf1/osf1_cvt.c        Mon Jun 21 19:24:49 1999 +0000
@@ -0,0 +1,560 @@
+/* $NetBSD: osf1_cvt.c,v 1.6.4.2 1999/06/21 19:24:49 cgd Exp $ */
+
+/*
+ * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by Christopher G. Demetriou
+ *     for the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 1994, 1995 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ * 
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ * 
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
+ * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ * 
+ * Carnegie Mellon requests users of this software to return to
+ *
+ *  Software Distribution Coordinator  or  Software.Distribution%CS.CMU.EDU@localhost
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/namei.h>
+#include <sys/proc.h>
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <sys/filedesc.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
+#include <sys/signal.h>
+#include <sys/signalvar.h>
+#include <sys/reboot.h>
+#include <sys/syscallargs.h>
+#include <sys/exec.h>
+#include <sys/vnode.h>
+#include <sys/socketvar.h>
+#include <sys/resource.h>
+#include <sys/resourcevar.h>
+#include <sys/wait.h>
+#include <vm/vm.h>                             /* XXX UVM headers are Cool */
+#include <uvm/uvm.h>                           /* XXX see mmap emulation */
+
+#include <nfs/rpcv2.h>
+#include <nfs/nfsproto.h>
+#include <nfs/nfs.h>
+#include <nfs/nfsmount.h>
+
+#include <compat/osf1/osf1.h>
+#include <compat/osf1/osf1_util.h>
+#include <compat/osf1/osf1_cvt.h>
+
+const struct emul_flags_xtab osf1_access_flags_xtab[] = {
+#if 0 /* pseudo-flag */
+    {  OSF1_F_OK,              OSF1_F_OK,              F_OK            },
+#endif
+    {  OSF1_X_OK,              OSF1_X_OK,              X_OK            },
+    {  OSF1_W_OK,              OSF1_W_OK,              W_OK            },
+    {  OSF1_R_OK,              OSF1_R_OK,              R_OK            },
+    {  0                                                               }
+};
+
+const struct emul_flags_xtab osf1_fcntl_getsetfd_flags_rxtab[] = {
+    {  FD_CLOEXEC,             FD_CLOEXEC,             OSF1_FD_CLOEXEC },
+    {  0                                                               }
+};
+
+const struct emul_flags_xtab osf1_fcntl_getsetfd_flags_xtab[] = {
+    {  OSF1_FD_CLOEXEC,        OSF1_FD_CLOEXEC,        FD_CLOEXEC      },
+    {  0                                                               }
+};
+
+/* flags specific to GETFL/SETFL; also uses open rxtab */
+const struct emul_flags_xtab osf1_fcntl_getsetfl_flags_rxtab[] = {
+    {  FASYNC,                 FASYNC,                 OSF1_FASYNC     },
+    {  0                                                               }
+};
+
+/* flags specific to GETFL/SETFL; also uses open xtab */
+const struct emul_flags_xtab osf1_fcntl_getsetfl_flags_xtab[] = {
+    {  OSF1_FASYNC,            OSF1_FASYNC,            FASYNC          },
+    {  0                                                               }
+};
+
+const struct emul_flags_xtab osf1_mmap_flags_xtab[] = {
+    {  OSF1_MAP_SHARED,        OSF1_MAP_SHARED,        MAP_SHARED      },
+    {  OSF1_MAP_PRIVATE,       OSF1_MAP_PRIVATE,       MAP_PRIVATE     },
+    {  OSF1_MAP_TYPE,          OSF1_MAP_FILE,          MAP_FILE        },
+    {  OSF1_MAP_TYPE,          OSF1_MAP_ANON,          MAP_ANON        },
+    {  OSF1_MAP_FIXED,         OSF1_MAP_FIXED,         MAP_FIXED       },
+#if 0 /* pseudo-flag, and the default */
+    {  OSF1_MAP_VARIABLE,      OSF1_MAP_VARIABLE,      0               },
+#endif
+    {  OSF1_MAP_HASSEMAPHORE,  OSF1_MAP_HASSEMAPHORE,  MAP_HASSEMAPHORE },
+    {  OSF1_MAP_INHERIT,       OSF1_MAP_INHERIT,       MAP_INHERIT     },
+#if 0 /* no equivalent +++ */
+    {  OSF1_MAP_UNALIGNED,     OSF1_MAP_UNALIGNED,     ???             },
+#endif
+    {  0                                                               }
+};
+
+const struct emul_flags_xtab osf1_mmap_prot_xtab[] = {
+#if 0 /* pseudo-flag */
+    {  OSF1_PROT_NONE,         OSF1_PROT_NONE,         PROT_NONE       },
+#endif
+    {  OSF1_PROT_READ,         OSF1_PROT_READ,         PROT_READ       },
+    {  OSF1_PROT_WRITE,        OSF1_PROT_WRITE,        PROT_READ|PROT_WRITE },
+    {  OSF1_PROT_EXEC,         OSF1_PROT_EXEC,         PROT_READ|PROT_EXEC },
+    {  0                                                               }
+};
+
+const struct emul_flags_xtab osf1_nfs_mount_flags_xtab[] = {
+    {  OSF1_NFSMNT_SOFT,       OSF1_NFSMNT_SOFT,       NFSMNT_SOFT,    },
+    {  OSF1_NFSMNT_WSIZE,      OSF1_NFSMNT_WSIZE,      NFSMNT_WSIZE,   },
+    {  OSF1_NFSMNT_RSIZE,      OSF1_NFSMNT_RSIZE,      NFSMNT_RSIZE,   },
+    {  OSF1_NFSMNT_TIMEO,      OSF1_NFSMNT_TIMEO,      NFSMNT_TIMEO,   },
+    {  OSF1_NFSMNT_RETRANS,    OSF1_NFSMNT_RETRANS,    NFSMNT_RETRANS, },
+#if 0 /* no equivalent; needs special handling, see below */
+    {  OSF1_NFSMNT_HOSTNAME,   OSF1_NFSMNT_HOSTNAME,   ???,            },
+#endif
+    {  OSF1_NFSMNT_INT,        OSF1_NFSMNT_INT,        NFSMNT_INT,     },
+    {  OSF1_NFSMNT_NOCONN,     OSF1_NFSMNT_NOCONN,     NFSMNT_NOCONN,  },
+#if 0 /* no equivalents */
+    {  OSF1_NFSMNT_NOAC,       OSF1_NFSMNT_NOAC,       ???,            },
+    {  OSF1_NFSMNT_ACREGMIN,   OSF1_NFSMNT_ACREGMIN,   ???,            },
+    {  OSF1_NFSMNT_ACREGMAX,   OSF1_NFSMNT_ACREGMAX,   ???,            },
+    {  OSF1_NFSMNT_ACDIRMIN,   OSF1_NFSMNT_ACDIRMIN,   ???,            },
+    {  OSF1_NFSMNT_ACDIRMAX,   OSF1_NFSMNT_ACDIRMAX,   ???,            },
+    {  OSF1_NFSMNT_NOCTO,      OSF1_NFSMNT_NOCTO,      ???,            },
+    {  OSF1_NFSMNT_POSIX,      OSF1_NFSMNT_POSIX,      ???,            },
+    {  OSF1_NFSMNT_AUTO,       OSF1_NFSMNT_AUTO,       ???,            },
+    {  OSF1_NFSMNT_SEC,        OSF1_NFSMNT_SEC,        ???,            },
+    {  OSF1_NFSMNT_TCP,        OSF1_NFSMNT_TCP,        ???,            },
+    {  OSF1_NFSMNT_PROPLIST,   OSF1_NFSMNT_PROPLIST,   ???,            },
+#endif
+    {  0                                                               }
+};
+
+const struct emul_flags_xtab osf1_open_flags_rxtab[] = {
+    {  O_ACCMODE,              O_RDONLY,               OSF1_O_RDONLY   },
+    {  O_ACCMODE,              O_WRONLY,               OSF1_O_WRONLY   },
+    {  O_ACCMODE,              O_RDWR,                 OSF1_O_RDWR     },
+    {  O_NONBLOCK,             O_NONBLOCK,             OSF1_O_NONBLOCK },
+    {  O_APPEND,               O_APPEND,               OSF1_O_APPEND   },
+#if 0 /* no equivalent +++ */
+    {  ???,                    ???,                    O_DEFER         },
+#endif
+    {  O_CREAT,                O_CREAT,                OSF1_O_CREAT    },
+    {  O_TRUNC,                O_TRUNC,                OSF1_O_TRUNC    },
+    {  O_EXCL,                 O_EXCL,                 OSF1_O_EXCL     },
+    {  O_NOCTTY,               O_NOCTTY,               OSF1_O_NOCTTY   },
+    {  O_SYNC,                 O_SYNC,                 OSF1_O_SYNC     },
+    {  O_NDELAY,               O_NDELAY,               OSF1_O_NDELAY   },
+#if 0 /* no equivalent, also same value as O_NDELAY! */
+    {  ???,                    ???,                    O_DRD           },
+#endif
+    {  O_DSYNC,                O_DSYNC,                OSF1_O_DSYNC    },
+    {  O_RSYNC,                O_RSYNC,                OSF1_O_RSYNC    },
+    {  0                                                               }
+};
+
+const struct emul_flags_xtab osf1_open_flags_xtab[] = {
+    {  OSF1_O_ACCMODE,         OSF1_O_RDONLY,          O_RDONLY        },
+    {  OSF1_O_ACCMODE,         OSF1_O_WRONLY,          O_WRONLY        },
+    {  OSF1_O_ACCMODE,         OSF1_O_RDWR,            O_RDWR          },
+    {  OSF1_O_NONBLOCK,        OSF1_O_NONBLOCK,        O_NONBLOCK      },
+    {  OSF1_O_APPEND,          OSF1_O_APPEND,          O_APPEND        },
+#if 0 /* no equivalent +++ */
+    {  OSF1_O_DEFER,           OSF1_O_DEFER,           ???             },
+#endif
+    {  OSF1_O_CREAT,           OSF1_O_CREAT,           O_CREAT         },
+    {  OSF1_O_TRUNC,           OSF1_O_TRUNC,           O_TRUNC         },
+    {  OSF1_O_EXCL,            OSF1_O_EXCL,            O_EXCL          },
+    {  OSF1_O_NOCTTY,          OSF1_O_NOCTTY,          O_NOCTTY        },
+    {  OSF1_O_SYNC,            OSF1_O_SYNC,            O_SYNC          },
+    {  OSF1_O_NDELAY,          OSF1_O_NDELAY,          O_NDELAY        },
+#if 0 /* no equivalent, also same value as O_NDELAY! */
+    {  OSF1_O_DRD,             OSF1_O_DRD,             ???             },
+#endif
+    {  OSF1_O_DSYNC,           OSF1_O_DSYNC,           O_DSYNC         },
+    {  OSF1_O_RSYNC,           OSF1_O_RSYNC,           O_RSYNC         },
+    {  0                                                               }
+};
+
+const struct emul_flags_xtab osf1_reboot_opt_xtab[] = {
+#if 0 /* pseudo-flag */
+    {  OSF1_RB_AUTOBOOT,       OSF1_RB_AUTOBOOT,       RB_AUTOBOOT     },
+#endif
+    {  OSF1_RB_ASKNAME,        OSF1_RB_ASKNAME,        RB_ASKNAME      },
+    {  OSF1_RB_SINGLE,         OSF1_RB_SINGLE,         RB_SINGLE       },
+    {  OSF1_RB_NOSYNC,         OSF1_RB_NOSYNC,         RB_NOSYNC       },
+#if 0 /* same value as O_NDELAY, only used at boot time? */
+    {  OSF1_RB_KDB,            OSF1_RB_KDB,            RB_KDB          },
+#endif
+    {  OSF1_RB_HALT,           OSF1_RB_HALT,           RB_HALT         },
+    {  OSF1_RB_INITNAME,       OSF1_RB_INITNAME,       RB_INITNAME     },
+    {  OSF1_RB_DFLTROOT,       OSF1_RB_DFLTROOT,       RB_DFLTROOT     },
+#if 0 /* no equivalents +++ */
+    {  OSF1_RB_ALTBOOT,        OSF1_RB_ALTBOOT,        ???             },
+    {  OSF1_RB_UNIPROC,        OSF1_RB_UNIPROC,        ???             },
+    {  OSF1_RB_PARAM,          OSF1_RB_PARAM,          ???             },
+#endif
+    {  OSF1_RB_DUMP,           OSF1_RB_DUMP,           RB_DUMP         },
+    {  0                                                               }
+};
+
+const struct emul_flags_xtab osf1_sendrecv_msg_flags_xtab[] = {
+    {  OSF1_MSG_OOB,           OSF1_MSG_OOB,           MSG_OOB         },
+    {  OSF1_MSG_PEEK,          OSF1_MSG_PEEK,          MSG_PEEK        },
+    {  OSF1_MSG_DONTROUTE,     OSF1_MSG_DONTROUTE,     MSG_DONTROUTE   },
+    {  OSF1_MSG_EOR,           OSF1_MSG_EOR,           MSG_EOR         },
+    {  OSF1_MSG_TRUNC,         OSF1_MSG_TRUNC,         MSG_TRUNC       },
+    {  OSF1_MSG_CTRUNC,        OSF1_MSG_CTRUNC,        MSG_CTRUNC      },
+    {  OSF1_MSG_WAITALL,       OSF1_MSG_WAITALL,       MSG_WAITALL     },
+    {  0                                                               }
+};
+
+const struct emul_flags_xtab osf1_sigaction_flags_rxtab[] = {
+    {  SA_ONSTACK,             SA_ONSTACK,             OSF1_SA_ONSTACK },
+    {  SA_RESTART,             SA_RESTART,             OSF1_SA_RESTART },
+    {  SA_NOCLDSTOP,           SA_NOCLDSTOP,           OSF1_SA_NOCLDSTOP },
+    {  SA_NODEFER,             SA_NODEFER,             OSF1_SA_NODEFER },
+    {  SA_RESETHAND,           SA_RESETHAND,           OSF1_SA_RESETHAND },
+    {  SA_NOCLDWAIT,           SA_NOCLDWAIT,           OSF1_SA_NOCLDWAIT },
+#if 0 /* XXX not yet */
+    {  SA_SIGINFO,             SA_SIGINFO,             OSF1_SA_SIGINFO },
+#endif
+    {  0                                                               },
+};
+
+const struct emul_flags_xtab osf1_sigaction_flags_xtab[] = {
+    {  OSF1_SA_ONSTACK,        OSF1_SA_ONSTACK,        SA_ONSTACK      },
+    {  OSF1_SA_RESTART,        OSF1_SA_RESTART,        SA_RESTART      },
+    {  OSF1_SA_NOCLDSTOP,      OSF1_SA_NOCLDSTOP,      SA_NOCLDSTOP    },
+    {  OSF1_SA_NODEFER,        OSF1_SA_NODEFER,        SA_NODEFER      },
+    {  OSF1_SA_RESETHAND,      OSF1_SA_RESETHAND,      SA_RESETHAND    },
+    {  OSF1_SA_NOCLDWAIT,      OSF1_SA_NOCLDWAIT,      SA_NOCLDWAIT    },
+#if 0 /* XXX not yet */
+    {  OSF1_SA_SIGINFO,        OSF1_SA_SIGINFO,        SA_SIGINFO      },
+#endif
+    {  0                                                               },
+};
+
+const struct emul_flags_xtab osf1_sigaltstack_flags_rxtab[] = {
+    {  SS_ONSTACK,             SS_ONSTACK,             OSF1_SS_ONSTACK },
+    {  SS_DISABLE,             SS_DISABLE,             OSF1_SS_DISABLE },
+#if 0 /* XXX no equivalents */
+    {  ???,                    ???,                    OSF1_SS_NOMASK  },
+    {  ???,                    ???,                    OSF1_SS_UCONTEXT },
+#endif
+    {  0                                                               },
+};
+
+const struct emul_flags_xtab osf1_sigaltstack_flags_xtab[] = {
+    {  OSF1_SS_ONSTACK,        OSF1_SS_ONSTACK,        SS_ONSTACK      },
+    {  OSF1_SS_DISABLE,        OSF1_SS_DISABLE,        SS_DISABLE      },



Home | Main Index | Thread Index | Old Index