Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Jeremy Fitzhardinge | d6dd61c | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 2 | /* |
Dave Hansen | 62e88b1 | 2014-11-18 10:23:50 -0800 | [diff] [blame] | 3 | * 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 Fitzhardinge | d6dd61c | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 6 | */ |
| 7 | #ifndef _ASM_GENERIC_MM_HOOKS_H |
| 8 | #define _ASM_GENERIC_MM_HOOKS_H |
| 9 | |
Thomas Gleixner | c10e83f | 2017-12-14 12:27:29 +0100 | [diff] [blame] | 10 | static inline int arch_dup_mmap(struct mm_struct *oldmm, |
| 11 | struct mm_struct *mm) |
Jeremy Fitzhardinge | d6dd61c | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 12 | { |
Thomas Gleixner | c10e83f | 2017-12-14 12:27:29 +0100 | [diff] [blame] | 13 | return 0; |
Jeremy Fitzhardinge | d6dd61c | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | static inline void arch_exit_mmap(struct mm_struct *mm) |
| 17 | { |
| 18 | } |
| 19 | |
Dave Hansen | 62e88b1 | 2014-11-18 10:23:50 -0800 | [diff] [blame] | 20 | static inline void arch_unmap(struct mm_struct *mm, |
Dave Hansen | 62e88b1 | 2014-11-18 10:23:50 -0800 | [diff] [blame] | 21 | unsigned long start, unsigned long end) |
| 22 | { |
| 23 | } |
| 24 | |
Dave Hansen | 1b2ee12 | 2016-02-12 13:02:21 -0800 | [diff] [blame] | 25 | static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, |
Dave Hansen | d61172b | 2016-02-12 13:02:24 -0800 | [diff] [blame] | 26 | bool write, bool execute, bool foreign) |
Dave Hansen | 33a709b | 2016-02-12 13:02:19 -0800 | [diff] [blame] | 27 | { |
| 28 | /* by default, allow everything */ |
| 29 | return true; |
| 30 | } |
Jeremy Fitzhardinge | d6dd61c | 2007-05-02 19:27:14 +0200 | [diff] [blame] | 31 | #endif /* _ASM_GENERIC_MM_HOOKS_H */ |