1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Architecture specific compatibility types
7 #include <linux/thread_info.h>
8 #include <linux/types.h>
10 #include <asm/ptrace.h>
12 typedef s32 __compat_uid_t;
13 typedef s32 __compat_gid_t;
14 typedef __compat_uid_t __compat_uid32_t;
15 typedef __compat_gid_t __compat_gid32_t;
16 #define __compat_uid32_t __compat_uid32_t
17 #define __compat_gid32_t __compat_gid32_t
19 #define _COMPAT_NSIG 128 /* Don't ask !$@#% ... */
20 #define _COMPAT_NSIG_BPW 32
21 typedef u32 compat_sigset_word;
23 #include <asm-generic/compat.h>
25 #define COMPAT_USER_HZ 100
26 #define COMPAT_UTS_MACHINE "mips\0\0\0"
28 typedef u32 compat_dev_t;
29 typedef u32 compat_nlink_t;
30 typedef s32 compat_ipc_pid_t;
39 compat_mode_t st_mode;
40 compat_nlink_t st_nlink;
41 __compat_uid_t st_uid;
42 __compat_gid_t st_gid;
47 old_time32_t st_atime;
49 old_time32_t st_mtime;
51 old_time32_t st_ctime;
72 struct compat_flock64 {
75 compat_loff_t l_start;
80 struct compat_statfs {
95 #define COMPAT_RLIM_INFINITY 0x7fffffffUL
97 #define COMPAT_OFF_T_MAX 0x7fffffff
99 struct compat_ipc64_perm {
101 __compat_uid32_t uid;
102 __compat_gid32_t gid;
103 __compat_uid32_t cuid;
104 __compat_gid32_t cgid;
107 unsigned short __pad2;
108 compat_ulong_t __unused1;
109 compat_ulong_t __unused2;
112 struct compat_semid64_ds {
113 struct compat_ipc64_perm sem_perm;
114 compat_ulong_t sem_otime;
115 compat_ulong_t sem_ctime;
116 compat_ulong_t sem_nsems;
117 compat_ulong_t sem_otime_high;
118 compat_ulong_t sem_ctime_high;
121 struct compat_msqid64_ds {
122 struct compat_ipc64_perm msg_perm;
123 #ifndef CONFIG_CPU_LITTLE_ENDIAN
124 compat_ulong_t msg_stime_high;
126 compat_ulong_t msg_stime;
127 #ifdef CONFIG_CPU_LITTLE_ENDIAN
128 compat_ulong_t msg_stime_high;
130 #ifndef CONFIG_CPU_LITTLE_ENDIAN
131 compat_ulong_t msg_rtime_high;
133 compat_ulong_t msg_rtime;
134 #ifdef CONFIG_CPU_LITTLE_ENDIAN
135 compat_ulong_t msg_rtime_high;
137 #ifndef CONFIG_CPU_LITTLE_ENDIAN
138 compat_ulong_t msg_ctime_high;
140 compat_ulong_t msg_ctime;
141 #ifdef CONFIG_CPU_LITTLE_ENDIAN
142 compat_ulong_t msg_ctime_high;
144 compat_ulong_t msg_cbytes;
145 compat_ulong_t msg_qnum;
146 compat_ulong_t msg_qbytes;
147 compat_pid_t msg_lspid;
148 compat_pid_t msg_lrpid;
149 compat_ulong_t __unused4;
150 compat_ulong_t __unused5;
153 struct compat_shmid64_ds {
154 struct compat_ipc64_perm shm_perm;
155 compat_size_t shm_segsz;
156 compat_ulong_t shm_atime;
157 compat_ulong_t shm_dtime;
158 compat_ulong_t shm_ctime;
159 compat_pid_t shm_cpid;
160 compat_pid_t shm_lpid;
161 compat_ulong_t shm_nattch;
162 compat_ushort_t shm_atime_high;
163 compat_ushort_t shm_dtime_high;
164 compat_ushort_t shm_ctime_high;
165 compat_ushort_t __unused2;
168 /* MIPS has unusual order of fields in stack_t */
169 typedef struct compat_sigaltstack {
171 compat_size_t ss_size;
174 #define compat_sigaltstack compat_sigaltstack
176 static inline int is_compat_task(void)
178 return test_thread_flag(TIF_32BIT_ADDR);
181 #endif /* _ASM_COMPAT_H */