Source-Changes-HG archive

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

[src/pgoyette-compat]: src/sys/arch/mips Add glue for netbsd32 compat_13 and ...



details:   https://anonhg.NetBSD.org/src/rev/55d619ef2eae
branches:  pgoyette-compat
changeset: 830825:55d619ef2eae
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Sep 29 06:31:02 2018 +0000

description:
Add glue for netbsd32 compat_13 and _16 modules

diffstat:

 sys/arch/mips/conf/files.mips            |   13 +-
 sys/arch/mips/mips/netbsd32_machdep.c    |   18 ++-
 sys/arch/mips/mips/netbsd32_machdep_13.c |  104 ++++++++++++++++
 sys/arch/mips/mips/netbsd32_machdep_16.c |  192 +++++++++++++++++++++++++++++++
 4 files changed, 322 insertions(+), 5 deletions(-)

diffs (truncated from 372 to 300 lines):

diff -r 22b9f5c7eb1c -r 55d619ef2eae sys/arch/mips/conf/files.mips
--- a/sys/arch/mips/conf/files.mips     Sat Sep 29 06:19:42 2018 +0000
+++ b/sys/arch/mips/conf/files.mips     Sat Sep 29 06:31:02 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.mips,v 1.75 2016/07/11 23:06:53 matt Exp $
+#      $NetBSD: files.mips,v 1.75.16.1 2018/09/29 06:31:02 pgoyette Exp $
 #
 
 defflag        opt_cputype.h           NOFPU FPEMUL
@@ -91,13 +91,20 @@
 
 file   arch/mips/mips/procfs_machdep.c         procfs
 
+# 
+# Compatibility modules 
+#
+# Binary compatibility with previous NetBSD releases (COMPAT_XX)
+file   arch/mips/mips/compat_13_machdep.c      compat_13 | compat_ultrix
+file   arch/mips/mips/compat_16_machdep.c      compat_16 | compat_ultrix
+
 # Binary compatibility with 32bit NetBSD (COMPAT_NETBSD32)
 file   arch/mips/mips/netbsd32_machdep.c       compat_netbsd32
+file   arch/mips/mips/netbsd32_machdep_13.c    compat_netbsd32 & compat_13
+file   arch/mips/mips/netbsd32_machdep_16.c    compat_netbsd32 & compat_16
 include "compat/netbsd32/files.netbsd32"
 
 # Binary compatibility with previous NetBSD releases (COMPAT_XX)
-file   arch/mips/mips/compat_13_machdep.c      compat_13 | compat_ultrix
-file   arch/mips/mips/compat_16_machdep.c      compat_16 | compat_ultrix
 
 # Ultrix Binary Compatibility (COMPAT_ULTRIX)
 include "compat/ultrix/files.ultrix"
diff -r 22b9f5c7eb1c -r 55d619ef2eae sys/arch/mips/mips/netbsd32_machdep.c
--- a/sys/arch/mips/mips/netbsd32_machdep.c     Sat Sep 29 06:19:42 2018 +0000
+++ b/sys/arch/mips/mips/netbsd32_machdep.c     Sat Sep 29 06:31:02 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.15 2017/10/31 12:37:23 martin Exp $     */
+/*     $NetBSD: netbsd32_machdep.c,v 1.15.2.1 2018/09/29 06:31:02 pgoyette Exp $       */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15 2017/10/31 12:37:23 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.1 2018/09/29 06:31:02 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -343,3 +343,17 @@
            chdr->c_cpusize);
 }
 #endif
