summaryrefslogtreecommitdiffstats
path: root/lib/libc/x86
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-02-10 07:38:39 +0000
committerngie <ngie@FreeBSD.org>2017-02-10 07:38:39 +0000
commit181e40978c4f96b2e5eb08655eb299db298eeac8 (patch)
tree887057bf4fd4109a281994025ebc3b9445933ea9 /lib/libc/x86
parent0d4e3d76af6dae0df115d1e23238a6e9d6438561 (diff)
downloadFreeBSD-src-181e40978c4f96b2e5eb08655eb299db298eeac8.zip
FreeBSD-src-181e40978c4f96b2e5eb08655eb299db298eeac8.tar.gz
MFC r312418,r312422:
r312418: Conditionalize hyperv support in gettimeofday(2) based on MK_HYPERV The effect at runtime is negligible as the hyperv timer isn't available except when hyperv is loaded. This is a prerequisite for conditionalizing the header build/install out of the build r312422: Only conditionally add in hyperv support if we're building amd64 This unbreaks the build because the assembly is written for x64. Pointyhat to: ngie
Diffstat (limited to 'lib/libc/x86')
-rw-r--r--lib/libc/x86/sys/Makefile.inc4
-rw-r--r--lib/libc/x86/sys/__vdso_gettc.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/libc/x86/sys/Makefile.inc b/lib/libc/x86/sys/Makefile.inc
index c00a217..0e8026a 100644
--- a/lib/libc/x86/sys/Makefile.inc
+++ b/lib/libc/x86/sys/Makefile.inc
@@ -4,3 +4,7 @@
SRCS+= \
__vdso_gettc.c
+
+.if ${MACHINE_CPUARCH} == "amd64" && ${MK_HYPERV} != "no"
+CFLAGS+= -DWANT_HYPERV
+.endif
diff --git a/lib/libc/x86/sys/__vdso_gettc.c b/lib/libc/x86/sys/__vdso_gettc.c
index 723db6e..bf46a10 100644
--- a/lib/libc/x86/sys/__vdso_gettc.c
+++ b/lib/libc/x86/sys/__vdso_gettc.c
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
#include <machine/cpufunc.h>
#include <machine/specialreg.h>
#include <dev/acpica/acpi_hpet.h>
-#ifdef __amd64__
+#ifdef WANT_HYPERV
#include <dev/hyperv/hyperv.h>
#endif
#include "libc_private.h"
@@ -158,7 +158,7 @@ __vdso_init_hpet(uint32_t u)
munmap((void *)new_map, PAGE_SIZE);
}
-#ifdef __amd64__
+#ifdef WANT_HYPERV
#define HYPERV_REFTSC_DEVPATH "/dev/" HYPERV_REFTSC_DEVNAME
@@ -217,7 +217,7 @@ __vdso_hyperv_tsc(struct hyperv_reftsc *tsc_ref, u_int *tc)
return (ENOSYS);
}
-#endif /* __amd64__ */
+#endif /* WANT_HYPERV */
#pragma weak __vdso_gettc
int
@@ -246,7 +246,7 @@ __vdso_gettc(const struct vdso_timehands *th, u_int *tc)
return (ENOSYS);
*tc = *(volatile uint32_t *)(map + HPET_MAIN_COUNTER);
return (0);
-#ifdef __amd64__
+#ifdef WANT_HYPERV
case VDSO_TH_ALGO_X86_HVTSC:
if (hyperv_ref_tsc == NULL)
__vdso_init_hyperv_tsc();
OpenPOWER on IntegriCloud