Read the right register for checking big endianess.

This commit is contained in:
matt 2013-10-22 21:37:33 +00:00
parent 738c9dbd7c
commit 37432b7ef6

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu_exec.c,v 1.6 2013/10/21 20:05:50 joerg Exp $ */
/* $NetBSD: cpu_exec.c,v 1.7 2013/10/22 21:37:33 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.6 2013/10/21 20:05:50 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.7 2013/10/22 21:37:33 matt Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_netbsd32.h"
@ -75,9 +75,8 @@ arm_netbsd_elf32_probe(struct lwp *l, struct exec_package *epp, void *eh0,
* If the BE-8 model is supported, CPSR[7] will be clear.
* If the BE-32 model is supported, CPSR[7] will be set.
*/
register_t cpsr;
__asm("mrs\t%0, cpsr" : "=r"(cpsr));
if ((cpsr & CPU_CONTROL_BEND_ENABLE) == be8_p)
register_t ctl = armreg_sctrl_read();
if (((ctl & CPU_CONTROL_BEND_ENABLE) != 0) == be8_p)
return ENOEXEC;
#endif /* __ARMEB__ */