Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  linux/arch/arm/mm/tlbv4.S
0004  *
0005  *  Copyright (C) 1997-2002 Russell King
0006  *
0007  *  ARM architecture version 4 TLB handling functions.
0008  *  These assume a split I/D TLBs, and no write buffer.
0009  *
0010  * Processors: ARM720T
0011  */
0012 #include <linux/linkage.h>
0013 #include <linux/init.h>
0014 #include <asm/assembler.h>
0015 #include <asm/asm-offsets.h>
0016 #include <asm/tlbflush.h>
0017 #include "proc-macros.S"
0018 
0019     .align  5
0020 /*
0021  *  v4_flush_user_tlb_range(start, end, mm)
0022  *
0023  *  Invalidate a range of TLB entries in the specified user address space.
0024  *
0025  *  - start - range start address
0026  *  - end   - range end address
0027  *  - mm    - mm_struct describing address space
0028  */
0029     .align  5
0030 ENTRY(v4_flush_user_tlb_range)
0031     vma_vm_mm ip, r2
0032     act_mm  r3              @ get current->active_mm
0033     eors    r3, ip, r3              @ == mm ?
0034     retne   lr              @ no, we dont do anything
0035 .v4_flush_kern_tlb_range:
0036     bic r0, r0, #0x0ff
0037     bic r0, r0, #0xf00
0038 1:  mcr p15, 0, r0, c8, c7, 1       @ invalidate TLB entry
0039     add r0, r0, #PAGE_SZ
0040     cmp r0, r1
0041     blo 1b
0042     ret lr
0043 
0044 /*
0045  *  v4_flush_kern_tlb_range(start, end)
0046  *
0047  *  Invalidate a range of TLB entries in the specified kernel
0048  *  address range.
0049  *
0050  *  - start - virtual address (may not be aligned)
0051  *  - end   - virtual address (may not be aligned)
0052  */
0053 .globl v4_flush_kern_tlb_range
0054 .equ v4_flush_kern_tlb_range, .v4_flush_kern_tlb_range
0055 
0056     __INITDATA
0057 
0058     /* define struct cpu_tlb_fns (see <asm/tlbflush.h> and proc-macros.S) */
0059     define_tlb_functions v4, v4_tlb_flags