xref: /minix/sys/arch/arm/include/int_types.h (revision 0a6a1f1d)
1 /*	$NetBSD: int_types.h,v 1.17 2014/07/25 21:43:13 joerg Exp $	*/
2 
3 /*-
4  * Copyright (c) 2014 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to The NetBSD Foundation
8  * by Matt Thomas of 3am Software Foundry.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef _ARM_INT_TYPES_H_
33 #define _ARM_INT_TYPES_H_
34 
35 #ifdef __UINTPTR_TYPE__
36 #include <sys/common_int_types.h>
37 #else
38 #include <sys/cdefs.h>
39 
40 /*
41  * 7.18.1 Integer types
42  */
43 
44 /* 7.18.1.1 Exact-width integer types */
45 
46 #ifndef __UINT8_TYPE__
47 # define __UINT8_TYPE__		unsigned char
48 #endif
49 #ifndef __INT8_TYPE__
50 # define __INT8_TYPE__		signed char
51 #endif
52 #ifndef __UINT16_TYPE__
53 # ifndef __INT16_TYPE__
54 #  define __INT16_TYPE__	short int
55 # endif
56 # define __UINT16_TYPE__	unsigned __INT16_TYPE__
57 #endif
58 #ifndef __UINT32_TYPE__
59 # ifndef __INT32_TYPE__
60 #  define __INT32_TYPE__	int
61 # endif
62 # define __UINT32_TYPE__	unsigned __INT32_TYPE__
63 #endif
64 #ifndef __UINT64_TYPE__
65 # ifndef __INT64_TYPE__
66 #  define __INT64_TYPE__	long long int
67 # endif
68 # define __UINT64_TYPE__	unsigned __INT64_TYPE__
69 #endif
70 
71 #ifdef __clang__
72 typedef	signed __INT8_TYPE__	   __int8_t;
73 #else
74 typedef	__INT8_TYPE__		   __int8_t;
75 #endif
76 typedef	__UINT8_TYPE__		  __uint8_t;
77 typedef	__INT16_TYPE__		  __int16_t;
78 typedef	__UINT16_TYPE__		 __uint16_t;
79 typedef	__INT32_TYPE__		  __int32_t;
80 typedef	__UINT32_TYPE__		 __uint32_t;
81 typedef	__INT64_TYPE__		  __int64_t;
82 typedef	__UINT64_TYPE__		 __uint64_t;
83 
84 #if !defined(__minix)
85 #define	__BIT_TYPES_DEFINED__
86 #endif /* !defined(__minix) */
87 
88 /* 7.18.1.4 Integer types capable of holding object pointers */
89 
90 #ifndef __UINTPTR_TYPE__
91 # ifndef __INTPTR_TYPE__
92 #  define __INTPTR_TYPE__	long int
93 # endif
94 # define __UINTPTR_TYPE__	unsigned __INTPTR_TYPE__
95 #endif
96 
97 typedef	__INTPTR_TYPE__		 __intptr_t;
98 typedef	__UINTPTR_TYPE__	__uintptr_t;
99 #endif
100 
101 #endif	/* !_ARM_INT_TYPES_H_ */
102