xref: /freebsd/sys/sys/abi_types.h (revision 94323513dd5070bf1fc3c191c560bd7e17da8931)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright 2026 The FreeBSD Foundation
5  *
6  * Portions of this software were developed by Konstantin Belousov
7  * under sponsorship from the FreeBSD Foundation.
8  *
9  */
10 
11 #ifndef _ABI_TYPES_H_
12 #define	_ABI_TYPES_H_
13 
14 #include <sys/_types.h>
15 
16 /*
17  * i386 is the only arch with a 32-bit time_t.
18  * Also it is the only arch with (u)int64_t having 4-bytes alignment.
19  */
20 typedef struct {
21 #ifdef __amd64__
22 	__uint32_t val[2];
23 #else
24 	__uint64_t val;
25 #endif
26 } freebsd32_uint64_t;
27 
28 #if defined(__amd64__) || defined(__i386__)
29 typedef	__int32_t	time32_t;
30 #define	__SIZEOF_TIME32_T	__SIZEOF_INT32_T
31 #else
32 typedef	__int64_t	time32_t;
33 #define	__SIZEOF_TIME32_T	__SIZEOF_INT64_T
34 #endif
35 #define	__HAVE_TIME32_T
36 
37 #endif
38