root/arch/mips/kernel/tlb.S

/* [previous][next][first][last][top][bottom][index][help] */
   1 /*
   2  * arch/mips/kernel/head.S
   3  *
   4  * Copyright (C) 1994 Waldorf Electronics
   5  * Written by Ralf Baechle and Andreas Busse
   6  *
   7  * Head.S contains the MIPS exception handler and startup code.
   8  * Flush the TLB
   9  *
  10  * FIXME: knows only how to handle R4x00
  11  * Read appendix f of the R4000 manual before you change something!
  12  */
  13 
  14 #include <asm/mipsregs.h>
  15 #include <asm/regdef.h>
  16 #include <asm/bootinfo.h>
  17 
  18                 .globl  _tlbflush
  19 _tlbflush:      li      t0,PM_4K
  20                 mtc0    t0,CP0_PAGEMASK
  21                 lw      t0,_boot_info+OFFSET_BOOTINFO_TLB_ENTRIES(t0)
  22         li      t0,48
  23                 dmtc0   zero,CP0_ENTRYLO0
  24                 dmtc0   zero,CP0_ENTRYLO1
  25                 mfc0    t2,CP0_WIRED
  26 1:              subu    t0,t0,1
  27                 mtc0    t0,CP0_INDEX
  28                 lui     t1,0x0008
  29                 or      t1,t0,t1
  30                 dsll    t1,t1,13
  31                 dmtc0   t1,CP0_ENTRYHI
  32                 bne     t2,t0,1b
  33                 tlbwi                                   # delay slot
  34                 jr      ra
  35                 nop

/* [previous][next][first][last][top][bottom][index][help] */