2009-03-25 13:10:01 +02:00
/ *
* linux/ a r c h / a r m / m m / t l b - f a . S
*
* Copyright ( C ) 2 0 0 5 F a r a d a y C o r p .
* Copyright ( C ) 2 0 0 8 - 2 0 0 9 P a u l i u s Z a l e c k a s < p a u l i u s . z a l e c k a s @teltonika.lt>
*
* Based o n t l b - v4 w b i . S :
* Copyright ( C ) 1 9 9 7 - 2 0 0 2 R u s s e l l K i n g
*
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify
* it u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e v e r s i o n 2 a s
* published b y t h e F r e e S o f t w a r e F o u n d a t i o n .
*
* ARM a r c h i t e c t u r e v e r s i o n 4 , F a r a d a y v a r i a t i o n .
* This a s s u m e a n u n i f i e d T L B s , w i t h a w r i t e b u f f e r , a n d b r a n c h t a r g e t b u f f e r ( B T B )
*
* Processors : FA5 2 0 F A 5 2 6 F A 6 2 6
* /
# include < l i n u x / l i n k a g e . h >
# include < l i n u x / i n i t . h >
# include < a s m / a s m - o f f s e t s . h >
# include < a s m / t l b f l u s h . h >
# include " p r o c - m a c r o s . S "
/ *
* flush_ u s e r _ t l b _ r a n g e ( s t a r t , e n d , m m )
*
* Invalidate a r a n g e o f T L B e n t r i e s i n t h e s p e c i f i e d a d d r e s s s p a c e .
*
* - start - r a n g e s t a r t a d d r e s s
* - end - r a n g e e n d a d d r e s s
* - mm - m m _ s t r u c t d e s c r i b i n g a d d r e s s s p a c e
* /
.align 4
ENTRY( f a _ f l u s h _ u s e r _ t l b _ r a n g e )
vma_ v m _ m m i p , r2
act_ m m r3 @ get current->active_mm
eors r3 , i p , r3 @ == mm ?
movne p c , l r @ no, we dont do anything
mov r3 , #0
mcr p15 , 0 , r3 , c7 , c10 , 4 @ drain WB
bic r0 , r0 , #0x0ff
bic r0 , r0 , #0xf00
1 : mcr p15 , 0 , r0 , c8 , c7 , 1 @ invalidate UTLB entry
add r0 , r0 , #P A G E _ S Z
cmp r0 , r1
blo 1 b
mcr p15 , 0 , r3 , c7 , c10 , 4 @ data write barrier
mov p c , l r
ENTRY( f a _ f l u s h _ k e r n _ t l b _ r a n g e )
mov r3 , #0
mcr p15 , 0 , r3 , c7 , c10 , 4 @ drain WB
bic r0 , r0 , #0x0ff
bic r0 , r0 , #0xf00
1 : mcr p15 , 0 , r0 , c8 , c7 , 1 @ invalidate UTLB entry
add r0 , r0 , #P A G E _ S Z
cmp r0 , r1
blo 1 b
mcr p15 , 0 , r3 , c7 , c10 , 4 @ data write barrier
2011-07-05 09:01:13 +01:00
mcr p15 , 0 , r3 , c7 , c5 , 4 @ prefetch flush (isb)
2009-03-25 13:10:01 +02:00
mov p c , l r
_ _ INITDATA
2011-06-23 17:28:50 +01:00
/* define struct cpu_tlb_fns (see <asm/tlbflush.h> and proc-macros.S) */
define_ t l b _ f u n c t i o n s f a , f a _ t l b _ f l a g s