MIPS: mm: Un-inline get_new_mmu_context
authorPaul Burton <paul.burton@mips.com>
Sat, 2 Feb 2019 01:43:24 +0000 (01:43 +0000)
committerPaul Burton <paul.burton@mips.com>
Mon, 4 Feb 2019 18:56:28 +0000 (10:56 -0800)
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
arch/mips/include/asm/mmu_context.h
arch/mips/mm/Makefile
arch/mips/mm/context.c [new file with mode: 0644]

index 752ebda..cb39a39 100644 (file)
@@ -97,25 +97,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
 {
 }
 
-
-/* Normal, classic MIPS get_new_mmu_context */
-static inline 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;
-}
+extern void get_new_mmu_context(struct mm_struct *mm);
 
 /*
  * Initialize the context related info for a new mm_struct
index 25d4927..f34d7ff 100644 (file)
@@ -4,6 +4,7 @@
 #
 
 obj-y                          += cache.o
+obj-y                          += context.o
 obj-y                          += extable.o
 obj-y                          += fault.o
 obj-y                          += gup.o
diff --git a/arch/mips/mm/context.c b/arch/mips/mm/context.c
new file mode 100644 (file)
index 0000000..b5af471
--- /dev/null
@@ -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;
+}