Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Jun 2017 23:45:52 -0500
From:      Justin Hibbits <jhibbits@freebsd.org>
To:        ppc@freebsd.org
Subject:   64-bit time_t on 32-bit powerpc
Message-ID:  <CAHSQbTC9UgCnpbpMj5dukY%2BGMwOpDy5FQACHGmb8EmU%2BdyQOuw@mail.gmail.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
Calling all powerpc(32) users,

Attached is a patch which changes the size of time_t from 32-bit to 64-bit
on powerpc.  ARM and MIPS already use 64-bit time_t, the only other holdout
is i386, which cannot be changed.  I want to get this in soon so there's
plenty of soak time before 12 is branched.  It works well enough for my
cases, but I want others to poke, prod, and try to break it.  Especially
try your favorite ports builds, and make sure things still a) build, and b)
work as expected.

Almost forgot, too... With powerpc64 users, the compat32 has been updated
as well, obviously.  So, some testing of that is needed, too.

- Justin

[-- Attachment #2 --]
Index: sys/powerpc/include/_types.h
===================================================================
--- sys/powerpc/include/_types.h	(revision 318789)
+++ sys/powerpc/include/_types.h	(working copy)
@@ -98,9 +98,6 @@
 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;
@@ -107,7 +104,12 @@
 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
Index: sys/powerpc/include/proc.h
===================================================================
--- sys/powerpc/include/proc.h	(revision 318789)
+++ sys/powerpc/include/proc.h	(working copy)
@@ -48,9 +48,9 @@
 
 #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
 
 #ifdef _KERNEL
Index: sys/sys/acct.h
===================================================================
--- sys/sys/acct.h	(revision 318789)
+++ sys/sys/acct.h	(working copy)
@@ -66,9 +66,6 @@
 	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 */
Index: sys/compat/freebsd32/freebsd32.h
===================================================================
--- sys/compat/freebsd32/freebsd32.h	(revision 318789)
+++ sys/compat/freebsd32/freebsd32.h	(working copy)
@@ -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;
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHSQbTC9UgCnpbpMj5dukY%2BGMwOpDy5FQACHGmb8EmU%2BdyQOuw>