| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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/>. |
|---|
| 15 | 4 | */ |
|---|
| 16 | 5 | #ifndef __ASM_COMPAT_H |
|---|
| 17 | 6 | #define __ASM_COMPAT_H |
|---|
| 18 | | -#ifdef __KERNEL__ |
|---|
| 7 | + |
|---|
| 8 | +#include <asm-generic/compat.h> |
|---|
| 9 | + |
|---|
| 19 | 10 | #ifdef CONFIG_COMPAT |
|---|
| 20 | 11 | |
|---|
| 21 | 12 | /* |
|---|
| .. | .. |
|---|
| 32 | 23 | #define COMPAT_UTS_MACHINE "armv8l\0\0" |
|---|
| 33 | 24 | #endif |
|---|
| 34 | 25 | |
|---|
| 35 | | -typedef u32 compat_size_t; |
|---|
| 36 | | -typedef s32 compat_ssize_t; |
|---|
| 37 | | -typedef s32 compat_clock_t; |
|---|
| 38 | | -typedef s32 compat_pid_t; |
|---|
| 39 | 26 | typedef u16 __compat_uid_t; |
|---|
| 40 | 27 | typedef u16 __compat_gid_t; |
|---|
| 41 | 28 | typedef u16 __compat_uid16_t; |
|---|
| .. | .. |
|---|
| 43 | 30 | typedef u32 __compat_uid32_t; |
|---|
| 44 | 31 | typedef u32 __compat_gid32_t; |
|---|
| 45 | 32 | typedef u16 compat_mode_t; |
|---|
| 46 | | -typedef u32 compat_ino_t; |
|---|
| 47 | 33 | typedef u32 compat_dev_t; |
|---|
| 48 | | -typedef s32 compat_off_t; |
|---|
| 49 | | -typedef s64 compat_loff_t; |
|---|
| 50 | 34 | typedef s32 compat_nlink_t; |
|---|
| 51 | 35 | typedef u16 compat_ipc_pid_t; |
|---|
| 52 | | -typedef s32 compat_daddr_t; |
|---|
| 53 | 36 | typedef u32 compat_caddr_t; |
|---|
| 54 | 37 | 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; |
|---|
| 67 | 38 | |
|---|
| 68 | 39 | struct compat_stat { |
|---|
| 69 | 40 | #ifdef __AARCH64EB__ |
|---|
| .. | .. |
|---|
| 86 | 57 | compat_off_t st_size; |
|---|
| 87 | 58 | compat_off_t st_blksize; |
|---|
| 88 | 59 | compat_off_t st_blocks; |
|---|
| 89 | | - compat_time_t st_atime; |
|---|
| 60 | + old_time32_t st_atime; |
|---|
| 90 | 61 | compat_ulong_t st_atime_nsec; |
|---|
| 91 | | - compat_time_t st_mtime; |
|---|
| 62 | + old_time32_t st_mtime; |
|---|
| 92 | 63 | compat_ulong_t st_mtime_nsec; |
|---|
| 93 | | - compat_time_t st_ctime; |
|---|
| 64 | + old_time32_t st_ctime; |
|---|
| 94 | 65 | compat_ulong_t st_ctime_nsec; |
|---|
| 95 | 66 | compat_ulong_t __unused4[2]; |
|---|
| 96 | 67 | }; |
|---|
| .. | .. |
|---|
| 140 | 111 | typedef u32 compat_sigset_word; |
|---|
| 141 | 112 | |
|---|
| 142 | 113 | #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 | | -} |
|---|
| 160 | 114 | |
|---|
| 161 | 115 | #define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current))) |
|---|
| 162 | 116 | #define COMPAT_MINSIGSTKSZ 2048 |
|---|
| .. | .. |
|---|
| 242 | 196 | } |
|---|
| 243 | 197 | |
|---|
| 244 | 198 | #endif /* CONFIG_COMPAT */ |
|---|
| 245 | | -#endif /* __KERNEL__ */ |
|---|
| 246 | 199 | #endif /* __ASM_COMPAT_H */ |
|---|