Source-Changes-HG archive

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

[src/trunk]: src/sys Merge from matt-nb5-mips64



details:   https://anonhg.NetBSD.org/src/rev/b89a4e7fe216
branches:  trunk
changeset: 749987:b89a4e7fe216
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Dec 14 00:47:10 2009 +0000

description:
Merge from matt-nb5-mips64

diffstat:

 sys/compat/common/Makefile.inc             |    5 +-
 sys/compat/irix/files.irix                 |    3 +-
 sys/compat/irix/irix_exec.c                |   11 +-
 sys/compat/irix/irix_exec.h                |    4 +-
 sys/compat/irix/irix_exec_elf32.c          |   63 ++++++++++---
 sys/compat/irix/irix_exec_elf64.c          |    5 +
 sys/compat/irix/irix_fcntl.c               |    4 +-
 sys/compat/irix/irix_prctl.c               |   10 +-
 sys/compat/irix/irix_signal.c              |   38 +++----
 sys/compat/irix/irix_sysmp.c               |   10 +-
 sys/compat/irix/irix_syssgi.c              |   37 ++++---
 sys/compat/irix/irix_types.h               |   36 +++---
 sys/compat/linux/arch/mips/linux_machdep.c |   10 +-
 sys/compat/netbsd32/netbsd32.h             |   33 ++++++-
 sys/compat/netbsd32/netbsd32_exec_elf32.c  |   12 +-
 sys/compat/netbsd32/netbsd32_fs.c          |  134 ++++++++++++++++++++++++++++-
 sys/compat/netbsd32/netbsd32_netbsd.c      |    6 +-
 sys/compat/netbsd32/netbsd32_syscall.h     |    5 +-
 sys/compat/netbsd32/netbsd32_syscallargs.h |   13 ++-
 sys/compat/netbsd32/netbsd32_syscalls.c    |    6 +-
 sys/compat/netbsd32/netbsd32_sysent.c      |   30 +++---
 sys/compat/netbsd32/syscalls.master        |    6 +-
 sys/compat/ultrix/ultrix_flock.h           |   12 +-
 sys/compat/ultrix/ultrix_fs.c              |   34 +++---
 sys/compat/ultrix/ultrix_ioctl.c           |   10 +-
 sys/compat/ultrix/ultrix_pathname.c        |   20 ++--
 sys/compat/ultrix/ultrix_tty.h             |   10 +-
 sys/kern/core_elf32.c                      |   19 +++-
 sys/kern/exec_elf.c                        |    9 +-
 sys/kern/init_sysent.c                     |   28 +++---
 sys/kern/sys_process.c                     |   14 ++-
 sys/kern/syscalls.c                        |    6 +-
 sys/lib/libkern/arch/mips/Makefile.inc     |   11 +-
 sys/sys/exec.h                             |    4 +-
 sys/sys/ptrace.h                           |   16 +++-
 35 files changed, 471 insertions(+), 203 deletions(-)

diffs (truncated from 1721 to 300 lines):

diff -r 815d886a48d1 -r b89a4e7fe216 sys/compat/common/Makefile.inc
--- a/sys/compat/common/Makefile.inc    Mon Dec 14 00:46:21 2009 +0000
+++ b/sys/compat/common/Makefile.inc    Mon Dec 14 00:47:10 2009 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.19 2002/11/02 07:49:57 perry Exp $
+#      $NetBSD: Makefile.inc,v 1.20 2009/12/14 00:47:10 matt Exp $
 #
 #      Configuration variables (default values are below):
 #
@@ -41,7 +41,8 @@
            LORDER=${LORDER:Q} \
            TSORT=${TSORT:Q} \
            RANLIB=${RANLIB:Q} \
-           LD=${LD:Q} STRIP=${STRIP:Q} \
+           LD=${LD:Q} LDFLAGS=${LDFLAGS:Q} \
+           STRIP=${STRIP:Q} \
            MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
            COMPATCPPFLAGS=${CPPFLAGS:S@^-I.@-I${COMPATDOTDIR}@g:Q} \
            LINTFLAGS=${KERNLINTFLAGS:Q} \
