blob: 4dbb177d115010f36e1d0797aca1183dfb62c548 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Jeremy Fitzhardinged6dd61c2007-05-02 19:27:14 +02002/*
Dave Hansen62e88b12014-11-18 10:23:50 -08003 * Define generic no-op hooks for arch_dup_mmap, arch_exit_mmap
4 * and arch_unmap to be included in asm-FOO/mmu_context.h for any
5 * arch FOO which doesn't need to hook these.
Jeremy Fitzhardinged6dd61c2007-05-02 19:27:14 +02006 */
7#ifndef _ASM_GENERIC_MM_HOOKS_H
8#define _ASM_GENERIC_MM_HOOKS_H
9
Thomas Gleixnerc10e83f2017-12-14 12:27:29 +010010static inline int arch_dup_mmap(struct mm_struct *oldmm,
11 struct mm_struct *mm)
Jeremy Fitzhardinged6dd61c2007-05-02 19:27:14 +020012{
Thomas Gleixnerc10e83f2017-12-14 12:27:29 +010013 return 0;
Jeremy Fitzhardinged6dd61c2007-05-02 19:27:14 +020014}
15
16static inline void arch_exit_mmap(struct mm_struct *mm)
17{
18}
19
Dave Hansen62e88b12014-11-18 10:23:50 -080020static inline void arch_unmap(struct mm_struct *mm,
Dave Hansen62e88b12014-11-18 10:23:50 -080021 unsigned long start, unsigned long end)
22{
23}
24
Dave Hansen1b2ee122016-02-12 13:02:21 -080025static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
Dave Hansend61172b2016-02-12 13:02:24 -080026 bool write, bool execute, bool foreign)
Dave Hansen33a709b2016-02-12 13:02:19 -080027{
28 /* by default, allow everything */
29 return true;
30}
Jeremy Fitzhardinged6dd61c2007-05-02 19:27:14 +020031#endif /* _ASM_GENERIC_MM_HOOKS_H */