git: 3222cb7d213c - stable/14 - sys/abi_compat.h: move freebsd32_uint64_t and FU64_CP() there

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Sun, 12 Apr 2026 05:57:08 UTC
The branch stable/14 has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=3222cb7d213c05787e6a3db0f73caa5778e6ec4a

commit 3222cb7d213c05787e6a3db0f73caa5778e6ec4a
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-02-05 19:08:06 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-04-12 05:56:45 +0000

    sys/abi_compat.h: move freebsd32_uint64_t and FU64_CP() there
    
    Use private names for uintXX_t types.
    Remove conflicting (but equal) PTR_IN() definition from dev/mfi.c.
    
    Reviewed by:    brooks
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D55135
    
    (cherry picked from commit e651c64bcab08c7b12d8ad6e3ad0b1ef3af3b875)
---
 sys/compat/freebsd32/freebsd32.h | 18 ------------------
 sys/dev/mfi/mfi.c                |  2 --
 sys/sys/abi_compat.h             | 22 +++++++++++++++++++++-
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h
index b5671611c1eb..b8cd29e5238f 100644
--- a/sys/compat/freebsd32/freebsd32.h
+++ b/sys/compat/freebsd32/freebsd32.h
@@ -35,24 +35,6 @@
 #include <sys/user.h>
 #include <sys/_ffcounter.h>
 
-/*
- * i386 is the only arch with a 32-bit time_t.
- * Also it is the only arch with (u)int64_t having 4-bytes alignment.
- */
-typedef struct {
-#ifdef __amd64__
-	uint32_t val[2];
-#else
-	uint64_t val;
-#endif
-} freebsd32_uint64_t;
-
-#ifdef __amd64__
-typedef	int32_t	time32_t;
-#else
-typedef	int64_t	time32_t;
-#endif
-
 struct timeval32 {
 	time32_t tv_sec;
 	int32_t tv_usec;
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index cd84e0a1970b..af88085116c1 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -3082,8 +3082,6 @@ out:
 	return (error);
 }
 
-#define	PTRIN(p)		((void *)(uintptr_t)(p))
-
 static int
 mfi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
 {
diff --git a/sys/sys/abi_compat.h b/sys/sys/abi_compat.h
index 2fcf598ceb7f..1753d8dd25c2 100644
--- a/sys/sys/abi_compat.h
+++ b/sys/sys/abi_compat.h
@@ -29,10 +29,30 @@
 #ifndef _ABI_COMPAT_H_
 #define	_ABI_COMPAT_H_
 
+#include <sys/_types.h>
+
 /*
- * Helper macros for translating objects between different ABIs.
+ * Helper types and macros for translating objects between different ABIs.
  */
 
+/*
+ * i386 is the only arch with a 32-bit time_t.
+ * Also it is the only arch with (u)int64_t having 4-bytes alignment.
+ */
+typedef struct {
+#ifdef __amd64__
+	__uint32_t val[2];
+#else
+	__uint64_t val;
+#endif
+} freebsd32_uint64_t;
+
+#ifdef __amd64__
+typedef	__int32_t	time32_t;
+#else
+typedef	__int64_t	time32_t;
+#endif
+
 #define	PTRIN(v)	(void *)(uintptr_t)(v)
 #define	PTROUT(v)	(uintptr_t)(v)