/*1* linux/arch/unicore32/mm/tlb-ucv2.S2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Copyright (C) 2001-2010 GUAN Xue-tao6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*/11#include <linux/init.h>12#include <linux/linkage.h>13#include <asm/assembler.h>14#include <asm/page.h>15#include <asm/tlbflush.h>16#include "proc-macros.S"1718/*19* __cpu_flush_user_tlb_range(start, end, vma)20*21* Invalidate a range of TLB entries in the specified address space.22*23* - start - start address (may not be aligned)24* - end - end address (exclusive, may not be aligned)25* - vma - vma_struct describing address range26*/27ENTRY(__cpu_flush_user_tlb_range)28#ifndef CONFIG_CPU_TLB_SINGLE_ENTRY_DISABLE29mov r0, r0 >> #PAGE_SHIFT @ align address30mov r0, r0 << #PAGE_SHIFT31vma_vm_flags r2, r2 @ get vma->vm_flags321:33movc p0.c6, r0, #334nop83536cand.a r2, #VM_EXEC @ Executable area ?37beq 2f3839movc p0.c6, r0, #540nop8412:42add r0, r0, #PAGE_SZ43csub.a r0, r144beb 1b45#else46movc p0.c6, r0, #247nop84849cand.a r2, #VM_EXEC @ Executable area ?50beq 2f5152movc p0.c6, r0, #453nop8542:55#endif56mov pc, lr5758/*59* __cpu_flush_kern_tlb_range(start,end)60*61* Invalidate a range of kernel TLB entries62*63* - start - start address (may not be aligned)64* - end - end address (exclusive, may not be aligned)65*/66ENTRY(__cpu_flush_kern_tlb_range)67#ifndef CONFIG_CPU_TLB_SINGLE_ENTRY_DISABLE68mov r0, r0 >> #PAGE_SHIFT @ align address69mov r0, r0 << #PAGE_SHIFT701:71movc p0.c6, r0, #372nop87374movc p0.c6, r0, #575nop87677add r0, r0, #PAGE_SZ78csub.a r0, r179beb 1b80#else81movc p0.c6, r0, #282nop88384movc p0.c6, r0, #485nop886#endif87mov pc, lr88899091