1 #ifndef _LINUX_TYPES_H
2 #define _LINUX_TYPES_H
3
4 #include <asm/types.h>
5
6 #ifndef NULL
7 #define NULL ((void *) 0)
8 #endif
9
10 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
11 #define _LOFF_T
12 typedef long long loff_t;
13 #endif
14
15
16 typedef unsigned char u_char;
17 typedef unsigned short u_short;
18 typedef unsigned int u_int;
19 typedef unsigned long u_long;
20
21
22 typedef unsigned char unchar;
23 typedef unsigned short ushort;
24 typedef unsigned int uint;
25 typedef unsigned long ulong;
26
27 typedef char *caddr_t;
28
29 typedef unsigned char cc_t;
30 typedef unsigned int speed_t;
31 typedef unsigned int tcflag_t;
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48 #undef __FDSET_LONGS
49 #define __FDSET_LONGS 8
50
51 typedef struct fd_set {
52 unsigned long fds_bits [__FDSET_LONGS];
53 } fd_set;
54
55 #undef __NFDBITS
56 #define __NFDBITS (8 * sizeof(unsigned long))
57
58 #undef __FD_SETSIZE
59 #define __FD_SETSIZE (__FDSET_LONGS*__NFDBITS)
60
61 #undef __FD_SET
62 #define __FD_SET(fd,fdsetp) \
63 __asm__ __volatile__("btsl %1,%0": \
64 "=m" (*(fd_set *) (fdsetp)):"r" ((int) (fd)))
65
66 #undef __FD_CLR
67 #define __FD_CLR(fd,fdsetp) \
68 __asm__ __volatile__("btrl %1,%0": \
69 "=m" (*(fd_set *) (fdsetp)):"r" ((int) (fd)))
70
71 #undef __FD_ISSET
72 #define __FD_ISSET(fd,fdsetp) (__extension__ ({ \
73 unsigned char __result; \
74 __asm__ __volatile__("btl %1,%2 ; setb %0" \
75 :"=q" (__result) :"r" ((int) (fd)), \
76 "m" (*(fd_set *) (fdsetp))); \
77 __result; }))
78
79 #undef __FD_ZERO
80 #define __FD_ZERO(fdsetp) \
81 __asm__ __volatile__("cld ; rep ; stosl" \
82 :"=m" (*(fd_set *) (fdsetp)) \
83 :"a" (0), "c" (__FDSET_LONGS), \
84 "D" ((fd_set *) (fdsetp)) :"cx","di")
85
86 struct ustat {
87 daddr_t f_tfree;
88 ino_t f_tinode;
89 char f_fname[6];
90 char f_fpack[6];
91 };
92
93 #endif