1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_PARISC_COMPAT_H
3 #define _ASM_PARISC_COMPAT_H
5 * Architecture specific compatibility types
7 #include <linux/types.h>
8 #include <linux/sched.h>
9 #include <linux/thread_info.h>
11 #define compat_mode_t compat_mode_t
12 typedef u16 compat_mode_t;
14 #include <asm-generic/compat.h>
16 #define COMPAT_USER_HZ 100
17 #define COMPAT_UTS_MACHINE "parisc\0\0"
19 typedef u32 __compat_uid_t;
20 typedef u32 __compat_gid_t;
21 typedef u32 compat_dev_t;
22 typedef u16 compat_nlink_t;
23 typedef u16 compat_ipc_pid_t;
26 compat_dev_t st_dev; /* dev_t is 32 bits on parisc */
27 compat_ino_t st_ino; /* 32 bits */
28 compat_mode_t st_mode; /* 16 bits */
29 compat_nlink_t st_nlink; /* 16 bits */
30 u16 st_reserved1; /* old st_uid */
31 u16 st_reserved2; /* old st_gid */
34 old_time32_t st_atime;
36 old_time32_t st_mtime;
38 old_time32_t st_ctime;
42 u32 __unused1; /* ACL stuff */
43 compat_dev_t __unused2; /* network */
44 compat_ino_t __unused3; /* network */
45 u32 __unused4; /* cnodes */
46 u16 __unused5; /* netsite */
48 compat_dev_t st_realdev;
51 __compat_uid32_t st_uid;
52 __compat_gid32_t st_gid;
64 struct compat_flock64 {
67 compat_loff_t l_start;
72 struct compat_statfs {
80 __kernel_fsid_t f_fsid;
87 struct compat_sigcontext {
88 compat_int_t sc_flags;
89 compat_int_t sc_gr[32]; /* PSW in sc_gr[0] */
91 compat_int_t sc_iasq[2];
92 compat_int_t sc_iaoq[2];
93 compat_int_t sc_sar; /* cr11 */
96 #define COMPAT_RLIM_INFINITY 0xffffffff
98 #define COMPAT_OFF_T_MAX 0x7fffffff
100 struct compat_ipc64_perm {
106 unsigned short int __pad1;
108 unsigned short int __pad2;
109 unsigned short int seq;
111 unsigned long __unused1; /* yes they really are 64bit pads */
112 unsigned long __unused2;
115 struct compat_semid64_ds {
116 struct compat_ipc64_perm sem_perm;
117 unsigned int sem_otime_high;
118 unsigned int sem_otime;
119 unsigned int sem_ctime_high;
120 unsigned int sem_ctime;
121 compat_ulong_t sem_nsems;
122 compat_ulong_t __unused3;
123 compat_ulong_t __unused4;
126 struct compat_msqid64_ds {
127 struct compat_ipc64_perm msg_perm;
128 unsigned int msg_stime_high;
129 unsigned int msg_stime;
130 unsigned int msg_rtime_high;
131 unsigned int msg_rtime;
132 unsigned int msg_ctime_high;
133 unsigned int msg_ctime;
134 compat_ulong_t msg_cbytes;
135 compat_ulong_t msg_qnum;
136 compat_ulong_t msg_qbytes;
137 compat_pid_t msg_lspid;
138 compat_pid_t msg_lrpid;
139 compat_ulong_t __unused4;
140 compat_ulong_t __unused5;
143 struct compat_shmid64_ds {
144 struct compat_ipc64_perm shm_perm;
145 unsigned int shm_atime_high;
146 unsigned int shm_atime;
147 unsigned int shm_dtime_high;
148 unsigned int shm_dtime;
149 unsigned int shm_ctime_high;
150 unsigned int shm_ctime;
151 unsigned int __unused4;
152 compat_size_t shm_segsz;
153 compat_pid_t shm_cpid;
154 compat_pid_t shm_lpid;
155 compat_ulong_t shm_nattch;
156 compat_ulong_t __unused5;
157 compat_ulong_t __unused6;
161 * The type of struct elf_prstatus.pr_reg in compatible core dumps.
163 #define COMPAT_ELF_NGREG 80
164 typedef compat_ulong_t compat_elf_gregset_t[COMPAT_ELF_NGREG];
166 static __inline__ void __user *arch_compat_alloc_user_space(long len)
168 struct pt_regs *regs = ¤t->thread.regs;
169 return (void __user *)regs->gr[30];
172 static inline int __is_compat_task(struct task_struct *t)
174 return test_tsk_thread_flag(t, TIF_32BIT);
177 static inline int is_compat_task(void)
179 return __is_compat_task(current);
182 #endif /* _ASM_PARISC_COMPAT_H */