0001
0002 #ifndef __ASM_GENERIC_COMPAT_H
0003 #define __ASM_GENERIC_COMPAT_H
0004
0005 #ifndef COMPAT_USER_HZ
0006 #define COMPAT_USER_HZ 100
0007 #endif
0008
0009 #ifndef COMPAT_RLIM_INFINITY
0010 #define COMPAT_RLIM_INFINITY 0xffffffff
0011 #endif
0012
0013 #ifndef COMPAT_OFF_T_MAX
0014 #define COMPAT_OFF_T_MAX 0x7fffffff
0015 #endif
0016
0017 #if !defined(compat_arg_u64) && !defined(CONFIG_CPU_BIG_ENDIAN)
0018 #define compat_arg_u64(name) u32 name##_lo, u32 name##_hi
0019 #define compat_arg_u64_dual(name) u32, name##_lo, u32, name##_hi
0020 #define compat_arg_u64_glue(name) (((u64)name##_lo & 0xffffffffUL) | \
0021 ((u64)name##_hi << 32))
0022 #endif
0023
0024
0025 typedef u32 compat_size_t;
0026 typedef s32 compat_ssize_t;
0027 typedef s32 compat_clock_t;
0028 typedef s32 compat_pid_t;
0029 typedef u32 compat_ino_t;
0030 typedef s32 compat_off_t;
0031 typedef s64 compat_loff_t;
0032 typedef s32 compat_daddr_t;
0033 typedef s32 compat_timer_t;
0034 typedef s32 compat_key_t;
0035 typedef s16 compat_short_t;
0036 typedef s32 compat_int_t;
0037 typedef s32 compat_long_t;
0038 typedef u16 compat_ushort_t;
0039 typedef u32 compat_uint_t;
0040 typedef u32 compat_ulong_t;
0041 typedef u32 compat_uptr_t;
0042 typedef u32 compat_caddr_t;
0043 typedef u32 compat_aio_context_t;
0044 typedef u32 compat_old_sigset_t;
0045
0046 #ifndef __compat_uid_t
0047 typedef u32 __compat_uid_t;
0048 typedef u32 __compat_gid_t;
0049 #endif
0050
0051 #ifndef __compat_uid32_t
0052 typedef u32 __compat_uid32_t;
0053 typedef u32 __compat_gid32_t;
0054 #endif
0055
0056 #ifndef compat_mode_t
0057 typedef u32 compat_mode_t;
0058 #endif
0059
0060 #ifdef CONFIG_COMPAT_FOR_U64_ALIGNMENT
0061 typedef s64 __attribute__((aligned(4))) compat_s64;
0062 typedef u64 __attribute__((aligned(4))) compat_u64;
0063 #else
0064 typedef s64 compat_s64;
0065 typedef u64 compat_u64;
0066 #endif
0067
0068 #ifndef _COMPAT_NSIG
0069 typedef u32 compat_sigset_word;
0070 #define _COMPAT_NSIG _NSIG
0071 #define _COMPAT_NSIG_BPW 32
0072 #endif
0073
0074 #ifndef compat_dev_t
0075 typedef u32 compat_dev_t;
0076 #endif
0077
0078 #ifndef compat_ipc_pid_t
0079 typedef s32 compat_ipc_pid_t;
0080 #endif
0081
0082 #ifndef compat_fsid_t
0083 typedef __kernel_fsid_t compat_fsid_t;
0084 #endif
0085
0086 #ifndef compat_statfs
0087 struct compat_statfs {
0088 compat_int_t f_type;
0089 compat_int_t f_bsize;
0090 compat_int_t f_blocks;
0091 compat_int_t f_bfree;
0092 compat_int_t f_bavail;
0093 compat_int_t f_files;
0094 compat_int_t f_ffree;
0095 compat_fsid_t f_fsid;
0096 compat_int_t f_namelen;
0097 compat_int_t f_frsize;
0098 compat_int_t f_flags;
0099 compat_int_t f_spare[4];
0100 };
0101 #endif
0102
0103 #ifndef compat_ipc64_perm
0104 struct compat_ipc64_perm {
0105 compat_key_t key;
0106 __compat_uid32_t uid;
0107 __compat_gid32_t gid;
0108 __compat_uid32_t cuid;
0109 __compat_gid32_t cgid;
0110 compat_mode_t mode;
0111 unsigned char __pad1[4 - sizeof(compat_mode_t)];
0112 compat_ushort_t seq;
0113 compat_ushort_t __pad2;
0114 compat_ulong_t unused1;
0115 compat_ulong_t unused2;
0116 };
0117
0118 struct compat_semid64_ds {
0119 struct compat_ipc64_perm sem_perm;
0120 compat_ulong_t sem_otime;
0121 compat_ulong_t sem_otime_high;
0122 compat_ulong_t sem_ctime;
0123 compat_ulong_t sem_ctime_high;
0124 compat_ulong_t sem_nsems;
0125 compat_ulong_t __unused3;
0126 compat_ulong_t __unused4;
0127 };
0128
0129 struct compat_msqid64_ds {
0130 struct compat_ipc64_perm msg_perm;
0131 compat_ulong_t msg_stime;
0132 compat_ulong_t msg_stime_high;
0133 compat_ulong_t msg_rtime;
0134 compat_ulong_t msg_rtime_high;
0135 compat_ulong_t msg_ctime;
0136 compat_ulong_t msg_ctime_high;
0137 compat_ulong_t msg_cbytes;
0138 compat_ulong_t msg_qnum;
0139 compat_ulong_t msg_qbytes;
0140 compat_pid_t msg_lspid;
0141 compat_pid_t msg_lrpid;
0142 compat_ulong_t __unused4;
0143 compat_ulong_t __unused5;
0144 };
0145
0146 struct compat_shmid64_ds {
0147 struct compat_ipc64_perm shm_perm;
0148 compat_size_t shm_segsz;
0149 compat_ulong_t shm_atime;
0150 compat_ulong_t shm_atime_high;
0151 compat_ulong_t shm_dtime;
0152 compat_ulong_t shm_dtime_high;
0153 compat_ulong_t shm_ctime;
0154 compat_ulong_t shm_ctime_high;
0155 compat_pid_t shm_cpid;
0156 compat_pid_t shm_lpid;
0157 compat_ulong_t shm_nattch;
0158 compat_ulong_t __unused4;
0159 compat_ulong_t __unused5;
0160 };
0161 #endif
0162
0163 #endif