License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-block.git] / arch / m68k / include / asm / flat.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1da177e4 2/*
120c4d95 3 * flat.h -- uClinux flat-format executables
1da177e4
LT
4 */
5
6#ifndef __M68KNOMMU_FLAT_H__
7#define __M68KNOMMU_FLAT_H__
8
468138d7
AV
9#include <linux/uaccess.h>
10
1da177e4
LT
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
14static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
15 u32 *addr, u32 *persistent)
16{
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
22}
23
24static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel)
25{
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
31}
1da177e4 32#define flat_get_relocate_addr(rel) (rel)
f106eac9 33
9f42ef4b 34static inline int flat_set_persistent(u32 relval, u32 *persistent)
f106eac9
EG
35{
36 return 0;
37}
1da177e4 38
89e6ffd9
GU
39#define FLAT_PLAT_INIT(regs) \
40 do { \
41 if (current->mm) \
42 (regs)->d5 = current->mm->start_data; \
43 } while (0)
44
1da177e4 45#endif /* __M68KNOMMU_FLAT_H__ */