Author: ngie
Date: Thu Jan 19 17:03:45 2017
New Revision: 312418
URL: https://svnweb.freebsd.org/changeset/base/312418

Log:
  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
  
  MFC after:    3 weeks
  Reviewed by:  sephe
  Sponsored by: Dell EMC Isilon
  Differential Revision:        https://reviews.freebsd.org/D9242

Modified:
  head/lib/libc/x86/sys/Makefile.inc
  head/lib/libc/x86/sys/__vdso_gettc.c

Modified: head/lib/libc/x86/sys/Makefile.inc
==============================================================================
--- head/lib/libc/x86/sys/Makefile.inc  Thu Jan 19 16:59:55 2017        
(r312417)
+++ head/lib/libc/x86/sys/Makefile.inc  Thu Jan 19 17:03:45 2017        
(r312418)
@@ -4,3 +4,7 @@
 
 SRCS+= \
        __vdso_gettc.c
+
+.if ${MK_HYPERV} != "no"
+CFLAGS+=       -DWANT_HYPERV
+.endif

Modified: head/lib/libc/x86/sys/__vdso_gettc.c
==============================================================================
--- head/lib/libc/x86/sys/__vdso_gettc.c        Thu Jan 19 16:59:55 2017        
(r312417)
+++ head/lib/libc/x86/sys/__vdso_gettc.c        Thu Jan 19 17:03:45 2017        
(r312418)
@@ -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 *
        return (ENOSYS);
 }
 
-#endif /* __amd64__ */
+#endif /* WANT_HYPERV */
 
 #pragma weak __vdso_gettc
 int
@@ -246,7 +246,7 @@ __vdso_gettc(const struct vdso_timehands
                        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();
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to