hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/arm64/include/asm/compat.h
....@@ -1,21 +1,12 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2012 ARM Ltd.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
12
- *
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
154 */
165 #ifndef __ASM_COMPAT_H
176 #define __ASM_COMPAT_H
18
-#ifdef __KERNEL__
7
+
8
+#include <asm-generic/compat.h>
9
+
1910 #ifdef CONFIG_COMPAT
2011
2112 /*
....@@ -32,10 +23,6 @@
3223 #define COMPAT_UTS_MACHINE "armv8l\0\0"
3324 #endif
3425
35
-typedef u32 compat_size_t;
36
-typedef s32 compat_ssize_t;
37
-typedef s32 compat_clock_t;
38
-typedef s32 compat_pid_t;
3926 typedef u16 __compat_uid_t;
4027 typedef u16 __compat_gid_t;
4128 typedef u16 __compat_uid16_t;
....@@ -43,27 +30,11 @@
4330 typedef u32 __compat_uid32_t;
4431 typedef u32 __compat_gid32_t;
4532 typedef u16 compat_mode_t;
46
-typedef u32 compat_ino_t;
4733 typedef u32 compat_dev_t;
48
-typedef s32 compat_off_t;
49
-typedef s64 compat_loff_t;
5034 typedef s32 compat_nlink_t;
5135 typedef u16 compat_ipc_pid_t;
52
-typedef s32 compat_daddr_t;
5336 typedef u32 compat_caddr_t;
5437 typedef __kernel_fsid_t compat_fsid_t;
55
-typedef s32 compat_key_t;
56
-typedef s32 compat_timer_t;
57
-
58
-typedef s16 compat_short_t;
59
-typedef s32 compat_int_t;
60
-typedef s32 compat_long_t;
61
-typedef s64 compat_s64;
62
-typedef u16 compat_ushort_t;
63
-typedef u32 compat_uint_t;
64
-typedef u32 compat_ulong_t;
65
-typedef u64 compat_u64;
66
-typedef u32 compat_uptr_t;
6738
6839 struct compat_stat {
6940 #ifdef __AARCH64EB__
....@@ -86,11 +57,11 @@
8657 compat_off_t st_size;
8758 compat_off_t st_blksize;
8859 compat_off_t st_blocks;
89
- compat_time_t st_atime;
60
+ old_time32_t st_atime;
9061 compat_ulong_t st_atime_nsec;
91
- compat_time_t st_mtime;
62
+ old_time32_t st_mtime;
9263 compat_ulong_t st_mtime_nsec;
93
- compat_time_t st_ctime;
64
+ old_time32_t st_ctime;
9465 compat_ulong_t st_ctime_nsec;
9566 compat_ulong_t __unused4[2];
9667 };
....@@ -140,23 +111,6 @@
140111 typedef u32 compat_sigset_word;
141112
142113 #define COMPAT_OFF_T_MAX 0x7fffffff
143
-
144
-/*
145
- * A pointer passed in from user mode. This should not
146
- * be used for syscall parameters, just declare them
147
- * as pointers because the syscall entry code will have
148
- * appropriately converted them already.
149
- */
150
-
151
-static inline void __user *compat_ptr(compat_uptr_t uptr)
152
-{
153
- return (void __user *)(unsigned long)uptr;
154
-}
155
-
156
-static inline compat_uptr_t ptr_to_compat(void __user *uptr)
157
-{
158
- return (u32)(unsigned long)uptr;
159
-}
160114
161115 #define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current)))
162116 #define COMPAT_MINSIGSTKSZ 2048
....@@ -242,5 +196,4 @@
242196 }
243197
244198 #endif /* CONFIG_COMPAT */
245
-#endif /* __KERNEL__ */
246199 #endif /* __ASM_COMPAT_H */