Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/irix Added a bit of sysmp() emulation necessary f...



details:   https://anonhg.NetBSD.org/src/rev/7c2cdd37d4b9
branches:  trunk
changeset: 518582:7c2cdd37d4b9
user:      manu <manu%NetBSD.org@localhost>
date:      Sun Dec 02 08:30:10 2001 +0000

description:
Added a bit of sysmp() emulation necessary for dynamic linking.

diffstat:

 sys/compat/irix/files.irix         |   3 +-
 sys/compat/irix/irix_syscall.h     |   7 +-
 sys/compat/irix/irix_syscallargs.h |  13 ++++-
 sys/compat/irix/irix_syscalls.c    |   8 +-
 sys/compat/irix/irix_sysent.c      |  10 +-
 sys/compat/irix/irix_sysmp.c       |  99 ++++++++++++++++++++++++++++++++++++++
 sys/compat/irix/irix_sysmp.h       |  87 +++++++++++++++++++++++++++++++++
 sys/compat/irix/syscalls.master    |   5 +-
 8 files changed, 216 insertions(+), 16 deletions(-)

diffs (truncated from 357 to 300 lines):

diff -r 8d5d876b8dcf -r 7c2cdd37d4b9 sys/compat/irix/files.irix
--- a/sys/compat/irix/files.irix        Sun Dec 02 08:28:18 2001 +0000
+++ b/sys/compat/irix/files.irix        Sun Dec 02 08:30:10 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.irix,v 1.3 2001/11/28 12:00:53 manu Exp $
+#      $NetBSD: files.irix,v 1.4 2001/12/02 08:30:10 manu Exp $
 #
 
 file   arch/mips/mips/irix_syscall.c           compat_irix
@@ -7,6 +7,7 @@
 file   compat/irix/irix_exec_elf32.c           compat_irix & exec_elf32
 file   compat/irix/irix_sysent.c               compat_irix
 file   compat/irix/irix_syssgi.c               compat_irix
+file   compat/irix/irix_sysmp.c                compat_irix
 
 file   arch/mips/mips/svr4_machdep.c           compat_irix
 
diff -r 8d5d876b8dcf -r 7c2cdd37d4b9 sys/compat/irix/irix_syscall.h
--- a/sys/compat/irix/irix_syscall.h    Sun Dec 02 08:28:18 2001 +0000
+++ b/sys/compat/irix/irix_syscall.h    Sun Dec 02 08:30:10 2001 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: irix_syscall.h,v 1.4 2001/11/28 12:00:53 manu Exp $ */
+/* $NetBSD: irix_syscall.h,v 1.5 2001/12/02 08:30:10 manu Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.2 2001/11/26 21:36:25 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.3 2001/11/28 12:00:54 manu Exp 
  */
 
 /* syscall: "syscall" ret: "int" args: */
@@ -126,6 +126,9 @@
 /* syscall: "ioctl" ret: "int" args: "int" "u_long" "caddr_t" */
 #define        IRIX_SYS_ioctl  54
 
+/* syscall: "sysmp" ret: "int" args: "int" "void *" "void *" "void *" "void *" */
+#define        IRIX_SYS_sysmp  56
+
 /* syscall: "utssys" ret: "int" args: "void *" "void *" "int" "void *" */
 #define        IRIX_SYS_utssys 57
 
diff -r 8d5d876b8dcf -r 7c2cdd37d4b9 sys/compat/irix/irix_syscallargs.h
--- a/sys/compat/irix/irix_syscallargs.h        Sun Dec 02 08:28:18 2001 +0000
+++ b/sys/compat/irix/irix_syscallargs.h        Sun Dec 02 08:30:10 2001 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: irix_syscallargs.h,v 1.4 2001/11/28 12:00:53 manu Exp $ */
+/* $NetBSD: irix_syscallargs.h,v 1.5 2001/12/02 08:30:10 manu Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.2 2001/11/26 21:36:25 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.3 2001/11/28 12:00:54 manu Exp 
  */
 
 #ifndef _IRIX_SYS__SYSCALLARGS_H_
@@ -123,6 +123,14 @@
        syscallarg(caddr_t) data;
 };
 