+
+void    
+netbsd32_machdep_md_init(void)
+{       
+                
+       /* nothing to do */
+}               
+                
+void            
+netbsd32_machdep_md_fini(void)
+{       
+
+       /* nothing to do */
+}
diff -r 22b9f5c7eb1c -r 55d619ef2eae sys/arch/mips/mips/netbsd32_machdep_13.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/mips/mips/netbsd32_machdep_13.c  Sat Sep 29 06:31:02 2018 +0000
@@ -0,0 +1,104 @@
+/*     $NetBSD: netbsd32_machdep_13.c,v 1.1.2.1 2018/09/29 06:31:02 pgoyette Exp $     */
+
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas <matt%3am-software.com@localhost>.
+ *
+ * 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.
+ *
+ * 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: netbsd32_machdep_13.c,v 1.1.2.1 2018/09/29 06:31:02 pgoyette Exp $");
+
+#include "opt_compat_netbsd.h"
+#include "opt_coredump.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/ioctl.h>
+#include <sys/exec.h>
+#include <sys/cpu.h>
+#include <sys/core.h>
+#include <sys/file.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+#include <sys/uio.h>
+#include <sys/kernel.h>
+#include <sys/buf.h>
+#include <sys/signal.h>
+#include <sys/signalvar.h>
+#include <sys/mount.h>
+#include <sys/syscallargs.h>
+
+#include <compat/netbsd32/netbsd32.h>
+#include <compat/netbsd32/netbsd32_exec.h>
+#include <compat/netbsd32/netbsd32_syscallargs.h>
+
+#include <mips/cache.h>
+#include <mips/sysarch.h>
+#include <mips/cachectl.h>
+#include <mips/locore.h>
+#include <mips/frame.h>
+#include <mips/regnum.h>
+#include <mips/pcb.h>
+
+#include <uvm/uvm_extern.h>
+
+const char machine32[] = MACHINE;
+const char machine_arch32[] = MACHINE32_ARCH;
+
+#if 0
+cpu_coredump32
+netbsd32_cpu_upcall
+netbsd32_vm_default_addr
+#endif
+
+#ifdef COMPAT_13
+int
+compat_13_netbsd32_sigreturn(struct lwp *l,
+       const struct compat_13_netbsd32_sigreturn_args *uap,
+       register_t *retval)
+{
+       struct compat_13_sys_sigreturn_args ua;
+
+       NETBSD32TOP_UAP(sigcntxp, struct sigcontext13 *);
+
+       return compat_13_sys_sigreturn(l, &ua, retval);
+}
+#endif
+
+void    
+netbsd32_machdep_md_13_init(void)
+{       
+                
+       /* nothing to do */
+}               
+                
+void            
+netbsd32_machdep_md_13_fini(void)
+{       
+
+       /* nothing to do */
+}
diff -r 22b9f5c7eb1c -r 55d619ef2eae sys/arch/mips/mips/netbsd32_machdep_16.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/mips/mips/netbsd32_machdep_16.c  Sat Sep 29 06:31:02 2018 +0000
@@ -0,0 +1,192 @@
+/*     $NetBSD: netbsd32_machdep_16.c,v 1.1.2.1 2018/09/29 06:31:02 pgoyette Exp $     */
+
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas <matt%3am-software.com@localhost>.
+ *
+ * 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.
+ *
+ * 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: netbsd32_machdep_16.c,v 1.1.2.1 2018/09/29 06:31:02 pgoyette Exp $");
+
+#include "opt_compat_netbsd.h"
+#include "opt_coredump.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/ioctl.h>
+#include <sys/exec.h>
+#include <sys/cpu.h>
+#include <sys/core.h>
+#include <sys/file.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+#include <sys/uio.h>
+#include <sys/kernel.h>
+#include <sys/buf.h>
+#include <sys/signal.h>
+#include <sys/signalvar.h>
+#include <sys/mount.h>
+#include <sys/syscallargs.h>
+
+#include <compat/netbsd32/netbsd32.h>
+#include <compat/netbsd32/netbsd32_exec.h>
+#include <compat/netbsd32/netbsd32_syscallargs.h>
+
+#include <mips/cache.h>
+#include <mips/sysarch.h>
+#include <mips/cachectl.h>
+#include <mips/locore.h>
+#include <mips/frame.h>
+#include <mips/regnum.h>
+#include <mips/pcb.h>
+
+#include <uvm/uvm_extern.h>
+
+#ifdef COMPAT_16
+int
+compat_16_netbsd32___sigreturn14(struct lwp *l,
+       const struct compat_16_netbsd32___sigreturn14_args *uap,
+       register_t *retval)
+{
+       struct compat_16_sys___sigreturn14_args ua;
+
+       NETBSD32TOP_UAP(sigcntxp, struct sigcontext *);
+
+       return compat_16_sys___sigreturn14(l, &ua, retval);
+}
+#endif
+
+struct sigframe_siginfo32 {
+       siginfo32_t sf_si;
+       ucontext32_t sf_uc;
+};
+
+/*
+ * Send a signal to process.
+ */
+static void
+netbsd32_sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
+{
+       struct lwp * const l = curlwp;
+       struct proc * const p = l->l_proc;
+       struct sigacts * const ps = p->p_sigacts;
+       int onstack, error;
+       int sig = ksi->ksi_signo;
+       struct sigframe_siginfo32 *sfp = getframe(l, sig, &onstack);
+       struct sigframe_siginfo32 sf;
+       struct trapframe * const tf = l->l_md.md_utf;
+       size_t sfsz;
+       sig_t catcher = SIGACTION(p, sig).sa_handler;
+
+       sfp--;
+
+       netbsd32_si_to_si32(&sf.sf_si, (const siginfo_t *)&ksi->ksi_info);
+
+        /* Build stack frame for signal trampoline. */
+        switch (ps->sa_sigdesc[sig].sd_vers) {
+        case 0:         /* handled by sendsig_sigcontext */
+        case 1:         /* handled by sendsig_sigcontext */
+        default:        /* unknown version */
+                printf("sendsig_siginfo: bad version %d\n",
+                    ps->sa_sigdesc[sig].sd_vers);
+                sigexit(l, SIGILL);
+        case 2:
+                break;
+        }
+



Home | Main Index | Thread Index | Old Index