asm-*/posix_types.h: scrub __GLIBC__
[linux-3.10.git] / include / asm-x86 / posix_types_32.h
1 #ifndef __ARCH_I386_POSIX_TYPES_H
2 #define __ARCH_I386_POSIX_TYPES_H
3
4 /*
5  * This file is generally used by user-level software, so you need to
6  * be a little careful about namespace pollution etc.  Also, we cannot
7  * assume GCC is being used.
8  */
9
10 typedef unsigned long   __kernel_ino_t;
11 typedef unsigned short  __kernel_mode_t;
12 typedef unsigned short  __kernel_nlink_t;
13 typedef long            __kernel_off_t;
14 typedef int             __kernel_pid_t;
15 typedef unsigned short  __kernel_ipc_pid_t;
16 typedef unsigned short  __kernel_uid_t;
17 typedef unsigned short  __kernel_gid_t;
18 typedef unsigned int    __kernel_size_t;
19 typedef int             __kernel_ssize_t;
20 typedef int             __kernel_ptrdiff_t;
21 typedef long            __kernel_time_t;
22 typedef long            __kernel_suseconds_t;
23 typedef long            __kernel_clock_t;
24 typedef int             __kernel_timer_t;
25 typedef int             __kernel_clockid_t;
26 typedef int             __kernel_daddr_t;
27 typedef char *          __kernel_caddr_t;
28 typedef unsigned short  __kernel_uid16_t;
29 typedef unsigned short  __kernel_gid16_t;
30 typedef unsigned int    __kernel_uid32_t;
31 typedef unsigned int    __kernel_gid32_t;
32
33 typedef unsigned short  __kernel_old_uid_t;
34 typedef unsigned short  __kernel_old_gid_t;
35 typedef unsigned short  __kernel_old_dev_t;
36
37 #ifdef __GNUC__
38 typedef long long       __kernel_loff_t;
39 #endif
40
41 typedef struct {
42         int     val[2];
43 } __kernel_fsid_t;
44
45 #if defined(__KERNEL__)
46
47 #undef  __FD_SET
48 #define __FD_SET(fd,fdsetp) \
49                 __asm__ __volatile__("btsl %1,%0": \
50                         "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
51
52 #undef  __FD_CLR
53 #define __FD_CLR(fd,fdsetp) \
54                 __asm__ __volatile__("btrl %1,%0": \
55                         "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
56
57 #undef  __FD_ISSET
58 #define __FD_ISSET(fd,fdsetp) (__extension__ ({ \
59                 unsigned char __result; \
60                 __asm__ __volatile__("btl %1,%2 ; setb %0" \
61                         :"=q" (__result) :"r" ((int) (fd)), \
62                         "m" (*(__kernel_fd_set *) (fdsetp))); \
63                 __result; }))
64
65 #undef  __FD_ZERO
66 #define __FD_ZERO(fdsetp) \
67 do { \
68         int __d0, __d1; \
69         __asm__ __volatile__("cld ; rep ; stosl" \
70                         :"=m" (*(__kernel_fd_set *) (fdsetp)), \
71                           "=&c" (__d0), "=&D" (__d1) \
72                         :"a" (0), "1" (__FDSET_LONGS), \
73                         "2" ((__kernel_fd_set *) (fdsetp)) : "memory"); \
74 } while (0)
75
76 #endif /* defined(__KERNEL__) */
77
78 #endif