Module Name:    src
Committed By:   pgoyette
Date:           Sat Sep 29 08:07:54 UTC 2018

Modified Files:
        src/sys/arch/mips/mips [pgoyette-compat]: netbsd32_machdep.c
            netbsd32_machdep_13.c

Log Message:
Keep only one copy of the netbsd32_compat_16 code.

Remove unnecessary #ifdef COMPAT_13 since the source file will only be
processed if COMPAT_13 is already defined.


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.1 -r1.15.2.2 src/sys/arch/mips/mips/netbsd32_machdep.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/mips/netbsd32_machdep_13.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.1 src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.2
--- src/sys/arch/mips/mips/netbsd32_machdep.c:1.15.2.1	Sat Sep 29 06:31:02 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep.c	Sat Sep 29 08:07:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.1 2018/09/29 06:31:02 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.15.2.2 2018/09/29 08:07:54 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.2.1 2018/09/29 06:31:02 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15.2.2 2018/09/29 08:07:54 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -114,34 +114,6 @@ netbsd32_sysarch(struct lwp *l, const st
 	return (error);
 }
 
-#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
-
-#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
-
 vaddr_t
 netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t size,
     int topdown)
@@ -158,95 +130,6 @@ struct sigframe_siginfo32 {
 	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;
-        }
-
-	sf.sf_uc.uc_flags = _UC_SIGMASK
-	    | ((l->l_sigstk.ss_flags & SS_ONSTACK)
-	    ? _UC_SETSTACK : _UC_CLRSTACK);
-	sf.sf_uc.uc_sigmask = *mask;
-	sf.sf_uc.uc_link = (intptr_t)l->l_ctxlink;
-	memset(&sf.sf_uc.uc_stack, 0, sizeof(sf.sf_uc.uc_stack));
-	sfsz = offsetof(struct sigframe_siginfo32, sf_uc.uc_mcontext);
-	if (p->p_md.md_abi == _MIPS_BSD_API_O32)
-		sfsz += sizeof(mcontext_o32_t);
-	else
-		sfsz += sizeof(mcontext32_t);
-	sendsig_reset(l, sig);
-	mutex_exit(p->p_lock);
-	cpu_getmcontext32(l, &sf.sf_uc.uc_mcontext, &sf.sf_uc.uc_flags);
-	error = copyout(&sf, sfp, sfsz);
-	mutex_enter(p->p_lock);
-
-	if (error != 0) {
-		/*
-		 * Process has trashed its stack; give it an illegal
-		 * instruction to halt it in its tracks.
-		 */
-		sigexit(l, SIGILL);
-		/* NOTREACHED */
-	}
-
-	/*
-	 * Set up the registers to directly invoke the signal
-	 * handler.  The return address will be set up to point
-	 * to the signal trampoline to bounce us back.
-	 */
-	tf->tf_regs[_R_A0] = sig;
-	tf->tf_regs[_R_A1] = (intptr_t)&sfp->sf_si;
-	tf->tf_regs[_R_A2] = (intptr_t)&sfp->sf_uc;
-
-	tf->tf_regs[_R_PC] = (intptr_t)catcher;
-	tf->tf_regs[_R_T9] = (intptr_t)catcher;
-	tf->tf_regs[_R_SP] = (intptr_t)sfp;
-	tf->tf_regs[_R_RA] = (intptr_t)ps->sa_sigdesc[sig].sd_tramp;
-
-	/* Remember that we're now on the signal stack. */
-	if (onstack)
-		l->l_sigstk.ss_flags |= SS_ONSTACK;
-}
-
-void    
-netbsd32_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
-{               
-#ifdef COMPAT_16    
-	if (curproc->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers < 2)
-		sendsig_sigcontext(ksi, mask);
-	else    
-#endif  
-		netbsd32_sendsig_siginfo(ksi, mask);
-}       
-
 void
 cpu_getmcontext32(struct lwp *l, mcontext32_t *mc32, unsigned int *flagsp)
 {

Index: src/sys/arch/mips/mips/netbsd32_machdep_13.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep_13.c:1.1.2.1 src/sys/arch/mips/mips/netbsd32_machdep_13.c:1.1.2.2
--- src/sys/arch/mips/mips/netbsd32_machdep_13.c:1.1.2.1	Sat Sep 29 06:31:02 2018
+++ src/sys/arch/mips/mips/netbsd32_machdep_13.c	Sat Sep 29 08:07:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_13.c,v 1.1.2.1 2018/09/29 06:31:02 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_13.c,v 1.1.2.2 2018/09/29 08:07:54 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #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 $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.1.2.2 2018/09/29 08:07:54 pgoyette Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -75,7 +75,6 @@ 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,
@@ -87,7 +86,6 @@ compat_13_netbsd32_sigreturn(struct lwp 
 
 	return compat_13_sys_sigreturn(l, &ua, retval);
 }
-#endif
 
 void    
 netbsd32_machdep_md_13_init(void)

Reply via email to