Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Dec 2015 22:13:52 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r292709 - head/lib/libc/arm/sys
Message-ID:  <201512242213.tBOMDqRW026085@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Dec 24 22:13:52 2015
New Revision: 292709
URL: https://svnweb.freebsd.org/changeset/base/292709

Log:
  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

Modified:
  head/lib/libc/arm/sys/__vdso_gettc.c

Modified: head/lib/libc/arm/sys/__vdso_gettc.c
==============================================================================
--- head/lib/libc/arm/sys/__vdso_gettc.c	Thu Dec 24 20:19:49 2015	(r292708)
+++ head/lib/libc/arm/sys/__vdso_gettc.c	Thu Dec 24 22:13:52 2015	(r292709)
@@ -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
 {
 	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
 	 */
 	__asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */
 	val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get();
+#else
+	val = 0;
+#endif
 	return (val);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512242213.tBOMDqRW026085>