Module Name: src
Committed By: matt
Date: Fri Dec 20 06:50:28 UTC 2013
Modified Files:
src/sys/arch/arm/arm: cpu_exec.c
Log Message:
If we are exec'ing AAPCS and running on armv6+, disable alignment faults
since gcc 4.8 will generate code that uses unaligned accesses.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/arm/cpu_exec.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/arm/arm/cpu_exec.c
diff -u src/sys/arch/arm/arm/cpu_exec.c:1.7 src/sys/arch/arm/arm/cpu_exec.c:1.8
--- src/sys/arch/arm/arm/cpu_exec.c:1.7 Tue Oct 22 21:37:33 2013
+++ src/sys/arch/arm/arm/cpu_exec.c Fri Dec 20 06:50:28 2013
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v
#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 @@ arm_netbsd_elf32_probe(struct lwp *l, st
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