1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_COMPAT_H
3 #define _ASM_POWERPC_COMPAT_H
6 * Architecture specific compatibility types
8 #include <linux/types.h>
9 #include <linux/sched.h>
11 #include <asm-generic/compat.h>
13 #define COMPAT_USER_HZ 100
15 #define COMPAT_UTS_MACHINE "ppc\0\0"
17 #define COMPAT_UTS_MACHINE "ppcle\0\0"
20 typedef u32 __compat_uid_t;
21 typedef u32 __compat_gid_t;
22 typedef u32 compat_dev_t;
23 typedef s16 compat_nlink_t;
24 typedef u16 compat_ipc_pid_t;
25 typedef __kernel_fsid_t compat_fsid_t;
30 compat_mode_t st_mode;
31 compat_nlink_t st_nlink;
32 __compat_uid32_t st_uid;
33 __compat_gid32_t st_gid;
36 compat_off_t st_blksize;
37 compat_off_t st_blocks;
38 old_time32_t st_atime;
40 old_time32_t st_mtime;
42 old_time32_t st_ctime;
55 #define F_GETLK64 12 /* using 'struct flock64' */
59 struct compat_flock64 {
62 compat_loff_t l_start;
67 struct compat_statfs {
76 int f_namelen; /* SunOS ignores this field. */
82 #define COMPAT_RLIM_INFINITY 0xffffffff
84 #define COMPAT_OFF_T_MAX 0x7fffffff
87 * ipc64_perm is actually 32/64bit clean but since the compat layer refers to
88 * it we may as well define it.
90 struct compat_ipc64_perm {
99 unsigned long __unused1; /* yes they really are 64bit pads */
100 unsigned long __unused2;
103 struct compat_semid64_ds {
104 struct compat_ipc64_perm sem_perm;
105 unsigned int sem_otime_high;
106 unsigned int sem_otime;
107 unsigned int sem_ctime_high;
108 unsigned int sem_ctime;
109 compat_ulong_t sem_nsems;
110 compat_ulong_t __unused3;
111 compat_ulong_t __unused4;
114 struct compat_msqid64_ds {
115 struct compat_ipc64_perm msg_perm;
116 unsigned int msg_stime_high;
117 unsigned int msg_stime;
118 unsigned int msg_rtime_high;
119 unsigned int msg_rtime;
120 unsigned int msg_ctime_high;
121 unsigned int msg_ctime;
122 compat_ulong_t msg_cbytes;
123 compat_ulong_t msg_qnum;
124 compat_ulong_t msg_qbytes;
125 compat_pid_t msg_lspid;
126 compat_pid_t msg_lrpid;
127 compat_ulong_t __unused4;
128 compat_ulong_t __unused5;
131 struct compat_shmid64_ds {
132 struct compat_ipc64_perm shm_perm;
133 unsigned int shm_atime_high;
134 unsigned int shm_atime;
135 unsigned int shm_dtime_high;
136 unsigned int shm_dtime;
137 unsigned int shm_ctime_high;
138 unsigned int shm_ctime;
139 unsigned int __unused4;
140 compat_size_t shm_segsz;
141 compat_pid_t shm_cpid;
142 compat_pid_t shm_lpid;
143 compat_ulong_t shm_nattch;
144 compat_ulong_t __unused5;
145 compat_ulong_t __unused6;
148 static inline int is_compat_task(void)
150 return is_32bit_task();
153 #endif /* __KERNEL__ */
154 #endif /* _ASM_POWERPC_COMPAT_H */