Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm Test (epp->ep_esch->es_emul != &emul_netbsd...



details:   https://anonhg.NetBSD.org/src/rev/36918e81f3eb
branches:  trunk
changeset: 956930:36918e81f3eb
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Nov 10 21:40:07 2020 +0000

description:
Test (epp->ep_esch->es_emul != &emul_netbsd) instead of
(epp->ep_esch->es_emul == &emul_netbsd32) to determine whether curlwp is
running on COMPAT_NETBSD32 or not.

The former is possible even if COMPAT_NETBSD32 is not built in the main
kernel. Now, compat_netbsd32 module can work on !COMPAT_NETBSD32 kernel.

Discussed with pgoyette.

XXX
Apply similar fixes, i.e., drop ``#ifdef COMPAT_NETBSD32'' conditional
codes from the rest parts of MD codes for aarch64 and mips64.

diffstat:

 sys/arch/arm/arm/cpu_exec.c |  15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)

diffs (45 lines):

diff -r 113ffb2b0589 -r 36918e81f3eb sys/arch/arm/arm/cpu_exec.c
--- a/sys/arch/arm/arm/cpu_exec.c       Tue Nov 10 21:38:03 2020 +0000
+++ b/sys/arch/arm/arm/cpu_exec.c       Tue Nov 10 21:40:07 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_exec.c,v 1.10 2015/04/27 06:54:12 skrll Exp $      */
+/*     $NetBSD: cpu_exec.c,v 1.11 2020/11/10 21:40:07 rin Exp $        */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,10 +30,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.10 2015/04/27 06:54:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.11 2020/11/10 21:40:07 rin Exp $");
 
 #include "opt_compat_netbsd.h"
-#include "opt_compat_netbsd32.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,10 +44,6 @@
 #include <compat/common/compat_util.h>
 #include <sys/exec_elf.h>                      /* mandatory */
 
-#ifdef COMPAT_NETBSD32
-#include <compat/netbsd32/netbsd32_exec.h>
-#endif
-
 #include <arm/locore.h>
 
 #if EXEC_ELF32
@@ -60,11 +55,7 @@
        const Elf_Ehdr * const eh = eh0;
        const bool elf_aapcs_p =
            (eh->e_flags & EF_ARM_EABIMASK) >= EF_ARM_EABI_VER4;
-#ifdef COMPAT_NETBSD32
-       const bool netbsd32_p = (epp->ep_esch->es_emul == &emul_netbsd32);
-#else
-       const bool netbsd32_p = false;
-#endif
+       const bool netbsd32_p = (epp->ep_esch->es_emul != &emul_netbsd);
 #ifdef __ARM_EABI__
        const bool aapcs_p = true;
 #else



Home | Main Index | Thread Index | Old Index