Module Name: src
Committed By: matt
Date: Wed Mar 26 02:01:10 UTC 2014
Modified Files:
src/sys/arch/arm/arm [matt-nb5-mips64]: arm_machdep.c
Log Message:
If BE on armv7, set PSR_E_BIT
To generate a diff of this commit:
cvs rdiff -u -r1.21.8.1 -r1.21.8.2 src/sys/arch/arm/arm/arm_machdep.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/arm_machdep.c
diff -u src/sys/arch/arm/arm/arm_machdep.c:1.21.8.1 src/sys/arch/arm/arm/arm_machdep.c:1.21.8.2
--- src/sys/arch/arm/arm/arm_machdep.c:1.21.8.1 Sat Feb 15 16:18:35 2014
+++ src/sys/arch/arm/arm/arm_machdep.c Wed Mar 26 02:01:10 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: arm_machdep.c,v 1.21.8.1 2014/02/15 16:18:35 matt Exp $ */
+/* $NetBSD: arm_machdep.c,v 1.21.8.2 2014/03/26 02:01:10 matt Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -79,7 +79,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.21.8.1 2014/02/15 16:18:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.21.8.2 2014/03/26 02:01:10 matt Exp $");
#include <sys/exec.h>
#include <sys/proc.h>
@@ -173,12 +173,20 @@ setregs(struct lwp *l, struct exec_packa
tf->tf_svc_lr = 0x77777777; /* Something we can see */
tf->tf_pc = pack->ep_entry;
#ifdef __PROG32
+#if defined(__ARMEB__)
+ /*
+ * If we are running on ARMv7, we need to set the E bit to force
+ * programs to start as big endian.
+ */
+ tf->tf_spsr = PSR_USR32_MODE | (CPU_IS_ARMV7_P() ? PSR_E_BIT : 0);
+#else
tf->tf_spsr = PSR_USR32_MODE;
+#endif /* __ARMEB__ */
#ifdef THUMB_CODE
if (pack->ep_entry & 1)
tf->tf_spsr |= PSR_T_bit;
#endif
-#endif
+#endif /* __PROG32 */
l->l_md.md_flags = 0;
#ifdef EXEC_AOUT