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.16-1.52 from trunk. (cgd)
details: https://anonhg.NetBSD.org/src/rev/057b12b68154
branches: netbsd-1-4
changeset: 468856:057b12b68154
user: cgd <cgd%NetBSD.org@localhost>
date: Mon Jun 21 19:26:44 1999 +0000
description:
pull up rev(s) 1.16-1.52 from trunk. (cgd)
diffstat:
sys/compat/osf1/osf1_misc.c | 1025 ++++++++----------------------------------
1 files changed, 212 insertions(+), 813 deletions(-)
diffs (truncated from 1126 to 300 lines):
diff -r fbc24225c11c -r 057b12b68154 sys/compat/osf1/osf1_misc.c
--- a/sys/compat/osf1/osf1_misc.c Mon Jun 21 19:26:34 1999 +0000
+++ b/sys/compat/osf1/osf1_misc.c Mon Jun 21 19:26:44 1999 +0000
@@ -1,4 +1,34 @@
-/* $NetBSD: osf1_misc.c,v 1.15 1999/02/09 20:34:16 christos Exp $ */
+/* $NetBSD: osf1_misc.c,v 1.15.2.1 1999/06/21 19:26:44 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.
@@ -45,72 +75,77 @@
#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>
-#include <compat/osf1/osf1_syscall.h>
+#include <compat/osf1/osf1.h>
#include <compat/osf1/osf1_syscallargs.h>
#include <compat/osf1/osf1_util.h>
-
-#include <vm/vm.h>
-
-void cvtstat2osf1 __P((struct stat *, struct osf1_stat *));
-
+#include <compat/osf1/osf1_cvt.h>
#ifdef SYSCALL_DEBUG
extern int scdebug;
#endif
-extern struct sysent osf1_sysent[];
-extern char *osf1_syscallnames[];
-extern void cpu_exec_ecoff_setregs __P((struct proc *, struct exec_package *,
- u_long));
-
-extern char sigcode[], esigcode[];
const char osf1_emul_path[] = "/emul/osf1";
-struct emul emul_osf1 = {
- "osf1",
- NULL,
- sendsig,
- OSF1_SYS_syscall,
- OSF1_SYS_MAXSYSCALL,
- osf1_sysent,
- osf1_syscallnames,
- 0,
- copyargs,
- cpu_exec_ecoff_setregs,
- sigcode,
- esigcode,
-};
+int
+osf1_sys_classcntl(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+
+ /* XXX */
+ return (ENOSYS);
+}
int
-osf1_sys_open(p, v, retval)
+osf1_sys_reboot(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- struct osf1_sys_open_args /* {
- syscallarg(char *) path;
- syscallarg(int) flags;
- syscallarg(int) mode;
- } */ *uap = v;
- struct sys_open_args /* {
- syscallarg(char *) path;
- syscallarg(int) flags;
- syscallarg(int) mode;
- } */ a;
-#ifdef SYSCALL_DEBUG
- char pnbuf[1024];
+ struct osf1_sys_reboot_args *uap = v;
+ struct sys_reboot_args a;
+ unsigned long leftovers;
+
+ /* translate opt */
+ SCARG(&a, opt) = emul_flags_translate(osf1_reboot_opt_xtab,
+ SCARG(uap, opt), &leftovers);
+ if (leftovers != 0)
+ return (EINVAL);
+
+ SCARG(&a, bootstr) = NULL;
+
+ return sys_reboot(p, &a, retval);
+}
- if (scdebug &&
- copyinstr(SCARG(uap, path), pnbuf, sizeof pnbuf, NULL) == 0)
- printf("osf1_open: open: %s\n", pnbuf);
-#endif
+int
+osf1_sys_set_program_attributes(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct osf1_sys_set_program_attributes_args *uap = v;
+ segsz_t tsize, dsize;
+
+ tsize = btoc(SCARG(uap, tsize));
+ dsize = btoc(SCARG(uap, dsize));
- SCARG(&a, path) = SCARG(uap, path);
- SCARG(&a, flags) = SCARG(uap, flags); /* XXX translate */
- SCARG(&a, mode) = SCARG(uap, mode);
+ if (dsize > p->p_rlimit[RLIMIT_DATA].rlim_cur)
+ return (ENOMEM);
+ if (tsize > MAXTSIZ)
+ return (ENOMEM);
- return sys_open(p, &a, retval);
+ 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
@@ -119,147 +154,112 @@
void *v;
register_t *retval;
{
-#if 0
- struct osf1_setsysinfo_args /* {
- syscallarg(u_long) op;
- syscallarg(caddr_t) buffer;
- syscallarg(u_long) nbytes;
- syscallarg(caddr_t) arg;
- syscallarg(u_long) flag;
- } */ *uap = v;
-#endif
+ /* XXX */
return (0);
}
-#define OSF1_RLIMIT_LASTCOMMON 5 /* last one that's common */
-#define OSF1_RLIMIT_NOFILE 6 /* OSF1's RLIMIT_NOFILE */
-#define OSF1_RLIMIT_NLIMITS 8 /* Number of OSF1 rlimits */
-
int
-osf1_sys_getrlimit(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- struct osf1_sys_getrlimit_args /* {
- syscallarg(u_int) which;
- syscallarg(struct rlimit *) rlp;
- } */ *uap = v;
- struct sys_getrlimit_args /* {
- syscallarg(u_int) which;
- syscallarg(struct rlimit *) rlp;
- } */ a;
-
- if (SCARG(uap, which) >= OSF1_RLIMIT_NLIMITS)
- return (EINVAL);
-
- if (SCARG(uap, which) <= OSF1_RLIMIT_LASTCOMMON)
- SCARG(&a, which) = SCARG(uap, which);
- else if (SCARG(uap, which) == OSF1_RLIMIT_NOFILE)
- SCARG(&a, which) = RLIMIT_NOFILE;
- else
- return (0);
- SCARG(&a, rlp) = SCARG(uap, rlp);
-
- return sys_getrlimit(p, &a, retval);
-}
-
-int
-osf1_sys_setrlimit(p, v, retval)
+osf1_sys_sysinfo(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- struct osf1_sys_setrlimit_args /* {
- syscallarg(u_int) which;
- syscallarg(struct rlimit *) rlp;
- } */ *uap = v;
- struct sys_setrlimit_args /* {
- syscallarg(u_int) which;
- syscallarg(struct rlimit *) rlp;
- } */ a;
+ struct osf1_sys_sysinfo_args *uap = v;
+ const char *string;
+ int error;
+ extern char ostype[], osrelease[];
+
+ 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;
- if (SCARG(uap, which) >= OSF1_RLIMIT_NLIMITS)
- return (EINVAL);
+ 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;
- if (SCARG(uap, which) <= OSF1_RLIMIT_LASTCOMMON)
- SCARG(&a, which) = SCARG(uap, which);
- else if (SCARG(uap, which) == OSF1_RLIMIT_NOFILE)
- SCARG(&a, which) = RLIMIT_NOFILE;
- else
- return (0);
- SCARG(&a, rlp) = SCARG(uap, rlp);
+ case OSF1_SI_SET_SRPC_DOMAIN:
+ goto dont_care;
- return sys_setrlimit(p, &a, retval);
+ default:
+should_handle:
+ printf("osf1_sys_sysinfo(%d, %p, 0x%lx)\n", SCARG(uap, cmd),
+ SCARG(uap, buf), SCARG(uap,len));
+dont_care:
+ error = EINVAL;
+ break;
+ };
+
+ if (error == 0)
Home |
Main Index |
Thread Index |
Old Index