unify {de,}mangle_poll(), get rid of kernel-side POLL...
[cris-mirror.git] / arch / m68k / include / asm / flat.h
blob4f1d1e373420422542a4ed9d567ae46cd2c59cf6
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * flat.h -- uClinux flat-format executables
4 */
6 #ifndef __M68KNOMMU_FLAT_H__
7 #define __M68KNOMMU_FLAT_H__
9 #include <linux/uaccess.h>
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))
14 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
15 u32 *addr, u32 *persistent)
17 #ifdef CONFIG_CPU_HAS_NO_UNALIGNED
18 return copy_from_user(addr, rp, 4) ? -EFAULT : 0;
19 #else
20 return get_user(*addr, rp);
21 #endif
24 static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
26 #ifdef CONFIG_CPU_HAS_NO_UNALIGNED
27 return copy_to_user(rp, &addr, 4) ? -EFAULT : 0;
28 #else
29 return put_user(addr, rp);
30 #endif
32 #define flat_get_relocate_addr(rel) (rel)
34 static inline int flat_set_persistent(u32 relval, u32 *persistent)
36 return 0;
39 #define FLAT_PLAT_INIT(regs) \
40 do { \
41 if (current->mm) \
42 (regs)->d5 = current->mm->start_data; \
43 } while (0)
45 #endif /* __M68KNOMMU_FLAT_H__ */