Merge tag 'omap-for-v4.14/fixes-not-urgent-dt-signed' of git://git.kernel.org/pub...
[sfrench/cifs-2.6.git] / arch / arm / include / asm / flat.h
1 /*
2  * arch/arm/include/asm/flat.h -- uClinux flat-format executables
3  */
4
5 #ifndef __ARM_FLAT_H__
6 #define __ARM_FLAT_H__
7
8 #include <linux/uaccess.h>
9
10 #define flat_argvp_envp_on_stack()              1
11 #define flat_old_ram_flag(flags)                (flags)
12 #define flat_reloc_valid(reloc, size)           ((reloc) <= (size))
13
14 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
15                                         u32 *addr, u32 *persistent)
16 {
17 #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
18         return copy_from_user(addr, rp, 4) ? -EFAULT : 0;
19 #else
20         return get_user(*addr, rp);
21 #endif
22 }
23
24 static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
25 {
26 #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
27         return copy_to_user(rp, &addr, 4) ? -EFAULT : 0;
28 #else
29         return put_user(addr, rp);
30 #endif
31 }
32
33 #define flat_get_relocate_addr(rel)             (rel)
34 #define flat_set_persistent(relval, p)          0
35
36 #endif /* __ARM_FLAT_H__ */