Module Name: src
Committed By: maxv
Date: Sun Mar 24 16:24:20 UTC 2019
Modified Files:
src/sys/compat/linux/arch/alpha: files.linux_alpha syscalls.master
src/sys/compat/osf1: files.osf1
Added Files:
src/sys/compat/linux/arch/alpha: linux_osf1.c linux_osf1.h
Log Message:
Remove Alpha's compat_linux dependency on compat_osf1. Each function is
copied as-is from compat_osf1 with no functional change. Discussed on
tech-kern@, ok @thorpej.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/arch/alpha/files.linux_alpha
cvs rdiff -u -r0 -r1.1 src/sys/compat/linux/arch/alpha/linux_osf1.c \
src/sys/compat/linux/arch/alpha/linux_osf1.h
cvs rdiff -u -r1.94 -r1.95 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/osf1/files.osf1
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/linux/arch/alpha/files.linux_alpha
diff -u src/sys/compat/linux/arch/alpha/files.linux_alpha:1.9 src/sys/compat/linux/arch/alpha/files.linux_alpha:1.10
--- src/sys/compat/linux/arch/alpha/files.linux_alpha:1.9 Tue May 31 20:53:13 2011
+++ src/sys/compat/linux/arch/alpha/files.linux_alpha Sun Mar 24 16:24:19 2019
@@ -1,8 +1,9 @@
-# $NetBSD: files.linux_alpha,v 1.9 2011/05/31 20:53:13 njoly Exp $
+# $NetBSD: files.linux_alpha,v 1.10 2019/03/24 16:24:19 maxv Exp $
#
# Config file description for alpha-dependent Linux compat code.
file compat/linux/arch/alpha/linux_machdep.c compat_linux
+file compat/linux/arch/alpha/linux_osf1.c compat_linux
file compat/linux/arch/alpha/linux_pipe.c compat_linux
file compat/linux/arch/alpha/linux_syscalls.c compat_linux
file compat/linux/arch/alpha/linux_sysent.c compat_linux
Index: src/sys/compat/linux/arch/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.94 src/sys/compat/linux/arch/alpha/syscalls.master:1.95
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.94 Fri Feb 3 16:17:08 2017
+++ src/sys/compat/linux/arch/alpha/syscalls.master Sun Mar 24 16:24:19 2019
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.94 2017/02/03 16:17:08 christos Exp $
+ $NetBSD: syscalls.master,v 1.95 2019/03/24 16:24:19 maxv Exp $
;
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -78,6 +78,7 @@
;#include <compat/linux/common/linux_machdep.h>
#include <compat/linux/linux_syscallargs.h>
+#include <compat/linux/arch/alpha/linux_osf1.h>
%%
@@ -89,7 +90,7 @@
size_t nbyte); }
5 UNIMPL
6 NOARGS { int|sys||close(int fd); }
-7 NODEF { int|osf1_sys||wait4(int pid, int *status, \
+7 STD { int|linux_sys||osf1_wait4(int pid, int *status, \
int options, struct osf1_rusage *rusage); }
;8 ALIAS osf1_sys_old_creat, NOT USED
8 STD { int|linux_sys||creat(const char *path, linux_umode_t mode); }
@@ -109,7 +110,7 @@
19 NOARGS { long|compat_43_sys||lseek(int fd, long offset, \
int whence); }
20 NOARGS { pid_t|sys||getpid_with_ppid(void); }
-21 NODEF { int|osf1_sys||mount(int type, const char *path, \
+21 STD { int|linux_sys||osf1_mount(int type, const char *path, \
int flags, void *data); }
22 UNIMPL umount
23 NOARGS { int|sys||setuid(uid_t uid); }
@@ -133,7 +134,7 @@
40 UNIMPL
41 NOARGS { int|sys||dup(int fd); }
42 NOARGS { int|linux_sys||pipe(void); }
-43 NODEF { int|osf1_sys||set_program_attributes( \
+43 STD { int|linux_sys||osf1_set_program_attributes( \
void *taddr, unsigned long tsize, \
void *daddr, unsigned long dsize); }
44 UNIMPL
@@ -187,7 +188,7 @@
80 NOARGS { int|sys||setgroups(int gidsetsize, const gid_t *gidset); }
81 UNIMPL
82 UNIMPL setpgrp
-83 NODEF { int|osf1_sys||setitimer(int which, \
+83 STD { int|linux_sys||osf1_setitimer(int which, \
struct osf1_itimerval *itv, \
struct osf1_itimerval *oitv); }
84 UNIMPL
@@ -201,7 +202,7 @@
90 NOARGS { int|sys||dup2(int from, int to); }
91 STD { int|linux_sys||fstat(int fd, struct linux_stat *sp); }
92 STD { int|linux_sys||fcntl(int fd, int cmd, void *arg); }
-93 NODEF { int|osf1_sys||select(u_int nd, fd_set *in, \
+93 STD { int|linux_sys||osf1_select(u_int nd, fd_set *in, \
fd_set *ou, fd_set *ex, struct osf1_timeval *tv); }
94 NOARGS { int|sys||poll(struct pollfd *fds, u_int nfds, \
int timeout); }
@@ -242,9 +243,9 @@
114 STD { ssize_t|linux_sys||sendmsg(int s, \
const struct linux_msghdr *msg, int flags); }
115 UNIMPL
-116 NODEF { int|osf1_sys||gettimeofday(struct osf1_timeval *tv, \
+116 STD { int|linux_sys||osf1_gettimeofday(struct osf1_timeval *tv, \
struct osf1_timezone *tzp); }
-117 NODEF { int|osf1_sys||getrusage(int who, \
+117 STD { int|linux_sys||osf1_getrusage(int who, \
struct osf1_rusage *rusage); }
118 STD { int|linux_sys||getsockopt(int s, int level, \
int optname, void *optval, int *optlen); }
@@ -253,7 +254,7 @@
int iovcnt); }
121 NOARGS { ssize_t|sys||writev(int fd, const struct iovec *iovp, \
int iovcnt); }
-122 NODEF { int|osf1_sys||settimeofday(struct osf1_timeval *tv, \
+122 STD { int|linux_sys||osf1_settimeofday(struct osf1_timeval *tv, \
struct osf1_timezone *tzp); }
123 NOARGS { int|sys||__posix_fchown(int fd, uid_t uid, \
gid_t gid); }
@@ -276,7 +277,7 @@
int protocol, int *rsv); }
136 NOARGS { int|sys||mkdir(const char *path, linux_umode_t mode); }
137 NOARGS { int|sys||rmdir(const char *path); }
-138 NODEF { int|osf1_sys||utimes(const char *path, \
+138 STD { int|linux_sys||osf1_utimes(const char *path, \
const struct osf1_timeval *tptr); }
139 UNIMPL
140 UNIMPL
@@ -308,9 +309,9 @@
;159 ALIAS osf1_sys_getdirentries
159 NOARGS { int|compat_43_sys||getdirentries(int fd, char *buf, \
u_int count, long *basep); }
-160 NODEF { int|osf1_sys||statfs(const char *path, \
+160 STD { int|linux_sys||osf1_statfs(const char *path, \
struct osf1_statfs *buf, int len); }
-161 NODEF { int|osf1_sys||fstatfs(int fd, \
+161 STD { int|linux_sys||osf1_fstatfs(int fd, \
struct osf1_statfs *buf, int len); }
162 UNIMPL
163 UNIMPL
@@ -425,7 +426,7 @@
238 UNIMPL
239 UNIMPL
240 UNIMPL
-241 NODEF { int|osf1_sys||sysinfo(int cmd, char buf, long len); }
+241 STD { int|linux_sys||osf1_sysinfo(int cmd, char *buf, long len); }
242 UNIMPL
243 UNIMPL
244 UNIMPL osf1_sys_proplist_syscall
@@ -435,16 +436,16 @@
248 UNIMPL
249 UNIMPL
250 UNIMPL
-251 NODEF { int|osf1_sys||usleep_thread( \
+251 STD { int|linux_sys||osf1_usleep_thread( \
struct osf1_timeval *sleep, \
struct osf1_timeval *slept); }
252 UNIMPL
253 UNIMPL
254 UNIMPL
255 UNIMPL sysfs
-256 NODEF { int|osf1_sys||getsysinfo(u_long op, void *buffer, \
+256 STD { int|linux_sys||osf1_getsysinfo(u_long op, void *buffer, \
u_long nbytes, void *arg, u_long flag); }
-257 NODEF { int|osf1_sys||setsysinfo(u_long op, void *buffer, \
+257 STD { int|linux_sys||osf1_setsysinfo(u_long op, void *buffer, \
u_long nbytes, void *arg, u_long flag); }
258 UNIMPL
259 UNIMPL
Index: src/sys/compat/osf1/files.osf1
diff -u src/sys/compat/osf1/files.osf1:1.21 src/sys/compat/osf1/files.osf1:1.22
--- src/sys/compat/osf1/files.osf1:1.21 Sun Mar 17 14:11:48 2019
+++ src/sys/compat/osf1/files.osf1 Sun Mar 24 16:24:19 2019
@@ -1,4 +1,4 @@
-# $NetBSD: files.osf1,v 1.21 2019/03/17 14:11:48 christos Exp $
+# $NetBSD: files.osf1,v 1.22 2019/03/24 16:24:19 maxv Exp $
#
# Config file description for machine-independent OSF/1 compat code.
# Included by ports that need it.
@@ -15,24 +15,24 @@ file compat/osf1/osf1_syscalls.c compat_
file compat/osf1/osf1_sysent.c compat_osf1
# OSF/1 <-> NetBSD structure, flag, and value conversion files
-file compat/osf1/osf1_cvt.c compat_osf1 | compat_linux
+file compat/osf1/osf1_cvt.c compat_osf1
file compat/osf1/osf1_errno.c compat_osf1
-file compat/osf1/osf1_signo.c compat_osf1 | compat_linux
+file compat/osf1/osf1_signo.c compat_osf1
# functionality emulation files
file compat/osf1/osf1_descrip.c compat_osf1
file compat/osf1/osf1_exec.c compat_osf1
file compat/osf1/osf1_exec_ecoff.c compat_osf1 & exec_ecoff
-file compat/osf1/osf1_file.c compat_osf1 | compat_linux
-file compat/osf1/osf1_generic.c compat_osf1 | compat_linux
+file compat/osf1/osf1_file.c compat_osf1
+file compat/osf1/osf1_generic.c compat_osf1
file compat/osf1/osf1_ioctl.c compat_osf1
-file compat/osf1/osf1_misc.c compat_osf1 | compat_linux
+file compat/osf1/osf1_misc.c compat_osf1
file compat/osf1/osf1_mmap.c compat_osf1
file compat/osf1/osf1_mod.c compat_osf1
-file compat/osf1/osf1_mount.c compat_osf1 | compat_linux
+file compat/osf1/osf1_mount.c compat_osf1
file compat/osf1/osf1_prot.c compat_osf1
-file compat/osf1/osf1_resource.c compat_osf1 | compat_linux
+file compat/osf1/osf1_resource.c compat_osf1
file compat/osf1/osf1_signal.c compat_osf1
file compat/osf1/osf1_socket.c compat_osf1
file compat/osf1/osf1_sysv_ipc.c compat_osf1
-file compat/osf1/osf1_time.c compat_osf1 | compat_linux
+file compat/osf1/osf1_time.c compat_osf1
Added files:
Index: src/sys/compat/linux/arch/alpha/linux_osf1.c
diff -u /dev/null src/sys/compat/linux/arch/alpha/linux_osf1.c:1.1
--- /dev/null Sun Mar 24 16:24:20 2019
+++ src/sys/compat/linux/arch/alpha/linux_osf1.c Sun Mar 24 16:24:19 2019
@@ -0,0 +1,785 @@
+/* $NetBSD: linux_osf1.c,v 1.1 2019/03/24 16:24:19 maxv 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.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: linux_osf1.c,v 1.1 2019/03/24 16:24:19 maxv Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/namei.h>
+#include <sys/proc.h>
+#include <sys/file.h>
+#include <sys/filedesc.h>
+#include <sys/kernel.h>
+#include <sys/mount.h>
+#include <sys/vnode.h>
+#include <sys/wait.h>
+#include <sys/select.h>
+#include <sys/syscallargs.h>
+#include <sys/vfs_syscalls.h>
+
+#include <machine/alpha.h>
+#include <machine/cpuconf.h>
+#include <machine/rpb.h>
+#include <machine/fpu.h>
+
+#include <compat/common/compat_util.h>
+#include <compat/linux/common/linux_types.h>
+#include <compat/linux/common/linux_signal.h>
+#include <compat/linux/arch/alpha/linux_signal.h>
+#include <compat/linux/arch/alpha/linux_osf1.h>
+#include <compat/linux/linux_syscallargs.h>
+
+#include <net/if.h>
+#include <netinet/in.h>
+
+#include <nfs/rpcv2.h>
+#include <nfs/nfsproto.h>
+#include <nfs/nfs.h>
+#include <nfs/nfsmount.h>
+
+#include <ufs/ufs/quota.h>
+#include <ufs/ufs/ufsmount.h>
+
+#include <machine/vmparam.h>
+
+const struct emul_flags_xtab osf1_wait_options_xtab[] = {
+ { OSF1_WNOHANG, OSF1_WNOHANG, WNOHANG },
+ { OSF1_WUNTRACED, OSF1_WUNTRACED, WUNTRACED },
+ { 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 }
+};
+
+static void
+osf1_cvt_rusage_from_native(const struct rusage *ru, struct osf1_rusage *oru)
+{
+
+ oru->ru_utime.tv_sec = ru->ru_utime.tv_sec;
+ oru->ru_utime.tv_usec = ru->ru_utime.tv_usec;
+
+ oru->ru_stime.tv_sec = ru->ru_stime.tv_sec;
+ oru->ru_stime.tv_usec = ru->ru_stime.tv_usec;
+
+ oru->ru_maxrss = ru->ru_maxrss;
+ oru->ru_ixrss = ru->ru_ixrss;
+ oru->ru_idrss = ru->ru_idrss;
+ oru->ru_isrss = ru->ru_isrss;
+ oru->ru_minflt = ru->ru_minflt;
+ oru->ru_majflt = ru->ru_majflt;
+ oru->ru_nswap = ru->ru_nswap;
+ oru->ru_inblock = ru->ru_inblock;
+ oru->ru_oublock = ru->ru_oublock;
+ oru->ru_msgsnd = ru->ru_msgsnd;
+ oru->ru_msgrcv = ru->ru_msgrcv;
+ oru->ru_nsignals = ru->ru_nsignals;
+ oru->ru_nvcsw = ru->ru_nvcsw;
+ oru->ru_nivcsw = ru->ru_nivcsw;
+}
+
+static void
+osf1_cvt_statfs_from_native(const struct statvfs *bsfs, struct osf1_statfs *osfs)
+{
+
+ memset(osfs, 0, sizeof (struct osf1_statfs));
+ if (!strncmp(MOUNT_FFS, bsfs->f_fstypename, sizeof(bsfs->f_fstypename)))
+ osfs->f_type = OSF1_MOUNT_UFS;
+ else if (!strncmp(MOUNT_NFS, bsfs->f_fstypename, sizeof(bsfs->f_fstypename)))
+ osfs->f_type = OSF1_MOUNT_NFS;
+ else if (!strncmp(MOUNT_MFS, bsfs->f_fstypename, sizeof(bsfs->f_fstypename)))
+ osfs->f_type = OSF1_MOUNT_MFS;
+ else
+ /* uh oh... XXX = PC, CDFS, PROCFS, etc. */
+ osfs->f_type = OSF1_MOUNT_ADDON;
+ osfs->f_flags = bsfs->f_flag; /* XXX translate */
+ osfs->f_fsize = bsfs->f_frsize;
+ osfs->f_bsize = bsfs->f_bsize;
+ osfs->f_blocks = bsfs->f_blocks;
+ osfs->f_bfree = bsfs->f_bfree;
+ osfs->f_bavail = bsfs->f_bavail;
+ osfs->f_files = bsfs->f_files;
+ osfs->f_ffree = bsfs->f_ffree;
+ memcpy(&osfs->f_fsid, &bsfs->f_fsidx, sizeof osfs->f_fsid);
+ /* osfs->f_spare zeroed above */
+ memcpy(osfs->f_mntonname, bsfs->f_mntonname, sizeof osfs->f_mntonname);
+ memcpy(osfs->f_mntfromname, bsfs->f_mntfromname,
+ sizeof osfs->f_mntfromname);
+ /* XXX osfs->f_xxx should be filled in... */
+}
+
+/* --------------------------------------------------------------------- */
+
+int
+linux_sys_osf1_wait4(struct lwp *l, const struct linux_sys_osf1_wait4_args *uap, register_t *retval)
+{
+ struct osf1_rusage osf1_rusage;
+ struct rusage netbsd_rusage;
+ unsigned long leftovers;
+ int error, status;
+ int options = SCARG(uap, options);
+ int pid = SCARG(uap, pid);
+
+ /* translate options */
+ options = emul_flags_translate(osf1_wait_options_xtab,
+ options, &leftovers);
+ if (leftovers != 0)
+ return (EINVAL);
+
+ error = do_sys_wait(&pid, &status, options,
+ SCARG(uap, rusage) != NULL ? &netbsd_rusage : NULL);
+
+ retval[0] = pid;
+ if (pid == 0)
+ return error;
+
+ if (SCARG(uap, rusage)) {
+ osf1_cvt_rusage_from_native(&netbsd_rusage, &osf1_rusage);
+ error = copyout(&osf1_rusage, SCARG(uap, rusage),
+ sizeof osf1_rusage);
+ }
+
+ if (error == 0 && SCARG(uap, status))
+ error = copyout(&status, SCARG(uap, status), sizeof(status));
+
+ return error;
+}
+
+#define OSF1_MNT_WAIT 0x1
+#define OSF1_MNT_NOWAIT 0x2
+
+#define OSF1_MNT_FORCE 0x1
+#define OSF1_MNT_NOFORCE 0x2
+
+/* acceptable flags for various calls */
+#define OSF1_GETFSSTAT_FLAGS (OSF1_MNT_WAIT|OSF1_MNT_NOWAIT)
+#define OSF1_MOUNT_FLAGS 0xffffffff /* XXX */
+#define OSF1_UNMOUNT_FLAGS (OSF1_MNT_FORCE|OSF1_MNT_NOFORCE)
+
+static int
+osf1_mount_mfs(struct lwp *l, const struct linux_sys_osf1_mount_args *uap)
+{
+ struct osf1_mfs_args osf_ma;
+ struct mfs_args bsd_ma;
+ int error;
+ register_t dummy;
+
+ if ((error = copyin(SCARG(uap, data), &osf_ma, sizeof osf_ma)))
+ return error;
+
+ memset(&bsd_ma, 0, sizeof bsd_ma);
+ bsd_ma.fspec = osf_ma.name;
+ /* XXX export args */
+ bsd_ma.base = osf_ma.base;
+ bsd_ma.size = osf_ma.size;
+
+ return do_sys_mount(l, "mfs", UIO_SYSSPACE, SCARG(uap, path),
+ SCARG(uap, flags), &bsd_ma, UIO_SYSSPACE, sizeof bsd_ma, &dummy);
+}
+
+static int
+osf1_mount_nfs(struct lwp *l, const struct linux_sys_osf1_mount_args *uap)
+{
+ struct osf1_nfs_args osf_na;
+ struct nfs_args bsd_na;
+ int error;
+ unsigned long leftovers;
+ register_t dummy;
+
+ if ((error = copyin(SCARG(uap, data), &osf_na, sizeof osf_na)))
+ return error;
+
+ memset(&bsd_na, 0, sizeof bsd_na);
+ bsd_na.addr = (struct sockaddr *)osf_na.addr;
+ bsd_na.addrlen = sizeof (struct sockaddr_in);
+ bsd_na.fh = osf_na.fh;
+
+ /* translate flags */
+ bsd_na.flags = emul_flags_translate(osf1_nfs_mount_flags_xtab,
+ osf_na.flags, &leftovers);
+ if (leftovers & OSF1_NFSMNT_HOSTNAME) {
+ leftovers &= ~OSF1_NFSMNT_HOSTNAME;
+ bsd_na.hostname = osf_na.hostname;
+ } else {
+ /* XXX FILL IN HOST NAME WITH IPADDR? */
+ }
+ if (leftovers & OSF1_NFSMNT_TCP) {
+ leftovers &= ~OSF1_NFSMNT_TCP;
+ bsd_na.sotype = SOCK_DGRAM;
+ bsd_na.proto = 0;
+ } else {
+ bsd_na.sotype = SOCK_STREAM;
+ bsd_na.proto = 0;
+ }
+ if (leftovers != 0)
+ return (EINVAL);
+
+ /* copy structure elements based on flags */
+ if (bsd_na.flags & NFSMNT_WSIZE)
+ bsd_na.wsize = osf_na.wsize;
+ if (bsd_na.flags & NFSMNT_RSIZE)
+ bsd_na.rsize = osf_na.rsize;
+ if (bsd_na.flags & NFSMNT_TIMEO)
+ bsd_na.timeo = osf_na.timeo;
+ if (bsd_na.flags & NFSMNT_RETRANS)
+ bsd_na.retrans = osf_na.retrans;
+
+ return do_sys_mount(l, "nfs", UIO_SYSSPACE, SCARG(uap, path),
+ SCARG(uap, flags), &bsd_na, UIO_SYSSPACE, sizeof bsd_na, &dummy);
+}
+
+int
+linux_sys_osf1_mount(struct lwp *l, const struct linux_sys_osf1_mount_args *uap, register_t *retval)
+{
+
+ if (SCARG(uap, flags) & ~OSF1_MOUNT_FLAGS)
+ return (EINVAL);
+
+ /* XXX - xlate flags */
+
+ switch (SCARG(uap, type)) {
+ case OSF1_MOUNT_NFS:
+ return osf1_mount_nfs(l, uap);
+ break;
+
+ case OSF1_MOUNT_MFS:
+ return osf1_mount_mfs(l, uap);
+
+ default:
+ return (EINVAL);
+ }
+}
+
+int
+linux_sys_osf1_set_program_attributes(struct lwp *l, const struct linux_sys_osf1_set_program_attributes_args *uap, register_t *retval)
+{
+ struct proc *p = l->l_proc;
+ segsz_t tsize, dsize;
+
+ tsize = btoc(SCARG(uap, tsize));
+ dsize = btoc(SCARG(uap, dsize));
+
+ if (dsize > p->p_rlimit[RLIMIT_DATA].rlim_cur)
+ return (ENOMEM);
+ if (tsize > MAXTSIZ)
+ return (ENOMEM);
+
+ /* XXXSMP unlocked */
+ p->p_vmspace->vm_taddr = SCARG(uap, taddr);
+ p->p_vmspace->vm_tsize = tsize;
+ p->p_vmspace->vm_daddr = SCARG(uap, daddr);
+ p->p_vmspace->vm_dsize = dsize;
+
+ return (0);
+}
+
+int
+linux_sys_osf1_setitimer(struct lwp *l, const struct linux_sys_osf1_setitimer_args *uap, register_t *retval)
+{
+ struct osf1_itimerval o_itv, o_oitv;
+ struct itimerval b_itv, b_oitv;
+ int which;
+ int error;
+
+ switch (SCARG(uap, which)) {
+ case OSF1_ITIMER_REAL:
+ which = ITIMER_REAL;
+ break;
+
+ case OSF1_ITIMER_VIRTUAL:
+ which = ITIMER_VIRTUAL;
+ break;
+
+ case OSF1_ITIMER_PROF:
+ which = ITIMER_PROF;
+ break;
+
+ default:
+ return (EINVAL);
+ }
+
+ /* get the OSF/1 itimerval argument */
+ error = copyin(SCARG(uap, itv), &o_itv, sizeof o_itv);
+ if (error != 0)
+ return error;
+
+ /* fill in and the NetBSD timeval */
+ memset(&b_itv, 0, sizeof b_itv);
+ b_itv.it_interval.tv_sec = o_itv.it_interval.tv_sec;
+ b_itv.it_interval.tv_usec = o_itv.it_interval.tv_usec;
+ b_itv.it_value.tv_sec = o_itv.it_value.tv_sec;
+ b_itv.it_value.tv_usec = o_itv.it_value.tv_usec;
+
+ if (SCARG(uap, oitv) != NULL) {
+ dogetitimer(l->l_proc, which, &b_oitv);
+ if (error)
+ return error;
+ }
+
+ error = dosetitimer(l->l_proc, which, &b_itv);
+
+ if (error == 0 || SCARG(uap, oitv) == NULL)
+ return error;
+
+ /* fill in and copy out the old timeval */
+ memset(&o_oitv, 0, sizeof o_oitv);
+ o_oitv.it_interval.tv_sec = b_oitv.it_interval.tv_sec;
+ o_oitv.it_interval.tv_usec = b_oitv.it_interval.tv_usec;
+ o_oitv.it_value.tv_sec = b_oitv.it_value.tv_sec;
+ o_oitv.it_value.tv_usec = b_oitv.it_value.tv_usec;
+
+ return copyout(&o_oitv, SCARG(uap, oitv), sizeof o_oitv);
+}
+
+int
+linux_sys_osf1_select(struct lwp *l, const struct linux_sys_osf1_select_args *uap,
+ register_t *retval)
+{
+ struct osf1_timeval otv;
+ struct timespec ats, *ts = NULL;
+ int error;
+
+ if (SCARG(uap, tv)) {
+ /* get the OSF/1 timeval argument */
+ error = copyin(SCARG(uap, tv), &otv, sizeof otv);
+ if (error != 0)
+ return error;
+
+ ats.tv_sec = otv.tv_sec;
+ ats.tv_nsec = otv.tv_usec * 1000;
+ ts = &ats;
+ }
+
+ return selcommon(retval, SCARG(uap, nd), SCARG(uap, in),
+ SCARG(uap, ou), SCARG(uap, ex), ts, NULL);
+}
+
+int
+linux_sys_osf1_gettimeofday(struct lwp *l, const struct linux_sys_osf1_gettimeofday_args *uap, register_t *retval)
+{
+ struct osf1_timeval otv;
+ struct osf1_timezone otz;
+ struct timeval tv;
+ int error;
+
+ microtime(&tv);
+ memset(&otv, 0, sizeof otv);
+ otv.tv_sec = tv.tv_sec;
+ otv.tv_usec = tv.tv_usec;
+ error = copyout(&otv, SCARG(uap, tp), sizeof otv);
+
+ if (error == 0 && SCARG(uap, tzp) != NULL) {
+ memset(&otz, 0, sizeof otz);
+ error = copyout(&otz, SCARG(uap, tzp), sizeof otz);
+ }
+ return (error);
+}
+
+int
+linux_sys_osf1_getrusage(struct lwp *l, const struct linux_sys_osf1_getrusage_args *uap, register_t *retval)
+{
+ int error, who;
+ struct osf1_rusage osf1_rusage;
+ struct rusage ru;
+ struct proc *p = l->l_proc;
+
+
+ switch (SCARG(uap, who)) {
+ case OSF1_RUSAGE_SELF:
+ who = RUSAGE_SELF;
+ break;
+
+ case OSF1_RUSAGE_CHILDREN:
+ who = RUSAGE_CHILDREN;
+ break;
+
+ case OSF1_RUSAGE_THREAD: /* XXX not supported */
+ default:
+ return EINVAL;
+ }
+
+ error = getrusage1(p, who, &ru);
+ if (error != 0)
+ return error;
+
+ osf1_cvt_rusage_from_native(&ru, &osf1_rusage);
+
+ return copyout(&osf1_rusage, SCARG(uap, rusage), sizeof osf1_rusage);
+}
+
+int
+linux_sys_osf1_settimeofday(struct lwp *l, const struct linux_sys_osf1_settimeofday_args *uap, register_t *retval)
+{
+ struct osf1_timeval otv;
+ struct timeval tv, *tvp;
+ int error = 0;
+
+ if (SCARG(uap, tv) == NULL)
+ tvp = NULL;
+ else {
+ /* get the OSF/1 timeval argument */
+ error = copyin(SCARG(uap, tv), &otv, sizeof otv);
+ if (error != 0)
+ return error;
+
+ tv.tv_sec = otv.tv_sec;
+ tv.tv_usec = otv.tv_usec;
+ tvp = &tv;
+ }
+
+ /* NetBSD ignores the timezone field */
+
+ return settimeofday1(tvp, false, (const void *)SCARG(uap, tzp), l, true);
+}
+
+int
+linux_sys_osf1_utimes(struct lwp *l, const struct linux_sys_osf1_utimes_args *uap, register_t *retval)
+{
+ struct osf1_timeval otv;
+ struct timeval tv[2], *tvp;
+ int error;
+
+ if (SCARG(uap, tptr) == NULL)
+ tvp = NULL;
+ else {
+ /* get the OSF/1 timeval argument */
+ error = copyin(SCARG(uap, tptr), &otv, sizeof otv);
+ if (error != 0)
+ return error;
+
+ /* fill in and copy out the NetBSD timeval */
+ tv[0].tv_sec = otv.tv_sec;
+ tv[0].tv_usec = otv.tv_usec;
+ /* Set access and modified to the same time */
+ tv[1].tv_sec = otv.tv_sec;
+ tv[1].tv_usec = otv.tv_usec;
+ tvp = tv;
+ }
+
+ return do_sys_utimes(l, NULL, SCARG(uap, path), FOLLOW,
+ tvp, UIO_SYSSPACE);
+}
+
+int
+linux_sys_osf1_statfs(struct lwp *l, const struct linux_sys_osf1_statfs_args *uap, register_t *retval)
+{
+ struct mount *mp;
+ struct statvfs *sp;
+ struct osf1_statfs osfs;
+ int error;
+ struct vnode *vp;
+
+ error = namei_simple_user(SCARG(uap, path),
+ NSM_FOLLOW_TRYEMULROOT, &vp);
+ if (error != 0)
+ return (error);
+ mp = vp->v_mount;
+ sp = &mp->mnt_stat;
+ vrele(vp);
+ if ((error = VFS_STATVFS(mp, sp)))
+ return (error);
+ sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
+ osf1_cvt_statfs_from_native(sp, &osfs);
+ return copyout(&osfs, SCARG(uap, buf), uimin(sizeof osfs,
+ SCARG(uap, len)));
+}
+
+int
+linux_sys_osf1_fstatfs(struct lwp *l, const struct linux_sys_osf1_fstatfs_args *uap, register_t *retval)
+{
+ file_t *fp;
+ struct mount *mp;
+ struct statvfs *sp;
+ struct osf1_statfs osfs;
+ int error;
+
+ /* fd_getvnode() will use the descriptor for us */
+ if ((error = fd_getvnode(SCARG(uap, fd), &fp)))
+ return (error);
+ mp = fp->f_vnode->v_mount;
+ sp = &mp->mnt_stat;
+ if ((error = VFS_STATVFS(mp, sp)))
+ goto out;
+ sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
+ osf1_cvt_statfs_from_native(sp, &osfs);
+ error = copyout(&osfs, SCARG(uap, buf), uimin(sizeof osfs,
+ SCARG(uap, len)));
+ out:
+ fd_putfile(SCARG(uap, fd));
+ return (error);
+}
+
+int
+linux_sys_osf1_sysinfo(struct lwp *l, const struct linux_sys_osf1_sysinfo_args *uap, register_t *retval)
+{
+ const char *string;
+ size_t slen;
+ int error;
+
+ error = 0;
+ switch (SCARG(uap, cmd)) {
+ case OSF1_SI_SYSNAME:
+ string = ostype;
+ break;
+
+ case OSF1_SI_HOSTNAME:
+ string = hostname;
+ break;
+
+ case OSF1_SI_RELEASE:
+ string = osrelease;
+ break;
+
+ case OSF1_SI_VERSION:
+ goto should_handle;
+
+ case OSF1_SI_MACHINE:
+ string = MACHINE;
+ break;
+
+ case OSF1_SI_ARCHITECTURE:
+ string = MACHINE_ARCH;
+ break;
+
+ case OSF1_SI_HW_SERIAL:
+ string = "666"; /* OSF/1 emulation? YES! */
+ break;
+
+ case OSF1_SI_HW_PROVIDER:
+ string = "unknown";
+ break;
+
+ case OSF1_SI_SRPC_DOMAIN:
+ goto dont_care;
+
+ case OSF1_SI_SET_HOSTNAME:
+ goto should_handle;
+
+ case OSF1_SI_SET_SYSNAME:
+ goto should_handle;
+
+ case OSF1_SI_SET_SRPC_DOMAIN:
+ goto dont_care;
+
+ default:
+should_handle:
+ printf("osf1_sys_sysinfo(%d, %p, 0x%lx)\n", SCARG(uap, cmd),
+ SCARG(uap, buf), SCARG(uap,len));
+dont_care:
+ return (EINVAL);
+ };
+
+ slen = strlen(string) + 1;
+ if (SCARG(uap, buf)) {
+ error = copyout(string, SCARG(uap, buf),
+ uimin(slen, SCARG(uap, len)));
+ if (!error && (SCARG(uap, len) > 0) && (SCARG(uap, len) < slen))
+ subyte(SCARG(uap, buf) + SCARG(uap, len) - 1, 0);
+ }
+ if (!error)
+ retval[0] = slen;
+
+ return (error);
+}
+
+int
+linux_sys_osf1_usleep_thread(struct lwp *l, const struct linux_sys_osf1_usleep_thread_args *uap, register_t *retval)
+{
+ struct osf1_timeval otv, endotv;
+ struct timeval tv, ntv, endtv;
+ u_long ticks;
+ int error;
+
+ if ((error = copyin(SCARG(uap, sleep), &otv, sizeof otv)))
+ return (error);
+ tv.tv_sec = otv.tv_sec;
+ tv.tv_usec = otv.tv_usec;
+
+ ticks = howmany((u_long)tv.tv_sec * 1000000 + tv.tv_usec, tick);
+ if (ticks == 0)
+ ticks = 1;
+
+ getmicrotime(&tv);
+
+ tsleep(l, PUSER|PCATCH, "uslpthrd", ticks); /* XXX */
+
+ if (SCARG(uap, slept) != NULL) {
+ getmicrotime(&ntv);
+ timersub(&ntv, &tv, &endtv);
+ if (endtv.tv_sec < 0 || endtv.tv_usec < 0)
+ endtv.tv_sec = endtv.tv_usec = 0;
+
+ endotv.tv_sec = endtv.tv_sec;
+ endotv.tv_usec = endtv.tv_usec;
+ error = copyout(&endotv, SCARG(uap, slept), sizeof endotv);
+ }
+ return (error);
+}
+
+int
+linux_sys_osf1_getsysinfo(struct lwp *l, const struct linux_sys_osf1_getsysinfo_args *uap, register_t *retval)
+{
+ extern int ncpus;
+ int error;
+ int unit;
+ long percpu;
+ long proctype;
+ u_int64_t fpflags;
+ struct osf1_cpu_info cpuinfo;
+ const void *data;
+ size_t datalen;
+
+ error = 0;
+
+ switch(SCARG(uap, op))
+ {
+ case OSF_GET_MAX_UPROCS:
+ data = &maxproc;
+ datalen = sizeof(maxproc);
+ break;
+ case OSF_GET_PHYSMEM:
+ data = &physmem;
+ datalen = sizeof(physmem);
+ break;
+ case OSF_GET_MAX_CPU:
+ case OSF_GET_CPUS_IN_BOX:
+ data = &ncpus;
+ datalen = sizeof(ncpus);
+ break;
+ case OSF_GET_IEEE_FP_CONTROL:
+ if (((fpflags = alpha_read_fp_c(l)) & IEEE_INHERIT) != 0) {
+ fpflags |= 1ULL << 63;
+ fpflags &= ~IEEE_INHERIT;
+ }
+ data = &fpflags;
+ datalen = sizeof(fpflags);
+ break;
+ case OSF_GET_CPU_INFO:
+ memset(&cpuinfo, 0, sizeof(cpuinfo));
+#ifdef __alpha__
+ unit = alpha_pal_whami();
+#else
+ unit = 0; /* XXX */
+#endif
+ cpuinfo.current_cpu = unit;
+ cpuinfo.cpus_in_box = ncpus;
+ cpuinfo.cpu_type = LOCATE_PCS(hwrpb, unit)->pcs_proc_type;
+ cpuinfo.ncpus = ncpus;
+ cpuinfo.cpus_present = ncpus;
+ cpuinfo.cpus_running = ncpus;
+ cpuinfo.cpu_binding = 1;
+ cpuinfo.cpu_ex_binding = 0;
+ cpuinfo.mhz = hwrpb->rpb_cc_freq / 1000000;
+ data = &cpuinfo;
+ datalen = sizeof(cpuinfo);
+ break;
+ case OSF_GET_PROC_TYPE:
+#ifdef __alpha__
+ unit = alpha_pal_whami();
+ proctype = LOCATE_PCS(hwrpb, unit)->pcs_proc_type;
+#else
+ proctype = 0; /* XXX */
+#endif
+ data = &proctype;
+ datalen = sizeof(percpu);
+ break;
+ case OSF_GET_HWRPB: /* note -- osf/1 doesn't have rpb_tbhint[8] */
+ data = hwrpb;
+ datalen = hwrpb->rpb_size;
+ break;
+ case OSF_GET_PLATFORM_NAME:
+ data = platform.model;
+ datalen = strlen(platform.model) + 1;
+ break;
+ default:
+ printf("osf1_getsysinfo called with unknown op=%ld\n",
+ SCARG(uap, op));
+ /* return EINVAL; */
+ return 0;
+ }
+
+ if (SCARG(uap, nbytes) < datalen)
+ return (EINVAL);
+ error = copyout(data, SCARG(uap, buffer), datalen);
+ if (!error)
+ retval[0] = 1;
+ return (error);
+}
+
+int
+linux_sys_osf1_setsysinfo(struct lwp *l, const struct linux_sys_osf1_setsysinfo_args *uap, register_t *retval)
+{
+ u_int64_t temp;
+ int error;
+
+ error = 0;
+
+ switch(SCARG(uap, op)) {
+ case OSF_SET_IEEE_FP_CONTROL:
+
+ if ((error = copyin(SCARG(uap, buffer), &temp, sizeof(temp))))
+ break;
+ if (temp >> 63 != 0)
+ temp |= IEEE_INHERIT;
+ alpha_write_fp_c(l, temp);
+ break;
+ default:
+ uprintf("osf1_setsysinfo called with op=%ld\n", SCARG(uap, op));
+ //error = EINVAL;
+ }
+ retval[0] = 0;
+ return (error);
+}
Index: src/sys/compat/linux/arch/alpha/linux_osf1.h
diff -u /dev/null src/sys/compat/linux/arch/alpha/linux_osf1.h:1.1
--- /dev/null Sun Mar 24 16:24:20 2019
+++ src/sys/compat/linux/arch/alpha/linux_osf1.h Sun Mar 24 16:24:19 2019
@@ -0,0 +1,222 @@
+/* $NetBSD: linux_osf1.h,v 1.1 2019/03/24 16:24:19 maxv 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.
+ */
+
+typedef int16_t osf1_short;
+typedef int32_t osf1_int;
+typedef int64_t osf1_long;
+typedef u_int32_t osf1_u_int;
+
+typedef int32_t osf1_dev_t;
+typedef u_int32_t osf1_ino_t;
+typedef u_int32_t osf1_mode_t;
+typedef u_int16_t osf1_nlink_t;
+typedef u_int32_t osf1_uid_t;
+typedef u_int32_t osf1_gid_t;
+
+typedef int32_t osf1_time_t;
+typedef u_int32_t osf1_uint_t;
+typedef u_int64_t osf1_sigset_t;
+typedef u_int64_t osf1_size_t;
+typedef u_int64_t osf1_fsid_t;
+typedef u_int64_t osf1_rlim_t;
+typedef void *osf1_data_ptr; /* XXX hard to fix size */
+typedef void *osf1_fcn_ptr; /* XXX hard to fix size, bogus */
+typedef osf1_int osf1_key_t;
+typedef osf1_int osf1_pid_t;
+typedef u_int64_t osf1_blksize_t;
+typedef u_int64_t osf1_blkcnt_t;
+
+#define OSF1_SI_SYSNAME 1
+#define OSF1_SI_HOSTNAME 2
+#define OSF1_SI_RELEASE 3
+#define OSF1_SI_VERSION 4
+#define OSF1_SI_MACHINE 5
+#define OSF1_SI_ARCHITECTURE 6
+#define OSF1_SI_HW_SERIAL 7
+#define OSF1_SI_HW_PROVIDER 8
+#define OSF1_SI_SRPC_DOMAIN 9
+#define OSF1_SI_SET_HOSTNAME 258
+#define OSF1_SI_SET_SYSNAME 259
+#define OSF1_SI_SET_SRPC_DOMAIN 265
+
+struct osf1_timeval { /* time.h */
+ osf1_time_t tv_sec;
+ osf1_int tv_usec;
+};
+
+#define OSF1_RUSAGE_THREAD 1
+#define OSF1_RUSAGE_SELF 0
+#define OSF1_RUSAGE_CHILDREN -1
+
+struct osf1_rusage {
+ struct osf1_timeval ru_utime;
+ struct osf1_timeval ru_stime;
+ osf1_long ru_maxrss;
+ osf1_long ru_ixrss;
+ osf1_long ru_idrss;
+ osf1_long ru_isrss;
+ osf1_long ru_minflt;
+ osf1_long ru_majflt;
+ osf1_long ru_nswap;
+ osf1_long ru_inblock;
+ osf1_long ru_oublock;
+ osf1_long ru_msgsnd;
+ osf1_long ru_msgrcv;
+ osf1_long ru_nsignals;
+ osf1_long ru_nvcsw;
+ osf1_long ru_nivcsw;
+};
+
+struct osf1_itimerval {
+ struct osf1_timeval it_interval;
+ struct osf1_timeval it_value;
+};
+
+#define OSF1_ITIMER_REAL 0
+#define OSF1_ITIMER_VIRTUAL 1
+#define OSF1_ITIMER_PROF 2
+
+struct osf1_timezone {
+ osf1_int tz_minuteswest;
+ osf1_int tz_dsttime;
+};
+
+#define OSF1_WNOHANG 0x01
+#define OSF1_WUNTRACED 0x02
+
+struct osf1_cpu_info {
+ int current_cpu;
+ int cpus_in_box;
+ int cpu_type;
+ int ncpus;
+ u_int64_t cpus_present;
+ u_int64_t cpus_running;
+ u_int64_t cpu_binding;
+ u_int64_t cpu_ex_binding;
+ int mhz;
+ int unused[3];
+};
+
+#define OSF_SET_IEEE_FP_CONTROL 14
+
+#define OSF_GET_MAX_UPROCS 2
+#define OSF_GET_PHYSMEM 19
+#define OSF_GET_MAX_CPU 30
+#define OSF_GET_IEEE_FP_CONTROL 45
+#define OSF_GET_CPUS_IN_BOX 55
+#define OSF_GET_CPU_INFO 59
+#define OSF_GET_PROC_TYPE 60
+#define OSF_GET_HWRPB 101
+#define OSF_GET_PLATFORM_NAME 103
+
+#define OSF1_MOUNT_NONE 0
+#define OSF1_MOUNT_UFS 1
+#define OSF1_MOUNT_NFS 2
+#define OSF1_MOUNT_MFS 3
+#define OSF1_MOUNT_PC 4
+#define OSF1_MOUNT_S5FS 5
+#define OSF1_MOUNT_CDFS 6
+#define OSF1_MOUNT_DFS 7
+#define OSF1_MOUNT_EFS 8
+#define OSF1_MOUNT_PROCFS 9
+#define OSF1_MOUNT_MSFS 10
+#define OSF1_MOUNT_FFM 11
+#define OSF1_MOUNT_FDFS 12
+#define OSF1_MOUNT_ADDON 13
+#define OSF1_MOUNT_NFS3 14
+#define OSF1_MNAMELEN 90
+
+struct osf1_mfs_args {
+ osf1_data_ptr name;
+ osf1_data_ptr base;
+ osf1_u_int size;
+};
+
+struct osf1_nfs_args {
+ osf1_data_ptr addr;
+ osf1_data_ptr fh;
+ osf1_int flags;
+ osf1_int wsize;
+ osf1_int rsize;
+ osf1_int timeo;
+ osf1_int retrans;
+ osf1_data_ptr hostname;
+ osf1_int acregmin;
+ osf1_int acregmax;
+ osf1_int acdirmin;
+ osf1_int acdirmax;
+ osf1_data_ptr netname;
+ osf1_data_ptr pathconf;
+};
+
+union osf1_mount_info {
+ struct osf1_mfs_args mfs_args;
+ struct osf1_nfs_args nfs_args;
+ char pad[80];
+};
+
+#define OSF1_NFSMNT_SOFT 0x00000001
+#define OSF1_NFSMNT_WSIZE 0x00000002
+#define OSF1_NFSMNT_RSIZE 0x00000004
+#define OSF1_NFSMNT_TIMEO 0x00000008
+#define OSF1_NFSMNT_RETRANS 0x00000010
+#define OSF1_NFSMNT_HOSTNAME 0x00000020
+#define OSF1_NFSMNT_INT 0x00000040
+#define OSF1_NFSMNT_NOCONN 0x00000080
+#define OSF1_NFSMNT_NOAC 0x00000100
+#define OSF1_NFSMNT_ACREGMIN 0x00000200
+#define OSF1_NFSMNT_ACREGMAX 0x00000400
+#define OSF1_NFSMNT_ACDIRMIN 0x00000800
+#define OSF1_NFSMNT_ACDIRMAX 0x00001000
+#define OSF1_NFSMNT_NOCTO 0x00002000
+#define OSF1_NFSMNT_POSIX 0x00004000
+#define OSF1_NFSMNT_AUTO 0x00008000
+#define OSF1_NFSMNT_SEC 0x00010000
+#define OSF1_NFSMNT_TCP 0x00020000
+#define OSF1_NFSMNT_PROPLIST 0x00040000
+
+struct osf1_statfs {
+ osf1_short f_type;
+ osf1_short f_flags;
+ osf1_int f_fsize;
+ osf1_int f_bsize;
+ osf1_int f_blocks;
+ osf1_int f_bfree;
+ osf1_int f_bavail;
+ osf1_int f_files;
+ osf1_int f_ffree;
+ osf1_fsid_t f_fsid;
+ osf1_int f_spare[9];
+ char f_mntonname[OSF1_MNAMELEN];
+ char f_mntfromname[OSF1_MNAMELEN];
+ union osf1_mount_info mount_info;
+};