Home | History | Annotate | Download | only in machine
      1 /*	$OpenBSD: _types.h,v 1.2 2006/01/13 17:50:06 millert 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 _I386__TYPES_H_
     36 #define _I386__TYPES_H_
     37 
     38 /* the kernel defines size_t as unsigned int, but g++ wants it to be unsigned long */
     39 #ifndef _SIZE_T
     40 #  define _SIZE_T
     41 #  ifdef ANDROID
     42      typedef unsigned int  size_t;
     43 #  else
     44      typedef unsigned long  size_t;
     45 #  endif
     46 #endif
     47 #if !defined(_SSIZE_T) && !defined(_SSIZE_T_DEFINED_)
     48 #define _SSIZE_T
     49 #define _SSIZE_T_DEFINED_
     50 typedef long int       ssize_t;
     51 #endif
     52 #ifndef _PTRDIFF_T
     53 #define _PTRDIFF_T
     54 typedef long           ptrdiff_t;
     55 #endif
     56 
     57 #include <linux/types.h>
     58 
     59 /* 7.18.1.1 Exact-width integer types */
     60 typedef	__signed char		__int8_t;
     61 typedef	unsigned char		__uint8_t;
     62 typedef	short			__int16_t;
     63 typedef	unsigned short		__uint16_t;
     64 typedef	int			__int32_t;
     65 typedef	unsigned int		__uint32_t;
     66 /* LONGLONG */
     67 typedef	long long		__int64_t;
     68 /* LONGLONG */
     69 typedef	unsigned long long	__uint64_t;
     70 
     71 /* 7.18.1.2 Minimum-width integer types */
     72 typedef	__int8_t		__int_least8_t;
     73 typedef	__uint8_t		__uint_least8_t;
     74 typedef	__int16_t		__int_least16_t;
     75 typedef	__uint16_t		__uint_least16_t;
     76 typedef	__int32_t		__int_least32_t;
     77 typedef	__uint32_t		__uint_least32_t;
     78 typedef	__int64_t		__int_least64_t;
     79 typedef	__uint64_t		__uint_least64_t;
     80 
     81 /* 7.18.1.3 Fastest minimum-width integer types */
     82 typedef	__int32_t		__int_fast8_t;
     83 typedef	__uint32_t		__uint_fast8_t;
     84 typedef	__int32_t		__int_fast16_t;
     85 typedef	__uint32_t		__uint_fast16_t;
     86 typedef	__int32_t		__int_fast32_t;
     87 typedef	__uint32_t		__uint_fast32_t;
     88 typedef	__int64_t		__int_fast64_t;
     89 typedef	__uint64_t		__uint_fast64_t;
     90 
     91 /* 7.18.1.4 Integer types capable of holding object pointers */
     92 typedef	int 			__intptr_t;
     93 typedef	unsigned int 	__uintptr_t;
     94 
     95 /* 7.18.1.5 Greatest-width integer types */
     96 typedef	__int64_t		__intmax_t;
     97 typedef	__uint64_t		__uintmax_t;
     98 
     99 /* Register size */
    100 typedef __int32_t		__register_t;
    101 
    102 /* VM system types */
    103 typedef unsigned long		__vaddr_t;
    104 typedef unsigned long		__paddr_t;
    105 typedef unsigned long		__vsize_t;
    106 typedef unsigned long		__psize_t;
    107 
    108 /* Standard system types */
    109 typedef int			__clock_t;
    110 typedef int			__clockid_t;
    111 typedef long			__ptrdiff_t;
    112 typedef	int			__time_t;
    113 typedef int			__timer_t;
    114 #if defined(__GNUC__) && __GNUC__ >= 3
    115 typedef	__builtin_va_list	__va_list;
    116 #else
    117 typedef	char *			__va_list;
    118 #endif
    119 
    120 /* Wide character support types */
    121 #ifndef __cplusplus
    122 typedef	int			__wchar_t;
    123 #endif
    124 typedef int			__wint_t;
    125 typedef	int			__rune_t;
    126 typedef	void *			__wctrans_t;
    127 typedef	void *			__wctype_t;
    128 
    129 /* Feature test macros */
    130 #define __HAVE_CPUINFO
    131 #define __HAVE_MUTEX
    132 
    133 #endif	/* _I386__TYPES_H_ */
    134