1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/unicore32/mm/tlb-ucv2.S
5 * Code specific to PKUnity SoC and UniCore ISA
7 * Copyright (C) 2001-2010 GUAN Xue-tao
9 #include <linux/init.h>
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
13 #include <asm/tlbflush.h>
14 #include "proc-macros.S"
17 * __cpu_flush_user_tlb_range(start, end, vma)
19 * Invalidate a range of TLB entries in the specified address space.
21 * - start - start address (may not be aligned)
22 * - end - end address (exclusive, may not be aligned)
23 * - vma - vma_struct describing address range
25 ENTRY(__cpu_flush_user_tlb_range)
26 #ifndef CONFIG_CPU_TLB_SINGLE_ENTRY_DISABLE
27 mov r0, r0 >> #PAGE_SHIFT @ align address
28 mov r0, r0 << #PAGE_SHIFT
29 vma_vm_flags r2, r2 @ get vma->vm_flags
34 cand.a r2, #VM_EXEC @ Executable area ?
47 cand.a r2, #VM_EXEC @ Executable area ?
57 * __cpu_flush_kern_tlb_range(start,end)
59 * Invalidate a range of kernel TLB entries
61 * - start - start address (may not be aligned)
62 * - end - end address (exclusive, may not be aligned)
64 ENTRY(__cpu_flush_kern_tlb_range)
65 #ifndef CONFIG_CPU_TLB_SINGLE_ENTRY_DISABLE
66 mov r0, r0 >> #PAGE_SHIFT @ align address
67 mov r0, r0 << #PAGE_SHIFT