1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_SPARC64_COMPAT_H
3 #define _ASM_SPARC64_COMPAT_H
5 * Architecture specific compatibility types
7 #include <linux/types.h>
9 #define compat_mode_t compat_mode_t
10 typedef u16 compat_mode_t
;
12 #define __compat_uid_t __compat_uid_t
13 typedef u16 __compat_uid_t
;
14 typedef u16 __compat_gid_t
;
16 #define compat_dev_t compat_dev_t
17 typedef u16 compat_dev_t
;
19 #define compat_ipc_pid_t compat_ipc_pid_t
20 typedef u16 compat_ipc_pid_t
;
22 #define compat_ipc64_perm compat_ipc64_perm
24 #define COMPAT_RLIM_INFINITY 0x7fffffff
26 #include <asm-generic/compat.h>
28 #define COMPAT_UTS_MACHINE "sparc\0\0"
30 typedef s16 compat_nlink_t
;
35 compat_mode_t st_mode
;
36 compat_nlink_t st_nlink
;
37 __compat_uid_t st_uid
;
38 __compat_gid_t st_gid
;
41 old_time32_t st_atime
;
42 compat_ulong_t st_atime_nsec
;
43 old_time32_t st_mtime
;
44 compat_ulong_t st_mtime_nsec
;
45 old_time32_t st_ctime
;
46 compat_ulong_t st_ctime_nsec
;
47 compat_off_t st_blksize
;
48 compat_off_t st_blocks
;
52 struct compat_stat64
{
53 unsigned long long st_dev
;
55 unsigned long long st_ino
;
58 unsigned int st_nlink
;
63 unsigned long long st_rdev
;
65 unsigned char __pad3
[8];
68 unsigned int st_blksize
;
70 unsigned char __pad4
[8];
71 unsigned int st_blocks
;
73 unsigned int st_atime
;
74 unsigned int st_atime_nsec
;
76 unsigned int st_mtime
;
77 unsigned int st_mtime_nsec
;
79 unsigned int st_ctime
;
80 unsigned int st_ctime_nsec
;
82 unsigned int __unused4
;
83 unsigned int __unused5
;
86 #define __ARCH_COMPAT_FLOCK_PAD short __unused;
88 struct compat_ipc64_perm
{
92 __compat_uid32_t cuid
;
93 __compat_gid32_t cgid
;
94 unsigned short __pad1
;
96 unsigned short __pad2
;
98 unsigned long __unused1
; /* yes they really are 64bit pads */
99 unsigned long __unused2
;
102 struct compat_semid64_ds
{
103 struct compat_ipc64_perm sem_perm
;
104 unsigned int sem_otime_high
;
105 unsigned int sem_otime
;
106 unsigned int sem_ctime_high
;
107 unsigned int sem_ctime
;
113 struct compat_msqid64_ds
{
114 struct compat_ipc64_perm msg_perm
;
115 unsigned int msg_stime_high
;
116 unsigned int msg_stime
;
117 unsigned int msg_rtime_high
;
118 unsigned int msg_rtime
;
119 unsigned int msg_ctime_high
;
120 unsigned int msg_ctime
;
121 unsigned int msg_cbytes
;
122 unsigned int msg_qnum
;
123 unsigned int msg_qbytes
;
124 compat_pid_t msg_lspid
;
125 compat_pid_t msg_lrpid
;
126 unsigned int __unused1
;
127 unsigned int __unused2
;
130 struct compat_shmid64_ds
{
131 struct compat_ipc64_perm shm_perm
;
132 unsigned int shm_atime_high
;
133 unsigned int shm_atime
;
134 unsigned int shm_dtime_high
;
135 unsigned int shm_dtime
;
136 unsigned int shm_ctime_high
;
137 unsigned int shm_ctime
;
138 compat_size_t shm_segsz
;
139 compat_pid_t shm_cpid
;
140 compat_pid_t shm_lpid
;
141 unsigned int shm_nattch
;
142 unsigned int __unused1
;
143 unsigned int __unused2
;
147 static inline int is_compat_task(void)
149 return test_thread_flag(TIF_32BIT
);
152 static inline bool in_compat_syscall(void)
154 /* Vector 0x110 is LINUX_32BIT_SYSCALL_TRAP */
155 return pt_regs_trap_type(current_pt_regs()) == 0x110;
157 #define in_compat_syscall in_compat_syscall
160 #endif /* _ASM_SPARC64_COMPAT_H */