^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Define generic no-op hooks for arch_dup_mmap, arch_exit_mmap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * and arch_unmap to be included in asm-FOO/mmu_context.h for any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * arch FOO which doesn't need to hook these.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #ifndef _ASM_GENERIC_MM_HOOKS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define _ASM_GENERIC_MM_HOOKS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) static inline int arch_dup_mmap(struct mm_struct *oldmm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) struct mm_struct *mm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) static inline void arch_exit_mmap(struct mm_struct *mm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) static inline void arch_unmap(struct mm_struct *mm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) unsigned long start, unsigned long end)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) bool write, bool execute, bool foreign)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) /* by default, allow everything */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #endif /* _ASM_GENERIC_MM_HOOKS_H */