2005-04-17 02:20:36 +04:00
/ *
* linux/ a r c h / a r m / m m / 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 a n d v e r s i o n 5 T L B h a n d l i n g f u n c t i o n s .
* These a s s u m e a s p l i t I / D T L B s , w i t h a w r i t e b u f f e r .
*
* Processors : ARM9 2 0 A R M 9 2 2 A R M 9 2 5 A R M 9 2 6 X S c a l e
* /
# 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 >
2005-09-09 23:08:59 +04:00
# include < a s m / a s m - o f f s e t s . h >
2005-04-17 02:20:36 +04:00
# 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 "
/ *
* v4 w b _ f l u s h _ 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 5
ENTRY( v4 w b i _ 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
vma_ v m _ f l a g s r2 , r2
bic r0 , r0 , #0x0ff
bic r0 , r0 , #0xf00
1 : tst r2 , #V M _ E X E C
mcrne p15 , 0 , r0 , c8 , c5 , 1 @ invalidate I TLB entry
mcr p15 , 0 , r0 , c8 , c6 , 1 @ invalidate D TLB entry
add r0 , r0 , #P A G E _ S Z
cmp r0 , r1
blo 1 b
mov p c , l r
ENTRY( v4 w b i _ 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 , c5 , 1 @ invalidate I TLB entry
mcr p15 , 0 , r0 , c8 , c6 , 1 @ invalidate D TLB entry
add r0 , r0 , #P A G E _ S Z
cmp r0 , r1
blo 1 b
mov p c , l r
_ _ INITDATA
.type v4 w b i _ t l b _ f n s , #o b j e c t
ENTRY( v4 w b i _ t l b _ f n s )
.long v4wbi_flush_user_tlb_range
.long v4wbi_flush_kern_tlb_range
.long v4wbi_tlb_flags
.size v4 w b i _ t l b _ f n s , . - v4 w b i _ t l b _ f n s