svn commit: r366058 - head/usr.sbin/ntp
Brandon Bergren
bdragon at FreeBSD.org
Wed Sep 23 02:37:27 UTC 2020
Author: bdragon
Date: Wed Sep 23 02:37:27 2020
New Revision: 366058
URL: https://svnweb.freebsd.org/changeset/base/366058
Log:
[PowerPC] Fix multiple ntp configuration issues
* powerpc time_t is 64 bit, not 32 bit.
* Add definition for powerpc64le.
With this, powerpc64le ntpd and ntpdate operate correctly instead of
corrupting the clock and exiting.
Tested on powerpc64, powerpc64le, and powerpc.
No feedback from cy at .
I am a bit confused as to how SIZEOF_TIME_T being wrong ever worked on
powerpc, it being big endian and all.
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D26379
Modified:
head/usr.sbin/ntp/config.h
Modified: head/usr.sbin/ntp/config.h
==============================================================================
--- head/usr.sbin/ntp/config.h Wed Sep 23 02:28:19 2020 (r366057)
+++ head/usr.sbin/ntp/config.h Wed Sep 23 02:37:27 2020 (r366058)
@@ -1548,7 +1548,7 @@
#define SIZEOF_SIGNED_CHAR 1
/* The size of `time_t', as computed by sizeof. */
-#if defined(__i386__) || defined(__powerpc__)
+#if defined(__i386__)
#define SIZEOF_TIME_T 4
#else
#define SIZEOF_TIME_T 8
@@ -1580,6 +1580,8 @@
/* canonical system (cpu-vendor-os) of where we should run */
#if defined(__amd64__)
#define STR_SYSTEM "amd64-undermydesk-freebsd"
+#elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define STR_SYSTEM "powerpc64le-undermydesk-freebsd"
#elif defined(__powerpc64__)
#define STR_SYSTEM "powerpc64-undermydesk-freebsd"
#elif defined(__powerpc__)
@@ -1660,8 +1662,8 @@ typedef unsigned int uintptr_t;
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined(__ARMEB__) || defined(__MIPSEB__) || defined(__powerpc__) || \
- defined(__powerpc64__)
+#if defined(__ARMEB__) || defined(__MIPSEB__) || \
+ (defined(__powerpc__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
#define WORDS_BIGENDIAN 1
#endif
More information about the svn-src-all
mailing list