2 System type declarations.
4 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available
6 under the terms and conditions of the BSD License that accompanies this
7 distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 Copyright (c) 1990, 1993
14 The Regents of the University of California. All rights reserved.
16 Redistribution and use in source and binary forms, with or without
17 modification, are permitted provided that the following conditions
19 - Redistributions of source code must retain the above copyright
20 notice, this list of conditions and the following disclaimer.
21 - Redistributions in binary form must reproduce the above copyright
22 notice, this list of conditions and the following disclaimer in the
23 documentation and/or other materials provided with the distribution.
24 - Neither the name of the University nor the names of its contributors
25 may be used to endorse or promote products derived from this software
26 without specific prior written permission.
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
32 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 POSSIBILITY OF SUCH DAMAGE.
40 NetBSD: types.h,v 1.71.12.1 2007/09/27 13:40:47 xtraeme Exp
41 types.h 8.4 (Berkeley) 1/21/94
46 #include <sys/EfiCdefs.h>
48 /* Machine type dependent parameters. */
49 #include <machine/types.h>
51 #include <machine/ansi.h>
52 #include <machine/int_types.h>
58 typedef __int8_t
int8_t;
59 #define int8_t __int8_t
63 typedef __uint8_t
uint8_t;
64 #define uint8_t __uint8_t
68 typedef __int16_t
int16_t;
69 #define int16_t __int16_t
73 typedef __uint16_t
uint16_t;
74 #define uint16_t __uint16_t
78 typedef __int32_t
int32_t;
79 #define int32_t __int32_t
83 typedef __uint32_t
uint32_t;
84 #define uint32_t __uint32_t
88 typedef __int64_t
int64_t;
89 #define int64_t __int64_t
93 typedef __uint64_t
uint64_t;
94 #define uint64_t __uint64_t
97 typedef uint8_t u_int8_t
;
98 typedef uint16_t u_int16_t
;
99 typedef uint32_t u_int32_t
;
100 typedef uint64_t u_int64_t
;
102 #include <machine/endian.h>
104 #if defined(_NETBSD_SOURCE)
105 typedef UINT8 u_char
;
106 typedef UINT16 u_short
;
108 typedef ULONGN u_long
;
110 typedef UINT8 unchar
; /* Sys V compatibility */
111 typedef UINT16 ushort
; /* Sys V compatibility */
112 typedef UINTN uint
; /* Sys V compatibility */
113 typedef ULONGN ulong
; /* Sys V compatibility */
115 typedef u_long cpuid_t
;
118 typedef uint64_t u_quad_t
; /* quads */
119 typedef int64_t quad_t
;
120 typedef quad_t
* qaddr_t
;
123 * The types longlong_t and u_longlong_t exist for use with the
124 * Sun-derived XDR routines involving these types, and their usage
125 * in other contexts is discouraged. Further note that these types
126 * may not be equivalent to "long long" and "unsigned long long",
127 * they are only guaranteed to be signed and unsigned 64-bit types
128 * respectively. Portable programs that need 64-bit types should use
129 * the C99 types int64_t and uint64_t instead.
132 typedef int64_t longlong_t
; /* for XDR */
133 typedef uint64_t u_longlong_t
; /* for XDR */
135 typedef int64_t blkcnt_t
; /* fs block count */
136 typedef uint32_t blksize_t
; /* fs optimal block size */
139 typedef __fsblkcnt_t fsblkcnt_t
; /* fs block count (statvfs) */
140 #define fsblkcnt_t __fsblkcnt_t
144 typedef __fsfilcnt_t fsfilcnt_t
; /* fs file count */
145 #define fsfilcnt_t __fsfilcnt_t
149 typedef __caddr_t caddr_t
; /* core address */
150 #define caddr_t __caddr_t
154 typedef __daddr_t daddr_t
; /* disk address */
157 typedef int64_t daddr_t
; /* disk address */
160 typedef uint32_t dev_t
; /* device number */
161 typedef uint32_t fixpt_t
; /* fixed point number */
164 typedef __gid_t gid_t
; /* group id */
165 #define gid_t __gid_t
168 typedef uint32_t id_t
; /* group id, process id or user id */
169 typedef uint64_t ino_t
; /* inode number */
170 typedef EFI_LONG_T key_t
; /* IPC key (for Sys V IPC) */
173 typedef __mode_t mode_t
; /* permissions */
174 #define mode_t __mode_t
177 typedef uint32_t nlink_t
; /* link count */
180 typedef __off_t off_t
; /* file offset */
181 #define off_t __off_t
185 typedef __pid_t pid_t
; /* process id */
186 #define pid_t __pid_t
188 typedef int32_t lwpid_t
; /* LWP id */
189 typedef quad_t rlim_t
; /* resource limit */
190 typedef int32_t segsz_t
; /* segment size */
191 typedef int32_t swblk_t
; /* swap offset */
194 typedef __uid_t uid_t
; /* user id */
195 #define uid_t __uid_t
198 typedef int64_t dtime_t
; /* on-disk time_t */
202 * semctl(2)'s argument structure. This is here for the benefit of
203 * <sys/syscallargs.h>. It is not in the user's namespace in SUSv2.
204 * The SUSv2 semctl(2) takes variable arguments.
207 int val
; /* value for SETVAL */
208 struct semid_ds
*buf
; /* buffer for IPC_STAT & IPC_SET */
209 unsigned short *array
; /* array for GETALL & SETALL */
211 /* For the same reason as above */
212 #include <sys/stdint.h>
213 typedef intptr_t semid_t
;
217 * These belong in EfiSysCall.h, but are also placed here to ensure that
218 * long arguments will be promoted to off_t if the program fails to
219 * include that header or explicitly cast them to off_t.
221 #ifndef __OFF_T_SYSCALLS_DECLARED
222 #define __OFF_T_SYSCALLS_DECLARED
224 extern off_t
lseek (int, off_t
, int);
225 extern int truncate (const char *, off_t
);
226 extern int ftruncate (int, off_t
);
228 #endif /* __OFF_T_SYSCALLS_DECLARED */
230 #if defined(_NETBSD_SOURCE)
231 /* Major, minor numbers, dev_t's. */
232 #define major(x) ((int32_t)((((x) & 0x000fff00) >> 8)))
233 #define minor(x) ((int32_t)((((x) & 0xfff00000) >> 12) | \
234 (((x) & 0x000000ff) >> 0)))
235 #define makedev(x,y) ((dev_t)((((x) << 8) & 0x000fff00) | \
236 (((y) << 12) & 0xfff00000) | \
237 (((y) << 0) & 0x000000ff)))
240 #if defined(_BSD_CLOCK_T_) && defined(_EFI_CLOCK_T)
241 typedef _EFI_CLOCK_T
clock_t;
247 typedef _EFI_SIZE_T_
size_t;
254 typedef _BSD_SSIZE_T_ ssize_t
;
258 #if defined(_BSD_TIME_T_) && defined(_EFI_TIME_T)
259 typedef _EFI_TIME_T
time_t;
264 #ifdef _BSD_CLOCKID_T_
265 typedef _BSD_CLOCKID_T_ clockid_t
;
266 #undef _BSD_CLOCKID_T_
270 typedef _BSD_TIMER_T_ timer_t
;
274 #ifdef _BSD_SUSECONDS_T_
275 typedef _BSD_SUSECONDS_T_ suseconds_t
;
276 #undef _BSD_SUSECONDS_T_
279 #ifdef _BSD_USECONDS_T_
280 typedef _BSD_USECONDS_T_ useconds_t
;
281 #undef _BSD_USECONDS_T_
284 #ifdef _NETBSD_SOURCE
285 #include <sys/fd_set.h>
288 typedef struct kauth_cred
*kauth_cred_t
;
293 #if !defined(_KERNEL) && !defined(_STANDALONE)
294 #if (_POSIX_C_SOURCE - 0L) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
295 defined(_NETBSD_SOURCE)
296 #include <pthread_types.h>
301 #endif /* !_SYS_TYPES_H_ */