forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/arch/um/include/asm/mmu_context.h
....@@ -1,6 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3
- * Licensed under the GPL
44 */
55
66 #ifndef __UM_MMU_CONTEXT_H
....@@ -8,6 +8,7 @@
88
99 #include <linux/sched.h>
1010 #include <linux/mm_types.h>
11
+#include <linux/mmap_lock.h>
1112
1213 #include <asm/mmu.h>
1314
....@@ -22,15 +23,9 @@
2223 }
2324 extern void arch_exit_mmap(struct mm_struct *mm);
2425 static inline void arch_unmap(struct mm_struct *mm,
25
- struct vm_area_struct *vma,
2626 unsigned long start, unsigned long end)
2727 {
2828 }
29
-static inline void arch_bprm_mm_init(struct mm_struct *mm,
30
- struct vm_area_struct *vma)
31
-{
32
-}
33
-
3429 static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
3530 bool write, bool execute, bool foreign)
3631 {
....@@ -53,9 +48,9 @@
5348 * when the new ->mm is used for the first time.
5449 */
5550 __switch_mm(&new->context.id);
56
- down_write_nested(&new->mmap_sem, 1);
51
+ mmap_write_lock_nested(new, SINGLE_DEPTH_NESTING);
5752 uml_setup_stubs(new);
58
- up_write(&new->mmap_sem);
53
+ mmap_write_unlock(new);
5954 }
6055
6156 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,