xref: /openbsd/sys/lib/libkern/crt_glue.h (revision 49f00df6)
1 /* ===-- int_lib.h - configuration header for compiler-rt  -----------------===
2  *
3  *                     The LLVM Compiler Infrastructure
4  *
5  * This file is dual licensed under the MIT and the University of Illinois Open
6  * Source Licenses. See LICENSE.TXT for details.
7  *
8  * ===----------------------------------------------------------------------===
9  *
10  * This file is a compat header for compiler-rt source files used in the OpenBSD
11  * kernel.
12  * This file is not part of the interface of this library.
13  *
14  * ===----------------------------------------------------------------------===
15  */
16 
17 #ifndef _CRT_INT_LIB_H_
18 #define  _CRT_INT_LIB_H_
19 
20 #include <sys/limits.h>
21 #include <sys/endian.h>
22 
23 typedef int      si_int;
24 typedef unsigned int su_int;
25 typedef          long long di_int;
26 typedef unsigned long long du_int;
27 typedef int      ti_int __attribute__ ((mode (TI)));
28 typedef int      tu_int __attribute__ ((mode (TI)));
29 
30 #if BYTE_ORDER == LITTLE_ENDIAN
31 #define _YUGA_LITTLE_ENDIAN 0
32 #else
33 #define _YUGA_LITTLE_ENDIAN 1
34 #endif
35 
36 typedef union
37 {
38     ti_int all;
39     struct
40     {
41 #if _YUGA_LITTLE_ENDIAN
42         du_int low;
43         di_int high;
44 #else
45         di_int high;
46         du_int low;
47 #endif /* _YUGA_LITTLE_ENDIAN */
48     }s;
49 } twords;
50 
51 typedef union
52 {
53 	tu_int all;
54 	struct
55 	{
56 #if _YUGA_LITTLE_ENDIAN
57 		du_int low;
58 		du_int high;
59 #else
60 		du_int high;
61 		du_int low;
62 #endif /* _YUGA_LITTLE_ENDIAN */
63 	}s;
64 } utwords;
65 
66 #endif /* _CRT_INT_LIB_H_ */
67