x86: introduce native_set_pte_atomic() on 64-bit too
[wrt350n-kernel.git] / include / asm-s390 / posix_types.h
blob397d93fba3a77c762a8002805ce8ef5b175b5e8d
1 /*
2 * include/asm-s390/posix_types.h
4 * S390 version
6 * Derived from "include/asm-i386/posix_types.h"
7 */
9 #ifndef __ARCH_S390_POSIX_TYPES_H
10 #define __ARCH_S390_POSIX_TYPES_H
13 * This file is generally used by user-level software, so you need to
14 * be a little careful about namespace pollution etc. Also, we cannot
15 * assume GCC is being used.
18 typedef long __kernel_off_t;
19 typedef int __kernel_pid_t;
20 typedef unsigned long __kernel_size_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;
31 #ifdef __GNUC__
32 typedef long long __kernel_loff_t;
33 #endif
35 #ifndef __s390x__
37 typedef unsigned long __kernel_ino_t;
38 typedef unsigned short __kernel_mode_t;
39 typedef unsigned short __kernel_nlink_t;
40 typedef unsigned short __kernel_ipc_pid_t;
41 typedef unsigned short __kernel_uid_t;
42 typedef unsigned short __kernel_gid_t;
43 typedef int __kernel_ssize_t;
44 typedef int __kernel_ptrdiff_t;
45 typedef unsigned int __kernel_uid32_t;
46 typedef unsigned int __kernel_gid32_t;
47 typedef unsigned short __kernel_old_uid_t;
48 typedef unsigned short __kernel_old_gid_t;
49 typedef unsigned short __kernel_old_dev_t;
51 #else /* __s390x__ */
53 typedef unsigned int __kernel_ino_t;
54 typedef unsigned int __kernel_mode_t;
55 typedef unsigned int __kernel_nlink_t;
56 typedef int __kernel_ipc_pid_t;
57 typedef unsigned int __kernel_uid_t;
58 typedef unsigned int __kernel_gid_t;
59 typedef long __kernel_ssize_t;
60 typedef long __kernel_ptrdiff_t;
61 typedef unsigned long __kernel_sigset_t; /* at least 32 bits */
62 typedef __kernel_uid_t __kernel_old_uid_t;
63 typedef __kernel_gid_t __kernel_old_gid_t;
64 typedef __kernel_uid_t __kernel_uid32_t;
65 typedef __kernel_gid_t __kernel_gid32_t;
66 typedef unsigned short __kernel_old_dev_t;
68 #endif /* __s390x__ */
70 typedef struct {
71 #if defined(__KERNEL__) || defined(__USE_ALL)
72 int val[2];
73 #else /* !defined(__KERNEL__) && !defined(__USE_ALL)*/
74 int __val[2];
75 #endif /* !defined(__KERNEL__) && !defined(__USE_ALL)*/
76 } __kernel_fsid_t;
79 #ifdef __KERNEL__
81 #undef __FD_SET
82 static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
84 unsigned long _tmp = fd / __NFDBITS;
85 unsigned long _rem = fd % __NFDBITS;
86 fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
89 #undef __FD_CLR
90 static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
92 unsigned long _tmp = fd / __NFDBITS;
93 unsigned long _rem = fd % __NFDBITS;
94 fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
97 #undef __FD_ISSET
98 static inline int __FD_ISSET(unsigned long fd, const __kernel_fd_set *fdsetp)
100 unsigned long _tmp = fd / __NFDBITS;
101 unsigned long _rem = fd % __NFDBITS;
102 return (fdsetp->fds_bits[_tmp] & (1UL<<_rem)) != 0;
105 #undef __FD_ZERO
106 #define __FD_ZERO(fdsetp) \
107 ((void) memset ((void *) (fdsetp), 0, sizeof (__kernel_fd_set)))
109 #endif /* __KERNEL__ */
111 #endif