/*1* Miscellaneous low-level MMU functions.2*3* Copyright (C) 2008-2009 Michal Simek <[email protected]>4* Copyright (C) 2008-2009 PetaLogix5* Copyright (C) 2007 Xilinx, Inc. All rights reserved.6*7* Derived from arch/ppc/kernel/misc.S8*9* This file is subject to the terms and conditions of the GNU General10* Public License. See the file COPYING in the main directory of this11* archive for more details.12*/1314#include <linux/linkage.h>15#include <linux/sys.h>16#include <asm/unistd.h>17#include <linux/errno.h>18#include <asm/mmu.h>19#include <asm/page.h>2021.text22/*23* Flush MMU TLB24*25* We avoid flushing the pinned 0, 1 and possibly 2 entries.26*/27.globl _tlbia;28.type _tlbia, @function29.align 4;30_tlbia:31lwi r12, r0, tlb_skip;32/* isync */33_tlbia_1:34mts rtlbx, r1235nop36mts rtlbhi, r0 /* flush: ensure V is clear */37nop38rsubi r11, r12, MICROBLAZE_TLB_SIZE - 139bneid r11, _tlbia_1 /* loop for all entries */40addik r12, r12, 141mbar 1 /* sync */42rtsd r15, 843nop44.size _tlbia, . - _tlbia4546/*47* Flush MMU TLB for a particular address (in r5)48*/49.globl _tlbie;50.type _tlbie, @function51.align 4;52_tlbie:53mts rtlbsx, r5 /* look up the address in TLB */54nop55mfs r12, rtlbx /* Retrieve index */56nop57blti r12, _tlbie_1 /* Check if found */58mts rtlbhi, r0 /* flush: ensure V is clear */59nop60mbar 1 /* sync */61_tlbie_1:62rtsd r15, 863nop6465.size _tlbie, . - _tlbie666768