-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIPS: mm: Un-inline get_new_mmu_context
In preparation for adding MMID support to get_new_mmu_context() which will increase the size of the function somewhat, move it from asm/mmu_context.h into a C file. Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: linux-mips@vger.kernel.org
- Loading branch information
Paul Burton
committed
Feb 4, 2019
1 parent
7e8556d
commit 4ebea49
Showing
3 changed files
with
21 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
# | ||
|
||
obj-y += cache.o | ||
obj-y += context.o | ||
obj-y += extable.o | ||
obj-y += fault.o | ||
obj-y += gup.o | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
#include <linux/mmu_context.h> | ||
|
||
void get_new_mmu_context(struct mm_struct *mm) | ||
{ | ||
unsigned int cpu; | ||
u64 asid; | ||
|
||
cpu = smp_processor_id(); | ||
asid = asid_cache(cpu); | ||
|
||
if (!((asid += cpu_asid_inc()) & cpu_asid_mask(&cpu_data[cpu]))) { | ||
if (cpu_has_vtag_icache) | ||
flush_icache_all(); | ||
local_flush_tlb_all(); /* start new asid cycle */ | ||
} | ||
|
||
cpu_context(cpu, mm) = asid_cache(cpu) = asid; | ||
} |