blob: 037fdf2f3aa139882fa33d42938e83ef94fef314 [file] [log] [blame]
Harry Liebel0f702c62013-12-17 18:19:04 +00001/*-
2 * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
3 * Copyright (c) 1990, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 4. Neither the name of the University nor the names of its contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
31 * From: @(#)types.h 8.3 (Berkeley) 1/5/94
32 * $FreeBSD$
33 */
Soby Mathewc6820d12016-05-09 17:49:55 +010034/*
35 * Portions copyright (c) 2016, ARM Limited and Contributors.
36 * All rights reserved.
37 */
Harry Liebel0f702c62013-12-17 18:19:04 +000038
39#ifndef _MACHINE__TYPES_H_
40#define _MACHINE__TYPES_H_
41
42#ifndef _SYS_CDEFS_H_
43#error this file needs sys/cdefs.h as a prerequisite
44#endif
45
46/*
47 * Basic types upon which most other types are built.
48 */
49typedef __signed char __int8_t;
50typedef unsigned char __uint8_t;
51typedef short __int16_t;
52typedef unsigned short __uint16_t;
53typedef int __int32_t;
54typedef unsigned int __uint32_t;
Soby Mathewc6820d12016-05-09 17:49:55 +010055typedef long long __int64_t;
56typedef unsigned long long __uint64_t;
Harry Liebel0f702c62013-12-17 18:19:04 +000057
58/*
59 * Standard type definitions.
60 */
61typedef __int32_t __clock_t; /* clock()... */
Masahiro Yamadae93a0f42018-02-02 15:09:36 +090062typedef long __critical_t;
Harry Liebel0f702c62013-12-17 18:19:04 +000063typedef double __double_t;
64typedef float __float_t;
Masahiro Yamadae93a0f42018-02-02 15:09:36 +090065typedef long __intfptr_t;
Harry Liebel0f702c62013-12-17 18:19:04 +000066typedef __int64_t __intmax_t;
Masahiro Yamadae93a0f42018-02-02 15:09:36 +090067typedef long __intptr_t;
Harry Liebel0f702c62013-12-17 18:19:04 +000068typedef __int32_t __int_fast8_t;
69typedef __int32_t __int_fast16_t;
70typedef __int32_t __int_fast32_t;
71typedef __int64_t __int_fast64_t;
72typedef __int8_t __int_least8_t;
73typedef __int16_t __int_least16_t;
74typedef __int32_t __int_least32_t;
75typedef __int64_t __int_least64_t;
Masahiro Yamadae93a0f42018-02-02 15:09:36 +090076typedef long __ptrdiff_t; /* ptr1 - ptr2 */
77typedef long __register_t;
78typedef long __segsz_t; /* segment size (in pages) */
79#ifdef AARCH32
80typedef unsigned int __size_t; /* sizeof() */
81typedef int __ssize_t; /* byte count or error */
82#elif defined AARCH64
83typedef unsigned long __size_t; /* sizeof() */
84typedef long __ssize_t; /* byte count or error */
85#else
86#error "Only AArch32 or AArch64 supported"
87#endif /* AARCH32 */
Harry Liebel0f702c62013-12-17 18:19:04 +000088typedef __int64_t __time_t; /* time()... */
Masahiro Yamadae93a0f42018-02-02 15:09:36 +090089typedef unsigned long __uintfptr_t;
Harry Liebel0f702c62013-12-17 18:19:04 +000090typedef __uint64_t __uintmax_t;
Masahiro Yamadae93a0f42018-02-02 15:09:36 +090091typedef unsigned long __uintptr_t;
Harry Liebel0f702c62013-12-17 18:19:04 +000092typedef __uint32_t __uint_fast8_t;
93typedef __uint32_t __uint_fast16_t;
94typedef __uint32_t __uint_fast32_t;
95typedef __uint64_t __uint_fast64_t;
96typedef __uint8_t __uint_least8_t;
97typedef __uint16_t __uint_least16_t;
98typedef __uint32_t __uint_least32_t;
99typedef __uint64_t __uint_least64_t;
Masahiro Yamadae93a0f42018-02-02 15:09:36 +0900100typedef unsigned long __u_register_t;
101typedef unsigned long __vm_offset_t;
Harry Liebel0f702c62013-12-17 18:19:04 +0000102typedef __int64_t __vm_ooffset_t;
Masahiro Yamadae93a0f42018-02-02 15:09:36 +0900103typedef unsigned long __vm_paddr_t;
Harry Liebel0f702c62013-12-17 18:19:04 +0000104typedef __uint64_t __vm_pindex_t;
Masahiro Yamadae93a0f42018-02-02 15:09:36 +0900105typedef unsigned long __vm_size_t;
Harry Liebel0f702c62013-12-17 18:19:04 +0000106
107/*
108 * Unusual type definitions.
109 */
110#ifdef __GNUCLIKE_BUILTIN_VARARGS
111typedef __builtin_va_list __va_list; /* internally known to gcc */
112#else
113typedef char * __va_list;
114#endif /* __GNUCLIKE_BUILTIN_VARARGS */
115#if defined(__GNUCLIKE_BUILTIN_VAALIST) && !defined(__GNUC_VA_LIST) \
116 && !defined(__NO_GNUC_VA_LIST)
117#define __GNUC_VA_LIST
118typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
119#endif
120
121#endif /* !_MACHINE__TYPES_H_ */