filename | test/include/sys/types.h |
changeset | 185:6755a04c447f |
author | nkeynes |
date | Fri Feb 08 00:06:56 2008 +0000 (16 years ago) |
permissions | -rw-r--r-- |
last change | Fix LDS/STS to FPUL/FPSCR to check the FPU disabled bit. Fixes the linux 2.4.0-test8 kernel boot (this wasn't exactly very well documented in the original manual) |
view | annotate | diff | log | raw |
1 /* unified sys/types.h:
2 start with sef's sysvi386 version.
3 merge go32 version -- a few ifdefs.
4 h8300hms, h8300xray, and sysvnecv70 disagree on the following types:
6 typedef int gid_t;
7 typedef int uid_t;
8 typedef int dev_t;
9 typedef int ino_t;
10 typedef int mode_t;
11 typedef int caddr_t;
13 however, these aren't "reasonable" values, the sysvi386 ones make far
14 more sense, and should work sufficiently well (in particular, h8300
15 doesn't have a stat, and the necv70 doesn't matter.) -- eichin
16 */
18 #ifndef _SYS_TYPES_H
19 #define _SYS_TYPES_H
21 #if defined (_WIN32) || defined (__CYGWIN__)
22 #define __MS_types__
23 #endif
25 #ifdef __i386__
26 #if defined (GO32) || defined (__MSDOS__)
27 #define __MS_types__
28 #endif
29 #endif
31 # include <stddef.h>
32 # include <machine/types.h>
34 /* To ensure the stat struct's layout doesn't change when sizeof(int), etc.
35 changes, we assume sizeof short and long never change and have all types
36 used to define struct stat use them and not int where possible.
37 Where not possible, _ST_INTxx are used. It would be preferable to not have
38 such assumptions, but until the extra fluff is necessary, it's avoided.
39 No 64 bit targets use stat yet. What to do about them is postponed
40 until necessary. */
41 #ifdef __GNUC__
42 #define _ST_INT32 __attribute__ ((__mode__ (__SI__)))
43 #else
44 #define _ST_INT32
45 #endif
47 # ifndef _POSIX_SOURCE
49 # define physadr physadr_t
50 # define quad quad_t
52 #ifndef _WINSOCK_H
53 typedef unsigned char u_char;
54 typedef unsigned short u_short;
55 typedef unsigned int u_int;
56 typedef unsigned long u_long;
57 #endif
59 typedef unsigned short ushort; /* System V compatibility */
60 typedef unsigned int uint; /* System V compatibility */
61 # endif /*!_POSIX_SOURCE */
63 #ifndef __time_t_defined
64 typedef _TIME_T_ time_t;
65 #define __time_t_defined
66 #endif
68 typedef long daddr_t;
69 typedef char * caddr_t;
71 #ifdef __MS_types__
72 typedef unsigned long ino_t;
73 #else
74 #ifdef __sparc__
75 typedef unsigned long ino_t;
76 #else
77 typedef unsigned short ino_t;
78 #endif
79 #endif
81 #ifdef __MS_types__
82 typedef unsigned long vm_offset_t;
83 typedef unsigned long vm_size_t;
85 #define __BIT_TYPES_DEFINED__
87 typedef char int8_t;
88 typedef unsigned char u_int8_t;
89 typedef short int16_t;
90 typedef unsigned short u_int16_t;
91 typedef int int32_t;
92 typedef unsigned int u_int32_t;
93 typedef long long int64_t;
94 typedef unsigned long long u_int64_t;
95 typedef int32_t register_t;
96 #endif /* __MS_types__ */
98 /*
99 * All these should be machine specific - right now they are all broken.
100 * However, for all of Cygnus' embedded targets, we want them to all be
101 * the same. Otherwise things like sizeof (struct stat) might depend on
102 * how the file was compiled (e.g. -mint16 vs -mint32, etc.).
103 */
105 typedef short dev_t;
107 typedef long off_t;
109 typedef unsigned short uid_t;
110 typedef unsigned short gid_t;
111 typedef int pid_t;
112 typedef long key_t;
113 typedef long ssize_t;
115 #ifdef __MS_types__
116 typedef char * addr_t;
117 typedef int mode_t;
118 #else
119 #if defined (__sparc__) && !defined (__sparc_v9__)
120 #ifdef __svr4__
121 typedef unsigned long mode_t;
122 #else
123 typedef unsigned short mode_t;
124 #endif
125 #else
126 typedef unsigned int mode_t _ST_INT32;
127 #endif
128 #endif /* ! __MS_types__ */
130 typedef unsigned short nlink_t;
132 /* We don't define fd_set and friends if we are compiling POSIX
133 source, or if we have included the Windows Sockets.h header (which
134 defines Windows versions of them). Note that a program which
135 includes the Windows sockets.h header must know what it is doing;
136 it must not call the cygwin32 select function. */
137 # if ! defined (_POSIX_SOURCE) && ! defined (_WINSOCK_H)
139 # define NBBY 8 /* number of bits in a byte */
140 /*
141 * Select uses bit masks of file descriptors in longs.
142 * These macros manipulate such bit fields (the filesystem macros use chars).
143 * FD_SETSIZE may be defined by the user, but the default here
144 * should be >= NOFILE (param.h).
145 */
146 # ifndef FD_SETSIZE
147 # define FD_SETSIZE 64
148 # endif
150 typedef long fd_mask;
151 # define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
152 # ifndef howmany
153 # define howmany(x,y) (((x)+((y)-1))/(y))
154 # endif
156 /* We use a macro for fd_set so that including Sockets.h afterwards
157 can work. */
158 typedef struct _types_fd_set {
159 fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
160 } _types_fd_set;
162 #define fd_set _types_fd_set
164 # define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
165 # define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
166 # define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
167 # define FD_ZERO(p) bzero((caddr_t)(p), sizeof (*(p)))
169 # endif /* ! defined (_POSIX_SOURCE) && ! defined (_WINSOCK_H) */
171 #undef __MS_types__
172 #undef _ST_INT32
174 #endif /* _SYS_TYPES_H */
.