Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
acc46c01 | 2 | /* |
4baa9922 | 3 | * arch/arm/include/asm/flat.h -- uClinux flat-format executables |
acc46c01 GU |
4 | */ |
5 | ||
6 | #ifndef __ARM_FLAT_H__ | |
7 | #define __ARM_FLAT_H__ | |
8 | ||
468138d7 AV |
9 | #include <linux/uaccess.h> |
10 | ||
acc46c01 GU |
11 | #define flat_argvp_envp_on_stack() 1 |
12 | #define flat_old_ram_flag(flags) (flags) | |
13 | #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) | |
468138d7 AV |
14 | |
15 | static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, | |
16 | u32 *addr, u32 *persistent) | |
17 | { | |
18 | #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | |
19 | return copy_from_user(addr, rp, 4) ? -EFAULT : 0; | |
20 | #else | |
21 | return get_user(*addr, rp); | |
22 | #endif | |
23 | } | |
24 | ||
25 | static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel) | |
26 | { | |
27 | #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | |
28 | return copy_to_user(rp, &addr, 4) ? -EFAULT : 0; | |
29 | #else | |
30 | return put_user(addr, rp); | |
31 | #endif | |
32 | } | |
33 | ||
acc46c01 | 34 | #define flat_get_relocate_addr(rel) (rel) |
fd3d7285 | 35 | #define flat_set_persistent(relval, p) 0 |
acc46c01 GU |
36 | |
37 | #endif /* __ARM_FLAT_H__ */ |