2 * Based on arch/arm/mm/tlb.S
4 * Copyright (C) 1997-2002 Russell King
5 * Copyright (C) 2012 ARM Ltd.
6 * Written by Catalin Marinas <catalin.marinas@arm.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include <linux/linkage.h>
21 #include <asm/assembler.h>
22 #include <asm/asm-offsets.h>
24 #include <asm/tlbflush.h>
25 #include "proc-macros.S"
28 * __cpu_flush_user_tlb_range(start, end, vma)
30 * Invalidate a range of TLB entries in the specified address space.
32 * - start - start address (may not be aligned)
33 * - end - end address (exclusive, may not be aligned)
34 * - vma - vma_struct describing address range
36 ENTRY(__cpu_flush_user_tlb_range)
37 vma_vm_mm x3, x2 // get vma->vm_mm
38 mmid x3, x3 // get vm_mm->context.id
40 lsr x0, x0, #12 // align address
42 bfi x0, x3, #48, #16 // start VA and ASID
43 bfi x1, x3, #48, #16 // end VA and ASID
44 1: tlbi vae1is, x0 // TLB invalidate by address and ASID
50 ENDPROC(__cpu_flush_user_tlb_range)
53 * __cpu_flush_kern_tlb_range(start,end)
55 * Invalidate a range of kernel TLB entries.
57 * - start - start address (may not be aligned)
58 * - end - end address (exclusive, may not be aligned)
60 ENTRY(__cpu_flush_kern_tlb_range)
62 lsr x0, x0, #12 // align address
64 1: tlbi vaae1is, x0 // TLB invalidate by address
71 ENDPROC(__cpu_flush_kern_tlb_range)