svn commit: r365428 - head/sys/sys
Brandon Bergren
bdragon at FreeBSD.org
Mon Sep 7 20:05:19 UTC 2020
Author: bdragon
Date: Mon Sep 7 20:05:18 2020
New Revision: 365428
URL: https://svnweb.freebsd.org/changeset/base/365428
Log:
Fix vdso compat32 timekeeping on !=x86.
Since x86 is the only 32-bit arch that has a 32-bit time_t, adjust the
private bintime32 struct in vdso to only use a 32 bit sec on amd64.
This matches the existing behavior in the compat code.
Noticed while implementing vdso timekeeping on powerpc.
This should also theoretically fix vdso timekeeping for arm binaries on
aarch64.
See tools attached to https://reviews.freebsd.org/D26347 for testing.
Reviewed by: kib (in irc)
Sponsored by: Tag1 Consulting, Inc.
Modified:
head/sys/sys/vdso.h
Modified: head/sys/sys/vdso.h
==============================================================================
--- head/sys/sys/vdso.h Mon Sep 7 19:35:30 2020 (r365427)
+++ head/sys/sys/vdso.h Mon Sep 7 20:05:18 2020 (r365428)
@@ -102,8 +102,16 @@ struct vdso_sv_tk *alloc_sv_tk(void);
#define VDSO_TH_NUM 4
#ifdef COMPAT_FREEBSD32
+
+/*
+ * i386 is the only arch with a 32 bit time_t.
+ */
struct bintime32 {
+#if defined(__amd64__)
uint32_t sec;
+#else
+ uint64_t sec;
+#endif
uint32_t frac[2];
};
More information about the svn-src-all
mailing list