1 |
207 |
jeremybenn |
/* libc/sys/linux/sys/types.h - The usual type zoo */
|
2 |
|
|
|
3 |
|
|
/* Written 2000 by Werner Almesberger */
|
4 |
|
|
|
5 |
|
|
/*-
|
6 |
|
|
* Copyright (c) 1982, 1986, 1991, 1993, 1994
|
7 |
|
|
* The Regents of the University of California. All rights reserved.
|
8 |
|
|
* (c) UNIX System Laboratories, Inc.
|
9 |
|
|
* All or some portions of this file are derived from material licensed
|
10 |
|
|
* to the University of California by American Telephone and Telegraph
|
11 |
|
|
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
12 |
|
|
* the permission of UNIX System Laboratories, Inc.
|
13 |
|
|
*
|
14 |
|
|
* Redistribution and use in source and binary forms, with or without
|
15 |
|
|
* modification, are permitted provided that the following conditions
|
16 |
|
|
* are met:
|
17 |
|
|
* 1. Redistributions of source code must retain the above copyright
|
18 |
|
|
* notice, this list of conditions and the following disclaimer.
|
19 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
20 |
|
|
* notice, this list of conditions and the following disclaimer in the
|
21 |
|
|
* documentation and/or other materials provided with the distribution.
|
22 |
|
|
* 3. All advertising materials mentioning features or use of this software
|
23 |
|
|
* must display the following acknowledgement:
|
24 |
|
|
* This product includes software developed by the University of
|
25 |
|
|
* California, Berkeley and its contributors.
|
26 |
|
|
* 4. Neither the name of the University nor the names of its contributors
|
27 |
|
|
* may be used to endorse or promote products derived from this software
|
28 |
|
|
* without specific prior written permission.
|
29 |
|
|
*
|
30 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
31 |
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
32 |
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
33 |
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
34 |
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
35 |
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
36 |
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
37 |
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
38 |
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
39 |
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
40 |
|
|
* SUCH DAMAGE.
|
41 |
|
|
*
|
42 |
|
|
* @(#)types.h 8.6 (Berkeley) 2/19/95
|
43 |
|
|
* $FreeBSD: src/sys/sys/types.h,v 1.60 2002/04/10 15:58:13 mike Exp $
|
44 |
|
|
*/
|
45 |
|
|
|
46 |
|
|
#ifndef _SYS_TYPES_H
|
47 |
|
|
#define _SYS_TYPES_H
|
48 |
|
|
|
49 |
|
|
/* Newlib has it's own time_t and clock_t definitions in
|
50 |
|
|
* libc/include/sys/types.h. Repeat those here and
|
51 |
|
|
* skip the kernel's definitions. */
|
52 |
|
|
|
53 |
|
|
#define __need_size_t
|
54 |
|
|
#include <stddef.h>
|
55 |
|
|
#include <sys/config.h>
|
56 |
|
|
#include <features.h>
|
57 |
|
|
#include <machine/types.h>
|
58 |
|
|
#include <sys/_types.h>
|
59 |
|
|
|
60 |
|
|
#if !defined(__time_t_defined) && !defined(_TIME_T)
|
61 |
|
|
#define _TIME_T
|
62 |
|
|
#define __time_t_defined
|
63 |
|
|
typedef _TIME_T_ time_t;
|
64 |
|
|
#endif
|
65 |
|
|
|
66 |
|
|
#if !defined(__clock_t_defined) && !defined(_CLOCK_T)
|
67 |
|
|
#define _CLOCK_T
|
68 |
|
|
#define __clock_t_defined
|
69 |
|
|
typedef _CLOCK_T_ clock_t;
|
70 |
|
|
#endif
|
71 |
|
|
|
72 |
|
|
#ifndef _SSIZE_T
|
73 |
|
|
#define _SSIZE_T
|
74 |
|
|
typedef _ssize_t ssize_t;
|
75 |
|
|
#endif
|
76 |
|
|
|
77 |
|
|
#ifndef __u_char_defined
|
78 |
|
|
#ifdef __GNUC__
|
79 |
|
|
__extension__ typedef long long quad_t;
|
80 |
|
|
__extension__ typedef unsigned long long u_quad_t;
|
81 |
|
|
#else
|
82 |
|
|
typedef struct
|
83 |
|
|
{
|
84 |
|
|
long int __val[2];
|
85 |
|
|
} quad_t;
|
86 |
|
|
typedef struct
|
87 |
|
|
{
|
88 |
|
|
unsigned long __val[2];
|
89 |
|
|
} u_quad_t;
|
90 |
|
|
#endif
|
91 |
|
|
typedef struct
|
92 |
|
|
{
|
93 |
|
|
int __val[2];
|
94 |
|
|
} fsid_t;
|
95 |
|
|
#define __u_char_defined
|
96 |
|
|
#endif
|
97 |
|
|
|
98 |
|
|
typedef int clockid_t;
|
99 |
|
|
|
100 |
|
|
# define _SYS_TYPES_FD_SET
|
101 |
|
|
# define NBBY 8 /* number of bits in a byte */
|
102 |
|
|
/*
|
103 |
|
|
* Select uses bit masks of file descriptors in longs.
|
104 |
|
|
* These macros manipulate such bit fields (the filesystem macros use chars).
|
105 |
|
|
* FD_SETSIZE may be defined by the user, but the default here
|
106 |
|
|
* should be >= NOFILE (param.h).
|
107 |
|
|
*/
|
108 |
|
|
# ifndef FD_SETSIZE
|
109 |
|
|
# define FD_SETSIZE 64
|
110 |
|
|
# endif
|
111 |
|
|
|
112 |
|
|
typedef long fd_mask;
|
113 |
|
|
# define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
|
114 |
|
|
# ifndef howmany
|
115 |
|
|
# define howmany(x,y) (((x)+((y)-1))/(y))
|
116 |
|
|
# endif
|
117 |
|
|
|
118 |
|
|
typedef struct {
|
119 |
|
|
unsigned long fds_bits [(1024/(8 * sizeof(unsigned long)))];
|
120 |
|
|
} __fd_set;
|
121 |
|
|
|
122 |
|
|
# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
|
123 |
|
|
# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
|
124 |
|
|
# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
|
125 |
|
|
# define FD_ZERO(p) (__extension__ (void)({ \
|
126 |
|
|
size_t __i; \
|
127 |
|
|
char *__tmp = (char *)p; \
|
128 |
|
|
for (__i = 0; __i < sizeof (*(p)); ++__i) \
|
129 |
|
|
*__tmp++ = 0; \
|
130 |
|
|
}))
|
131 |
|
|
|
132 |
|
|
#include <linux/types.h>
|
133 |
|
|
#include <bits/types.h>
|
134 |
|
|
#define __mode_t_defined
|
135 |
|
|
#define __gid_t_defined
|
136 |
|
|
#define __uid_t_defined
|
137 |
|
|
#define __pid_t_defined
|
138 |
|
|
#define __ssize_t_defined
|
139 |
|
|
#define __key_t_defined
|
140 |
|
|
#define __off_t_defined
|
141 |
|
|
#define __off64_t_defined
|
142 |
|
|
|
143 |
|
|
typedef __ino_t ino_t;
|
144 |
|
|
typedef __ino64_t ino64_t;
|
145 |
|
|
typedef __uint32_t uintptr_t;
|
146 |
|
|
typedef __int32_t intptr_t;
|
147 |
|
|
typedef __off64_t off64_t;
|
148 |
|
|
typedef __off_t off_t;
|
149 |
|
|
typedef __loff_t loff_t;
|
150 |
|
|
typedef __mode_t mode_t;
|
151 |
|
|
typedef __pid_t pid_t;
|
152 |
|
|
typedef __uid_t uid_t;
|
153 |
|
|
typedef __gid_t gid_t;
|
154 |
|
|
typedef __key_t key_t;
|
155 |
|
|
typedef __suseconds_t suseconds_t;
|
156 |
|
|
typedef __useconds_t useconds_t;
|
157 |
|
|
typedef __daddr_t daddr_t;
|
158 |
|
|
typedef __caddr_t caddr_t;
|
159 |
|
|
typedef __dev_t dev_t;
|
160 |
|
|
typedef __fd_set fd_set;
|
161 |
|
|
typedef __nlink_t nlink_t;
|
162 |
|
|
|
163 |
|
|
typedef __u_char u_char;
|
164 |
|
|
typedef __u_short u_short;
|
165 |
|
|
typedef __u_int u_int;
|
166 |
|
|
typedef __u_long u_long;
|
167 |
|
|
typedef __uint8_t u_int8_t;
|
168 |
|
|
typedef __uint16_t u_int16_t;
|
169 |
|
|
typedef __uint32_t u_int32_t;
|
170 |
|
|
typedef __uint64_t u_int64_t;
|
171 |
|
|
typedef __int8_t int8_t;
|
172 |
|
|
typedef __int16_t int16_t;
|
173 |
|
|
typedef __int32_t int32_t;
|
174 |
|
|
typedef __int64_t int64_t;
|
175 |
|
|
|
176 |
|
|
#ifndef _UINT8_T_DECLARED
|
177 |
|
|
typedef __uint8_t uint8_t;
|
178 |
|
|
#define _UINT8_T_DECLARED
|
179 |
|
|
#endif
|
180 |
|
|
|
181 |
|
|
#ifndef _UINT16_T_DECLARED
|
182 |
|
|
typedef __uint16_t uint16_t;
|
183 |
|
|
#define _UINT16_T_DECLARED
|
184 |
|
|
#endif
|
185 |
|
|
|
186 |
|
|
#ifndef _UINT32_T_DECLARED
|
187 |
|
|
typedef __uint32_t uint32_t;
|
188 |
|
|
#define _UINT32_T_DECLARED
|
189 |
|
|
#endif
|
190 |
|
|
|
191 |
|
|
#ifndef _UINT64_T_DECLARED
|
192 |
|
|
typedef __uint64_t uint64_t;
|
193 |
|
|
#define _UINT64_T_DECLARED
|
194 |
|
|
#endif
|
195 |
|
|
|
196 |
|
|
typedef __uint64_t u64;
|
197 |
|
|
|
198 |
|
|
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
199 |
|
|
typedef struct _physadr {
|
200 |
|
|
int r[1];
|
201 |
|
|
} *physadr;
|
202 |
|
|
|
203 |
|
|
typedef struct label_t {
|
204 |
|
|
int val[6];
|
205 |
|
|
} label_t;
|
206 |
|
|
#endif
|
207 |
|
|
|
208 |
|
|
typedef unsigned int vm_offset_t;
|
209 |
|
|
typedef __int64_t vm_ooffset_t;
|
210 |
|
|
typedef unsigned int vm_pindex_t;
|
211 |
|
|
typedef unsigned int vm_size_t;
|
212 |
|
|
|
213 |
|
|
typedef __int32_t register_t;
|
214 |
|
|
typedef __uint32_t u_register_t;
|
215 |
|
|
|
216 |
|
|
#ifdef _KERNEL
|
217 |
|
|
typedef int intfptr_t;
|
218 |
|
|
typedef unsigned int uintfptr_t;
|
219 |
|
|
#endif
|
220 |
|
|
|
221 |
|
|
/* Critical section value */
|
222 |
|
|
typedef register_t critical_t;
|
223 |
|
|
|
224 |
|
|
/* Interrupt mask (spl, xxx_imask, etc) */
|
225 |
|
|
typedef __uint32_t intrmask_t;
|
226 |
|
|
|
227 |
|
|
/* Interrupt handler function type. */
|
228 |
|
|
typedef void ointhand2_t(int _device_id);
|
229 |
|
|
|
230 |
|
|
#endif
|