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 If we are exec'ing AAPCS and running on arm...



details:   https://anonhg.NetBSD.org/src/rev/13de5e047291
branches:  trunk
changeset: 325358:13de5e047291
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Dec 20 06:50:28 2013 +0000

description:
If we are exec'ing AAPCS and running on armv6+, disable alignment faults
since gcc 4.8 will generate code that uses unaligned accesses.

diffstat:

 sys/arch/arm/arm/cpu_exec.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r 60a72fe28848 -r 13de5e047291 sys/arch/arm/arm/cpu_exec.c
--- a/sys/arch/arm/arm/cpu_exec.c       Fri Dec 20 06:48:09 2013 +0000
+++ b/sys/arch/arm/arm/cpu_exec.c       Fri Dec 20 06:50:28 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_exec.c,v 1.7 2013/10/22 21:37:33 matt Exp $        */
+/*     $NetBSD: cpu_exec.c,v 1.8 2013/12/20 06:50:28 matt Exp $        */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.7 2013/10/22 21:37:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.8 2013/12/20 06:50:28 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_netbsd32.h"
@@ -49,6 +49,8 @@
 #include <compat/netbsd32/netbsd32_exec.h>
 #endif
 
+#include <arm/locore.h>
+
 #if EXEC_ELF32
 int
 arm_netbsd_elf32_probe(struct lwp *l, struct exec_package *epp, void *eh0,
@@ -109,6 +111,13 @@
                strlcpy(l->l_proc->p_md.md_march, epp->ep_machine_arch,
                    sizeof(l->l_proc->p_md.md_march));
        }
+       /*
+        * If we are AAPCS (EABI) and armv6/armv7, we want alignment faults
+        * be off.
+        */
+       if (aapcs_p && (CPU_IS_ARMV7_P() || CPU_IS_ARMV6_P())) {
+               l->l_md.md_flags |= MDLWP_NOALIGNFLT;
+       }
        return 0;
 }
 #endif



Home | Main Index | Thread Index | Old Index