diff -r 815d886a48d1 -r b89a4e7fe216 sys/compat/irix/files.irix
--- a/sys/compat/irix/files.irix        Mon Dec 14 00:46:21 2009 +0000
+++ b/sys/compat/irix/files.irix        Mon Dec 14 00:47:10 2009 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.irix,v 1.26 2008/11/19 18:36:03 ad Exp $
+#      $NetBSD: files.irix,v 1.27 2009/12/14 00:47:10 matt Exp $
 #
 
 file   arch/mips/mips/irix_syscall.c           compat_irix
@@ -7,6 +7,7 @@
 file   compat/irix/irix_errno.c                compat_irix
 file   compat/irix/irix_exec.c                 compat_irix
 file   compat/irix/irix_exec_elf32.c           compat_irix & exec_elf32
+file   compat/irix/irix_exec_elf64.c           compat_irix & exec_elf64
 file   compat/irix/irix_fcntl.c                compat_irix
 file   compat/irix/irix_ioctl.c                compat_irix
 file   compat/irix/irix_kmem.c                 compat_irix
diff -r 815d886a48d1 -r b89a4e7fe216 sys/compat/irix/irix_exec.c
--- a/sys/compat/irix/irix_exec.c       Mon Dec 14 00:46:21 2009 +0000
+++ b/sys/compat/irix/irix_exec.c       Mon Dec 14 00:47:10 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irix_exec.c,v 1.55 2009/12/10 14:13:53 matt Exp $ */
+/*     $NetBSD: irix_exec.c,v 1.56 2009/12/14 00:47:10 matt Exp $ */
 
 /*-
  * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_exec.c,v 1.55 2009/12/10 14:13:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_exec.c,v 1.56 2009/12/14 00:47:10 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_syscall_debug.h"
@@ -124,10 +124,13 @@
 void
 irix_n32_setregs(struct lwp *l, struct exec_package *pack, vaddr_t stack)
 {
-       struct frame *f = (struct frame *)l->l_md.md_regs;
+       struct frame *f = l->l_md.md_regs;
 
        /* Enable 64 bit instructions (eg: sd) */
-       f->f_regs[_R_SR] |= MIPS3_SR_UX;
+       f->f_regs[_R_SR] |= MIPS3_SR_UX | MIPS3_SR_FR;
+#ifdef _LP64
+       f->f_regs[_R_SR] |= MIPS3_SR_KX;
+#endif
 }
 
 /*
diff -r 815d886a48d1 -r b89a4e7fe216 sys/compat/irix/irix_exec.h
--- a/sys/compat/irix/irix_exec.h       Mon Dec 14 00:46:21 2009 +0000
+++ b/sys/compat/irix/irix_exec.h       Mon Dec 14 00:47:10 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irix_exec.h,v 1.27 2009/12/10 14:13:53 matt Exp $ */
+/*     $NetBSD: irix_exec.h,v 1.28 2009/12/14 00:47:10 matt Exp $ */
 
 /*-
  * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
 int irix_elf64_copyargs(struct lwp *, struct exec_package *,
     struct ps_strings *, char **, void *);
 
-int irix_elf64_probe(struct lwp *, struct exec_package *, void *,
+int irix_elf64_probe_n64(struct lwp *, struct exec_package *, void *,
     char *, vaddr_t *);
 #endif
 
diff -r 815d886a48d1 -r b89a4e7fe216 sys/compat/irix/irix_exec_elf32.c
--- a/sys/compat/irix/irix_exec_elf32.c Mon Dec 14 00:46:21 2009 +0000
+++ b/sys/compat/irix/irix_exec_elf32.c Mon Dec 14 00:47:10 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irix_exec_elf32.c,v 1.15 2008/04/28 20:23:41 martin Exp $ */
+/*     $NetBSD: irix_exec_elf32.c,v 1.16 2009/12/14 00:47:10 matt Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,12 +30,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_exec_elf32.c,v 1.15 2008/04/28 20:23:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_exec_elf32.c,v 1.16 2009/12/14 00:47:10 matt Exp $");
 
 #ifndef ELFSIZE
 #define ELFSIZE                32      /* XXX should die */
 #endif
 
