sys/abi_types.h: time32_t is 64-bit on non-x86 architectures
As long as 'sys/compat/freebsd32/freebsd32.h' is used unconditionally on all platforms (in 'kern_umtx.c' at least), the rule of thumb is to ensure that 'struct foo32' on a 32-bit arch is type-compatible with 'struct foo' on the same arch. In practice, this is very simple to achieve: All 'foo32' types should be compatible with 'foo' on 32-bit architectures, which is what we are supposed to do already for compat' structures by design. The recently introduced 'freebsd32_uint64_t' type typically supports that. This change fixes commit87632ddf67("openzfs sys/types32.h: use abi_compat.h for time32_t") which was defining 'time32_t' to 'in32_t' for all 32-bit architectures, which is wrong but on i386. By luck, this did not change the size of whole 'struct ffclock_estimate32' (whose size is compile-time asserted) because 'struct bintime32''s one would stay the same, as even if its field 'sec' was incorrectly sized after that commit, the 'frac' one is 64-bit and 64-bit aligned on all non-x86 architectures so its offset in 'struct bintime32' would stay the same. Reviewed by: kib Fixes:87632ddf67("openzfs sys/types32.h: use abi_compat.h for time32_t") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55283
This commit is contained in:
+1
-5
@@ -25,15 +25,11 @@ typedef struct {
|
||||
#endif
|
||||
} freebsd32_uint64_t;
|
||||
|
||||
#if __SIZEOF_LONG__ == 8
|
||||
#if defined __amd64__
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
typedef __int32_t time32_t;
|
||||
#else
|
||||
typedef __int64_t time32_t;
|
||||
#endif
|
||||
#else
|
||||
typedef __int32_t time32_t;
|
||||
#endif
|
||||
#define __HAVE_TIME32_T
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user