svn commit: r320347 - in head: . share/man/man7 sys/compat/freebsd32 sys/net sys/powerpc/include sys/sys
Justin Hibbits
jhibbits at FreeBSD.org
Mon Jun 26 02:25:21 UTC 2017
Author: jhibbits
Date: Mon Jun 26 02:25:19 2017
New Revision: 320347
URL: https://svnweb.freebsd.org/changeset/base/320347
Log:
Solve the y2038 problem for powerpc
AKA Make time_t 64 bits on powerpc(32).
PowerPC currently (until now) was one of two architectures with a 32-bit time_t
on 32-bit archs (the other being i386). This is an ABI breakage, so all ports,
and all local binaries, *must* be recompiled.
Tested by: andreast, others
MFC after: Never
Relnotes: Yes
Modified:
head/UPDATING
head/share/man/man7/arch.7
head/sys/compat/freebsd32/freebsd32.h
head/sys/compat/freebsd32/freebsd32_misc.c
head/sys/net/bpf.c
head/sys/powerpc/include/_types.h
head/sys/powerpc/include/proc.h
head/sys/sys/acct.h
head/sys/sys/param.h
Modified: head/UPDATING
==============================================================================
--- head/UPDATING Mon Jun 26 02:00:22 2017 (r320346)
+++ head/UPDATING Mon Jun 26 02:25:19 2017 (r320347)
@@ -51,6 +51,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
****************************** SPECIAL WARNING: ******************************
+20170625:
+ The FreeBSD/powerpc platform now uses a 64-bit type for time_t. This is
+ a very major ABI incompatible change, so users of FreeBSD/powerpc must
+ be careful when performing source upgrades. It is best to run
+ 'make installworld' from an alternate root system, either a live
+ CD/memory stick, or a temporary root partition. Additionally, all ports
+ must be recompiled. powerpc64 is largely unaffected, except in the case
+ of 32-bit compatibility. All 32-bit binaries will be affected.
+
20170623:
Forward compatibility for the "ino64" project have been committed. This
will allow most new binaries to run on older kernels in a limited
Modified: head/share/man/man7/arch.7
==============================================================================
--- head/share/man/man7/arch.7 Mon Jun 26 02:00:22 2017 (r320346)
+++ head/share/man/man7/arch.7 Mon Jun 26 02:25:19 2017 (r320347)
@@ -203,8 +203,8 @@ Machine-dependent type sizes:
.It mips64el Ta 8 Ta 8 Ta 8
.It mips64elhf Ta 8 Ta 8 Ta 8
.It mips64hf Ta 8 Ta 8 Ta 8
-.It powerpc Ta 4 Ta 8 Ta 4
-.It powerpcspe Ta 4 Ta 8 Ta 4
+.It powerpc Ta 4 Ta 8 Ta 8
+.It powerpcspe Ta 4 Ta 8 Ta 8
.It powerpc64 Ta 8 Ta 8 Ta 8
.It riscv64 Ta 8 Ta 16 Ta 8
.It riscv64sf Ta 8 Ta 16 Ta 8
Modified: head/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32.h Mon Jun 26 02:00:22 2017 (r320346)
+++ head/sys/compat/freebsd32/freebsd32.h Mon Jun 26 02:25:19 2017 (r320347)
@@ -45,7 +45,7 @@
/*
* Being a newer port, 32-bit FreeBSD/MIPS uses 64-bit time_t.
*/
-#ifdef __mips__
+#if defined (__mips__) || defined(__powerpc__)
typedef int64_t time32_t;
#else
typedef int32_t time32_t;
Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c Mon Jun 26 02:00:22 2017 (r320346)
+++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Jun 26 02:25:19 2017 (r320347)
@@ -109,13 +109,13 @@ __FBSDID("$FreeBSD$");
FEATURE(compat_freebsd_32bit, "Compatible with 32-bit FreeBSD");
-#ifndef __mips__
+#if !defined(__mips__) && !defined(__powerpc__)
CTASSERT(sizeof(struct timeval32) == 8);
CTASSERT(sizeof(struct timespec32) == 8);
CTASSERT(sizeof(struct itimerval32) == 16);
#endif
CTASSERT(sizeof(struct statfs32) == 256);
-#ifndef __mips__
+#if !defined(__mips__) && !defined(__powerpc__)
CTASSERT(sizeof(struct rusage32) == 72);
#endif
CTASSERT(sizeof(struct sigaltstack32) == 12);
@@ -125,7 +125,7 @@ CTASSERT(sizeof(struct msghdr32) == 28);
#ifdef __amd64__
CTASSERT(sizeof(struct stat32) == 208);
#endif
-#ifndef __mips__
+#if !defined(__mips__) && !defined(__powerpc__)
CTASSERT(sizeof(struct freebsd11_stat32) == 96);
#endif
CTASSERT(sizeof(struct sigaction32) == 24);
Modified: head/sys/net/bpf.c
==============================================================================
--- head/sys/net/bpf.c Mon Jun 26 02:00:22 2017 (r320346)
+++ head/sys/net/bpf.c Mon Jun 26 02:25:19 2017 (r320347)
@@ -1283,7 +1283,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i
#endif
case BIOCGETIF:
case BIOCGRTIMEOUT:
-#if defined(COMPAT_FREEBSD32) && !defined(__mips__)
+#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
case BIOCGRTIMEOUT32:
#endif
case BIOCGSTATS:
@@ -1295,7 +1295,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i
case FIONREAD:
case BIOCLOCK:
case BIOCSRTIMEOUT:
-#if defined(COMPAT_FREEBSD32) && !defined(__mips__)
+#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
case BIOCSRTIMEOUT32:
#endif
case BIOCIMMEDIATE:
@@ -1519,7 +1519,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i
* Set read timeout.
*/
case BIOCSRTIMEOUT:
-#if defined(COMPAT_FREEBSD32) && !defined(__mips__)
+#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
case BIOCSRTIMEOUT32:
#endif
{
@@ -1550,12 +1550,12 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i
* Get read timeout.
*/
case BIOCGRTIMEOUT:
-#if defined(COMPAT_FREEBSD32) && !defined(__mips__)
+#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
case BIOCGRTIMEOUT32:
#endif
{
struct timeval *tv;
-#if defined(COMPAT_FREEBSD32) && !defined(__mips__)
+#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
struct timeval32 *tv32;
struct timeval tv64;
@@ -1567,7 +1567,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i
tv->tv_sec = d->bd_rtout / hz;
tv->tv_usec = (d->bd_rtout % hz) * tick;
-#if defined(COMPAT_FREEBSD32) && !defined(__mips__)
+#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__)
if (cmd == BIOCGRTIMEOUT32) {
tv32 = (struct timeval32 *)addr;
tv32->tv_sec = tv->tv_sec;
Modified: head/sys/powerpc/include/_types.h
==============================================================================
--- head/sys/powerpc/include/_types.h Mon Jun 26 02:00:22 2017 (r320346)
+++ head/sys/powerpc/include/_types.h Mon Jun 26 02:25:19 2017 (r320347)
@@ -98,16 +98,18 @@ typedef __int64_t __register_t;
typedef __int64_t __segsz_t; /* segment size (in pages) */
typedef __uint64_t __size_t; /* sizeof() */
typedef __int64_t __ssize_t; /* byte count or error */
-typedef __int64_t __time_t; /* time()... */
-typedef __uint64_t __uintfptr_t;
-typedef __uint64_t __uintptr_t;
#else
typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */
typedef __int32_t __register_t;
typedef __int32_t __segsz_t; /* segment size (in pages) */
typedef __uint32_t __size_t; /* sizeof() */
typedef __int32_t __ssize_t; /* byte count or error */
-typedef __int32_t __time_t; /* time()... */
+#endif
+typedef __int64_t __time_t; /* time()... */
+#ifdef __LP64__
+typedef __uint64_t __uintfptr_t;
+typedef __uint64_t __uintptr_t;
+#else
typedef __uint32_t __uintfptr_t;
typedef __uint32_t __uintptr_t;
#endif
Modified: head/sys/powerpc/include/proc.h
==============================================================================
--- head/sys/powerpc/include/proc.h Mon Jun 26 02:00:22 2017 (r320346)
+++ head/sys/powerpc/include/proc.h Mon Jun 26 02:25:19 2017 (r320347)
@@ -48,9 +48,9 @@ struct mdproc {
#ifdef __powerpc64__
#define KINFO_PROC_SIZE 1088
-#define KINFO_PROC32_SIZE 768
+#define KINFO_PROC32_SIZE 816
#else
-#define KINFO_PROC_SIZE 768
+#define KINFO_PROC_SIZE 816
#endif
struct syscall_args {
Modified: head/sys/sys/acct.h
==============================================================================
--- head/sys/sys/acct.h Mon Jun 26 02:00:22 2017 (r320346)
+++ head/sys/sys/acct.h Mon Jun 26 02:25:19 2017 (r320347)
@@ -66,9 +66,6 @@ struct acctv3 {
float ac_io; /* count of IO blocks */
__dev_t ac_tty; /* controlling tty */
uint32_t ac_pad0;
-#if defined(__powerpc__) && !defined(_LP64)
- uint32_t ac_pad1;
-#endif
uint16_t ac_len2; /* record length */
union {
uint32_t ac_align; /* force v1 compatible alignment */
Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h Mon Jun 26 02:00:22 2017 (r320346)
+++ head/sys/sys/param.h Mon Jun 26 02:25:19 2017 (r320347)
@@ -58,7 +58,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1200035 /* Master, propagated to newvers */
+#define __FreeBSD_version 1200036 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
More information about the svn-src-all
mailing list