summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-12-24 22:13:52 +0000
committerkib <kib@FreeBSD.org>2015-12-24 22:13:52 +0000
commit7659430654c39cefae155e06694de445d37cd1dd (patch)
treea34724aa323508052d36c4a9a116c16e0e954801 /lib/libc
parente66e064c45687b5d294565dbd829b419848f7992 (diff)
downloadFreeBSD-src-7659430654c39cefae155e06694de445d37cd1dd.zip
FreeBSD-src-7659430654c39cefae155e06694de445d37cd1dd.tar.gz
Do not compile ARMv6 instructions on ARMv4/v5. Although clang is fine
with mrrc, gcc is not. The disabled code is not executed on ARMv4 anyway. Reported and reviewed by: ian Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/arm/sys/__vdso_gettc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libc/arm/sys/__vdso_gettc.c b/lib/libc/arm/sys/__vdso_gettc.c
index d75d866..1f43e72 100644
--- a/lib/libc/arm/sys/__vdso_gettc.c
+++ b/lib/libc/arm/sys/__vdso_gettc.c
@@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <sys/vdso.h>
#include <machine/cpufunc.h>
+#include <machine/acle-compat.h>
#include "libc_private.h"
+#if __ARM_ARCH >= 6
static inline uint64_t
cp15_cntvct_get(void)
{
@@ -53,6 +55,7 @@ cp15_cntpct_get(void)
__asm __volatile("mrrc\tp15, 0, %Q0, %R0, c14" : "=r" (reg));
return (reg);
}
+#endif
#pragma weak __vdso_gettc
u_int
@@ -60,6 +63,7 @@ __vdso_gettc(const struct vdso_timehands *th)
{
uint64_t val;
+#if __ARM_ARCH >= 6
/*
* Userspace gettimeofday() is only enabled on ARMv7 CPUs, but
* libc is compiled for ARMv6. Due to clang issues, .arch
@@ -67,6 +71,9 @@ __vdso_gettc(const struct vdso_timehands *th)
*/
__asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */
val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get();
+#else
+ val = 0;
+#endif
return (val);
}
OpenPOWER on IntegriCloud