+#include "opt_execfmt.h"
+
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/systm.h>
@@ -56,16 +58,13 @@
 
 #include <compat/irix/irix_exec.h>
 
+#if ELFSIZE == 32
 /*
  * IRIX o32 ABI probe function
  */
 int
-ELFNAME2(irix,probe_o32)(l, epp, eh, itp, pos)
-       struct lwp *l;
-       struct exec_package *epp;
-       void *eh;
-       char *itp;
-       vaddr_t *pos;
+ELFNAME2(irix,probe_o32)(struct lwp *l, struct exec_package *epp, void *eh,
+       char *itp, vaddr_t *pos)
 {
        int error = 0;
 
@@ -90,6 +89,7 @@
        printf("epp->ep_vm_minaddr = 0x%lx\n", epp->ep_vm_minaddr);
 #endif
        epp->ep_vm_minaddr = epp->ep_vm_minaddr & ~0xfUL;
+       l->l_proc->p_md.md_abi = _MIPS_BSD_API_O32;
        return 0;
 }
 
@@ -97,12 +97,8 @@
  * IRIX n32 ABI probe function
  */
 int
-ELFNAME2(irix,probe_n32)(l, epp, eh, itp, pos)
-       struct lwp *l;
-       struct exec_package *epp;
-       void *eh;
-       char *itp;
-       vaddr_t *pos;
+ELFNAME2(irix,probe_n32)(struct lwp *l, struct exec_package *epp, void *eh,
+       char *itp, vaddr_t *pos)
 {
        int error = 0;
 
@@ -126,8 +122,45 @@
        printf("epp->ep_vm_minaddr = 0x%lx\n", epp->ep_vm_minaddr);
 #endif
        epp->ep_vm_minaddr = epp->ep_vm_minaddr & ~0xfUL;
+       l->l_proc->p_md.md_abi = _MIPS_BSD_API_N32;
        return 0;
 }
+#endif /* ELFSIZE == 32 */
+
+#if ELFSIZE == 64
+/*
+ * IRIX n64 ABI probe function
+ */
+int
+irix_elf64_probe_n64(struct lwp *l, struct exec_package *epp, void *eh,
+       char *itp, vaddr_t *pos)
+{
+       int error = 0;
+
+#ifdef DEBUG_IRIX
+       printf("irix_probe_n64()\n");
+#endif
+       if ((((Elf_Ehdr *)epp->ep_hdr)->e_flags & IRIX_EF_IRIX_ABI_MASK) !=
+           IRIX_EF_IRIX_ABI64)
+               return error;
+
+       if (itp) {
+               /* n32 binaries use /lib64/libc.so.1 */
+               if (strncmp(itp, "/lib64/libc.so", 14) &&
+                   strncmp(itp, "/usr/lib64/libc.so", 18))
+                       return ENOEXEC;
+               if ((error = emul_find_interp(l, epp, itp)))
+                       return error;
+       }
+#ifdef DEBUG_IRIX
+       printf("irix_probe_n32: returning 0\n");
+       printf("epp->ep_vm_minaddr = 0x%lx\n", epp->ep_vm_minaddr);
+#endif
+       epp->ep_vm_minaddr = epp->ep_vm_minaddr & ~0xfUL;
+       l->l_proc->p_md.md_abi = _MIPS_BSD_API_N32;
+       return 0;
+}
+#endif /* ELFSIZE == 64 */
 
 int
 ELFNAME2(irix,copyargs)(l, pack, arginfo, stackp, argp)
@@ -152,7 +185,7 @@
         * the code that sets up the stack in copyargs():
         */
 #ifdef DEBUG_IRIX
