_types.h revision 1.14
1/*	$OpenBSD: _types.h,v 1.14 2011/09/08 02:47:13 guenther Exp $	*/
2
3/*-
4 * Copyright (c) 1990, 1993
5 *	The Regents of the University of California.  All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 *    may be used to endorse or promote products derived from this software
17 *    without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 *	@(#)types.h	8.3 (Berkeley) 1/5/94
32 *	@(#)ansi.h	8.2 (Berkeley) 1/4/94
33 */
34
35#ifndef _MACHINE__TYPES_H_
36#define _MACHINE__TYPES_H_
37
38#if defined(_KERNEL)
39typedef struct label_t {
40	long val[10];
41} label_t;
42#endif
43
44/* 7.18.1.1 Exact-width integer types */
45typedef	__signed char		__int8_t;
46typedef	unsigned char		__uint8_t;
47typedef	short			__int16_t;
48typedef	unsigned short		__uint16_t;
49typedef	int			__int32_t;
50typedef	unsigned int		__uint32_t;
51/* LONGLONG */
52typedef	long long		__int64_t;
53/* LONGLONG */
54typedef	unsigned long long	__uint64_t;
55
56/* 7.18.1.2 Minimum-width integer types */
57typedef	__int8_t		__int_least8_t;
58typedef	__uint8_t		__uint_least8_t;
59typedef	__int16_t		__int_least16_t;
60typedef	__uint16_t		__uint_least16_t;
61typedef	__int32_t		__int_least32_t;
62typedef	__uint32_t		__uint_least32_t;
63typedef	__int64_t		__int_least64_t;
64typedef	__uint64_t		__uint_least64_t;
65
66/* 7.18.1.3 Fastest minimum-width integer types */
67typedef	__int32_t		__int_fast8_t;
68typedef	__uint32_t		__uint_fast8_t;
69typedef	__int32_t		__int_fast16_t;
70typedef	__uint32_t		__uint_fast16_t;
71typedef	__int32_t		__int_fast32_t;
72typedef	__uint32_t		__uint_fast32_t;
73typedef	__int64_t		__int_fast64_t;
74typedef	__uint64_t		__uint_fast64_t;
75#define	__INT_FAST8_MIN		INT32_MIN
76#define	__INT_FAST16_MIN	INT32_MIN
77#define	__INT_FAST32_MIN	INT32_MIN
78#define	__INT_FAST64_MIN	INT64_MIN
79#define	__INT_FAST8_MAX		INT32_MAX
80#define	__INT_FAST16_MAX	INT32_MAX
81#define	__INT_FAST32_MAX	INT32_MAX
82#define	__INT_FAST64_MAX	INT64_MAX
83#define	__UINT_FAST8_MAX	UINT32_MAX
84#define	__UINT_FAST16_MAX	UINT32_MAX
85#define	__UINT_FAST32_MAX	UINT32_MAX
86#define	__UINT_FAST64_MAX	UINT64_MAX
87
88/* 7.18.1.4 Integer types capable of holding object pointers */
89typedef	long			__intptr_t;
90typedef	unsigned long		__uintptr_t;
91
92/* 7.18.1.5 Greatest-width integer types */
93typedef	__int64_t		__intmax_t;
94typedef	__uint64_t		__uintmax_t;
95
96/* Register size */
97typedef long			__register_t;
98
99/* VM system types */
100typedef unsigned long		__vaddr_t;
101typedef unsigned long		__paddr_t;
102typedef unsigned long		__vsize_t;
103typedef unsigned long		__psize_t;
104
105/* Standard system types */
106typedef int			__clock_t;
107typedef int			__clockid_t;
108typedef double			__double_t;
109typedef float			__float_t;
110typedef long long		__off_t;
111typedef long			__ptrdiff_t;
112typedef	unsigned long		__size_t;
113typedef	long			__ssize_t;
114typedef	int			__time_t;
115typedef int			__timer_t;
116#if defined(__GNUC__) && __GNUC__ >= 3
117typedef	__builtin_va_list	__va_list;
118#else
119typedef struct {
120	char *base;
121	int offset;
122	int pad;
123} __va_list;
124#endif
125
126/* Wide character support types */
127#ifndef __cplusplus
128typedef	int			__wchar_t;
129#endif
130typedef int			__wint_t;
131typedef	int			__rune_t;
132typedef	void *			__wctrans_t;
133typedef	void *			__wctype_t;
134
135/* Feature test macros */
136#define __HAVE_TIMECOUNTER
137
138#endif	/* _MACHINE__TYPES_H_ */
139