]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blob - arch/m68k/include/asm/flat.h
binfmt_flat: remove flat_old_ram_flag
[mirror_ubuntu-hirsute-kernel.git] / arch / m68k / include / asm / flat.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * flat.h -- uClinux flat-format executables
4 */
5
6 #ifndef __M68KNOMMU_FLAT_H__
7 #define __M68KNOMMU_FLAT_H__
8
9 #include <linux/uaccess.h>
10
11 #define flat_argvp_envp_on_stack() 1
12 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
13 u32 *addr, u32 *persistent)
14 {
15 #ifdef CONFIG_CPU_HAS_NO_UNALIGNED
16 return copy_from_user(addr, rp, 4) ? -EFAULT : 0;
17 #else
18 return get_user(*addr, rp);
19 #endif
20 }
21
22 static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
23 {
24 #ifdef CONFIG_CPU_HAS_NO_UNALIGNED
25 return copy_to_user(rp, &addr, 4) ? -EFAULT : 0;
26 #else
27 return put_user(addr, rp);
28 #endif
29 }
30
31 #define FLAT_PLAT_INIT(regs) \
32 do { \
33 if (current->mm) \
34 (regs)->d5 = current->mm->start_data; \
35 } while (0)
36
37 #endif /* __M68KNOMMU_FLAT_H__ */