-       printf("irix_elf32_copyargs(): *stackp = %p\n", *stackp);
+       printf("%s(): *stackp = %p\n", __func__, *stackp);
 #endif
        /*
         * This is borrowed from sys/kern/kern_exec.c:copyargs()
diff -r 815d886a48d1 -r b89a4e7fe216 sys/compat/irix/irix_exec_elf64.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/irix/irix_exec_elf64.c Mon Dec 14 00:47:10 2009 +0000
@@ -0,0 +1,5 @@
+/* $NetBSD: irix_exec_elf64.c,v 1.2 2009/12/14 00:47:10 matt Exp $ */
+
+#define ELFSIZE 64
+
+#include "irix_exec_elf32.c"
diff -r 815d886a48d1 -r b89a4e7fe216 sys/compat/irix/irix_fcntl.c
--- a/sys/compat/irix/irix_fcntl.c      Mon Dec 14 00:46:21 2009 +0000
+++ b/sys/compat/irix/irix_fcntl.c      Mon Dec 14 00:47:10 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irix_fcntl.c,v 1.27 2009/08/31 05:34:16 dholland Exp $ */
+/*     $NetBSD: irix_fcntl.c,v 1.28 2009/12/14 00:47:10 matt Exp $ */
 
 /*-
  * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.27 2009/08/31 05:34:16 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_fcntl.c,v 1.28 2009/12/14 00:47:10 matt Exp $");
 
 #include <sys/types.h>
 #include <sys/signal.h>
diff -r 815d886a48d1 -r b89a4e7fe216 sys/compat/irix/irix_prctl.c
--- a/sys/compat/irix/irix_prctl.c      Mon Dec 14 00:46:21 2009 +0000
+++ b/sys/compat/irix/irix_prctl.c      Mon Dec 14 00:47:10 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irix_prctl.c,v 1.49 2009/03/18 16:00:16 cegger Exp $ */
+/*     $NetBSD: irix_prctl.c,v 1.50 2009/12/14 00:47:10 matt Exp $ */
 
 /*-
  * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_prctl.c,v 1.49 2009/03/18 16:00:16 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_prctl.c,v 1.50 2009/12/14 00:47:10 matt Exp $");
 
 #include <sys/errno.h>
 #include <sys/types.h>
@@ -101,9 +101,9 @@
                int shmask = 0;
                struct irix_emuldata *ied;
 
-               p2 = pfind((pid_t)SCARG(uap, arg1));
+               p2 = pfind((pid_t)(uintptr_t)SCARG(uap, arg1));
 
-               if (p2 == p || SCARG(uap, arg1) == 0) {
+               if (p2 == p || SCARG(uap, arg1) == NULL) {
                        /* XXX return our own shmask */
                        return 0;
                }
@@ -160,7 +160,7 @@
        }
 
        case IRIX_PR_ISBLOCKED: {       /* Is process blocked? */
-               pid_t pid = (pid_t)SCARG(uap, arg1);
+               pid_t pid = (pid_t)(uintptr_t)SCARG(uap, arg1);
                struct irix_emuldata *ied;
                struct proc *target;
 
diff -r 815d886a48d1 -r b89a4e7fe216 sys/compat/irix/irix_signal.c
--- a/sys/compat/irix/irix_signal.c     Mon Dec 14 00:46:21 2009 +0000
+++ b/sys/compat/irix/irix_signal.c     Mon Dec 14 00:47:10 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: irix_signal.c,v 1.52 2009/11/23 00:46:06 rmind Exp $ */
+/*     $NetBSD: irix_signal.c,v 1.53 2009/12/14 00:47:10 matt Exp $ */
 
 /*-
  * Copyright (c) 1994, 2001-2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.52 2009/11/23 00:46:06 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.53 2009/12/14 00:47:10 matt Exp $");
 
 #include <sys/types.h>
 #include <sys/signal.h>
@@ -140,7 +140,7 @@
        }
        isi->isi_signo = native_to_svr4_signo[sig];
        isi->isi_errno = 0;
-       isi->isi_addr = (irix_app32_ptr_t)addr;



Home | Main Index | Thread Index | Old Index