1 #ifndef _I386_TYPES_H
2 #define _I386_TYPES_H
3
4 #ifndef _SIZE_T
5 #define _SIZE_T
6 typedef unsigned int size_t;
7 #endif
8
9 #ifndef _SSIZE_T
10 #define _SSIZE_T
11 typedef int ssize_t;
12 #endif
13
14 #ifndef _PTRDIFF_T
15 #define _PTRDIFF_T
16 typedef int ptrdiff_t;
17 #endif
18
19 #ifndef _TIME_T
20 #define _TIME_T
21 typedef long time_t;
22 #endif
23
24 #ifndef _CLOCK_T
25 #define _CLOCK_T
26 typedef long clock_t;
27 #endif
28
29 typedef int pid_t;
30 typedef unsigned short uid_t;
31 typedef unsigned short gid_t;
32 typedef unsigned short dev_t;
33 typedef unsigned long ino_t;
34 typedef unsigned short mode_t;
35 typedef unsigned short umode_t;
36 typedef unsigned short nlink_t;
37 typedef int daddr_t;
38 typedef long off_t;
39
40
41
42
43
44
45 typedef __signed__ char __s8;
46 typedef unsigned char __u8;
47
48 typedef __signed__ short __s16;
49 typedef unsigned short __u16;
50
51 typedef __signed__ int __s32;
52 typedef unsigned int __u32;
53
54 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
55 typedef __signed__ long long __s64;
56 typedef unsigned long long __u64;
57 #endif
58
59
60
61
62 #ifdef __KERNEL__
63
64 typedef signed char s8;
65 typedef unsigned char u8;
66
67 typedef signed short s16;
68 typedef unsigned short u16;
69
70 typedef signed int s32;
71 typedef unsigned int u32;
72
73 typedef signed long long s64;
74 typedef unsigned long long u64;
75
76 #endif
77
78 #undef __FD_SET
79 #define __FD_SET(fd,fdsetp) \
80 __asm__ __volatile__("btsl %1,%0": \
81 "=m" (*(fd_set *) (fdsetp)):"r" ((int) (fd)))
82
83 #undef __FD_CLR
84 #define __FD_CLR(fd,fdsetp) \
85 __asm__ __volatile__("btrl %1,%0": \
86 "=m" (*(fd_set *) (fdsetp)):"r" ((int) (fd)))
87
88 #undef __FD_ISSET
89 #define __FD_ISSET(fd,fdsetp) (__extension__ ({ \
90 unsigned char __result; \
91 __asm__ __volatile__("btl %1,%2 ; setb %0" \
92 :"=q" (__result) :"r" ((int) (fd)), \
93 "m" (*(fd_set *) (fdsetp))); \
94 __result; }))
95
96 #undef __FD_ZERO
97 #define __FD_ZERO(fdsetp) \
98 __asm__ __volatile__("cld ; rep ; stosl" \
99 :"=m" (*(fd_set *) (fdsetp)) \
100 :"a" (0), "c" (__FDSET_INTS), \
101 "D" ((fd_set *) (fdsetp)) :"cx","di")
102
103 #endif