+struct irix_sys_sysmp_args {
+       syscallarg(int) cmd;
+       syscallarg(void *) arg1;
+       syscallarg(void *) arg2;
+       syscallarg(void *) arg3;
+       syscallarg(void *) arg4;
+};
+
 struct svr4_sys_utssys_args {
        syscallarg(void *) a1;
        syscallarg(void *) a2;
@@ -218,6 +226,7 @@
 #else
 #endif
 int    svr4_sys_ioctl(struct proc *, void *, register_t *);
+int    irix_sys_sysmp(struct proc *, void *, register_t *);
 int    svr4_sys_utssys(struct proc *, void *, register_t *);
 int    svr4_sys_execve(struct proc *, void *, register_t *);
 int    sys_umask(struct proc *, void *, register_t *);
diff -r 8d5d876b8dcf -r 7c2cdd37d4b9 sys/compat/irix/irix_syscalls.c
--- a/sys/compat/irix/irix_syscalls.c   Sun Dec 02 08:28:18 2001 +0000
+++ b/sys/compat/irix/irix_syscalls.c   Sun Dec 02 08:30:10 2001 +0000
@@ -1,14 +1,14 @@
-/* $NetBSD: irix_syscalls.c,v 1.4 2001/11/28 12:00:53 manu Exp $ */
+/* $NetBSD: irix_syscalls.c,v 1.5 2001/12/02 08:30:10 manu Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.2 2001/11/26 21:36:25 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.3 2001/11/28 12:00:54 manu Exp 
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_syscalls.c,v 1.4 2001/11/28 12:00:53 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_syscalls.c,v 1.5 2001/12/02 08:30:10 manu Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -96,7 +96,7 @@
 #endif
        "ioctl",                        /* 54 = ioctl */
        "#55 (unimplemented uadmin)",           /* 55 = unimplemented uadmin */
-       "#56 (unimplemented sysmp)",            /* 56 = unimplemented sysmp */
+       "sysmp",                        /* 56 = sysmp */
        "utssys",                       /* 57 = utssys */
        "#58 (unimplemented)",          /* 58 = unimplemented */
        "execve",                       /* 59 = execve */
diff -r 8d5d876b8dcf -r 7c2cdd37d4b9 sys/compat/irix/irix_sysent.c
--- a/sys/compat/irix/irix_sysent.c     Sun Dec 02 08:28:18 2001 +0000
+++ b/sys/compat/irix/irix_sysent.c     Sun Dec 02 08:30:10 2001 +0000
@@ -1,14 +1,14 @@
-/* $NetBSD: irix_sysent.c,v 1.4 2001/11/28 12:00:54 manu Exp $ */
+/* $NetBSD: irix_sysent.c,v 1.5 2001/12/02 08:30:10 manu Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.2 2001/11/26 21:36:25 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.3 2001/11/28 12:00:54 manu Exp 
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_sysent.c,v 1.4 2001/11/28 12:00:54 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_sysent.c,v 1.5 2001/12/02 08:30:10 manu Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -155,8 +155,8 @@
            svr4_sys_ioctl },                   /* 54 = ioctl */
        { 0, 0, 0,
            sys_nosys },                        /* 55 = unimplemented uadmin */
-       { 0, 0, 0,
-           sys_nosys },                        /* 56 = unimplemented sysmp */
+       { 5, s(struct irix_sys_sysmp_args), 0,
+           irix_sys_sysmp },                   /* 56 = sysmp */
        { 4, s(struct svr4_sys_utssys_args), 0,
            svr4_sys_utssys },                  /* 57 = utssys */
        { 0, 0, 0,
diff -r 8d5d876b8dcf -r 7c2cdd37d4b9 sys/compat/irix/irix_sysmp.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/irix/irix_sysmp.c      Sun Dec 02 08:30:10 2001 +0000
@@ -0,0 +1,99 @@
+/*     $NetBSD: irix_sysmp.c,v 1.1 2001/12/02 08:30:10 manu Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * 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 the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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: irix_sysmp.c,v 1.1 2001/12/02 08:30:10 manu Exp $");
+
+#include <sys/errno.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/systm.h>
+#include <sys/sysctl.h>
+
+#include <machine/vmparam.h>
+
+#include <compat/svr4/svr4_types.h>
+
+#include <compat/irix/irix_sysmp.h>
+#include <compat/irix/irix_syscallargs.h>
+
+int
+irix_sys_sysmp(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       struct irix_sys_sysmp_args /* {
+               syscallarg(int) cmd;
+               syscallarg(void *) arg1;
+               syscallarg(void *) arg2;
+               syscallarg(void *) arg3;
+               syscallarg(void *) arg4;
+       } */ *uap = v;
+       int cmd = SCARG(uap, cmd);
+       int error;
+
+#ifdef DEBUG_IRIX
+       printf("irix_sys_sysmp(): cmd = %d\n", cmd);
+#endif
+
+       switch(cmd) {
+       case IRIX_MP_NPROCS:    /* Number of processors in complex */
+       case IRIX_MP_NAPROCS: { /* Number of active processors in complex */
+               int ncpu;
+               int name = HW_NCPU;
+               int namelen = sizeof(name);
+
+               error = hw_sysctl(&name, 1, &ncpu, &namelen, NULL, 0, p);
+               if (!error)
+                       *retval = (register_t)ncpu;
+               return error;
+               break;
+       }
+       case IRIX_MP_PGSIZE:    /* Page size */
+               *retval = (register_t)PAGE_SIZE;
+               break;
+
+       default:
+               printf("Warning: call to unimplemented sysmp() command %d\n",
+                   cmd);
+               return EINVAL;
+               break;
+       }
+       return 0;
+}
diff -r 8d5d876b8dcf -r 7c2cdd37d4b9 sys/compat/irix/irix_sysmp.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/irix/irix_sysmp.h      Sun Dec 02 08:30:10 2001 +0000
@@ -0,0 +1,87 @@
+/*     $NetBSD: irix_sysmp.h,v 1.1 2001/12/02 08:30:10 manu Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * 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 the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ */
+
+#ifndef _IRIX_SYSMP_H_
+#define _IRIX_SYSMP_H_
+
+/* From IRIX's <sys/sysmp.h> */
+#define IRIX_MP_NPROCS         1
+#define IRIX_MP_NAPROCS                2
+#define IRIX_MP_SPACE          3
+#define IRIX_MP_ENABLE         4
+#define IRIX_MP_DISABLE                5
+#define IRIX_MP_KERNADDR       8
+#define IRIX_MP_SASZ           9



Home | Main Index | Thread Index | Old Index