Skip to content

Commit 4ebea49

Browse files
committed
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
1 parent 7e8556d commit 4ebea49

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

arch/mips/include/asm/mmu_context.h

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -97,25 +97,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
9797
{
9898
}
9999

100-
101-
/* Normal, classic MIPS get_new_mmu_context */
102-
static inline void
103-
get_new_mmu_context(struct mm_struct *mm)
104-
{
105-
unsigned int cpu;
106-
u64 asid;
107-
108-
cpu = smp_processor_id();
109-
asid = asid_cache(cpu);
110-
111-
if (!((asid += cpu_asid_inc()) & cpu_asid_mask(&cpu_data[cpu]))) {
112-
if (cpu_has_vtag_icache)
113-
flush_icache_all();
114-
local_flush_tlb_all(); /* start new asid cycle */
115-
}
116-
117-
cpu_context(cpu, mm) = asid_cache(cpu) = asid;
118-
}
100+
extern void get_new_mmu_context(struct mm_struct *mm);
119101

120102
/*
121103
* Initialize the context related info for a new mm_struct

arch/mips/mm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55

66
obj-y += cache.o
7+
obj-y += context.o
78
obj-y += extable.o
89
obj-y += fault.o
910
obj-y += gup.o

arch/mips/mm/context.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <linux/mmu_context.h>
3+
4+
void get_new_mmu_context(struct mm_struct *mm)
5+
{
6+
unsigned int cpu;
7+
u64 asid;
8+
9+
cpu = smp_processor_id();
10+
asid = asid_cache(cpu);
11+
12+
if (!((asid += cpu_asid_inc()) & cpu_asid_mask(&cpu_data[cpu]))) {
13+
if (cpu_has_vtag_icache)
14+
flush_icache_all();
15+
local_flush_tlb_all(); /* start new asid cycle */
16+
}
17+
18+
cpu_context(cpu, mm) = asid_cache(cpu) = asid;
19+
}

0 commit comments

Comments
 (0)