2019-06-04 11:11:33 +03:00
/* SPDX-License-Identifier: GPL-2.0-only */
2011-01-15 13:18:29 +03:00
/ *
* linux/ a r c h / u n i c o r e 3 2 / m m / t l b - u c v2 . S
*
* Code s p e c i f i c t o P K U n i t y S o C a n d U n i C o r e I S A
*
* Copyright ( C ) 2 0 0 1 - 2 0 1 0 G U A N X u e - t a o
* /
# include < l i n u x / i n i t . h >
# include < l i n u x / l i n k a g e . h >
# include < a s m / a s s e m b l e r . h >
# include < a s m / p a g e . 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 "
/ *
* _ _ cpu_ 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 , v m a )
*
* 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 - s t a r t a d d r e s s ( m a y n o t b e a l i g n e d )
* - end - e n d a d d r e s s ( e x c l u s i v e , m a y n o t b e a l i g n e d )
* - vma - v m a _ s t r u c t d e s c r i b i n g a d d r e s s r a n g e
* /
ENTRY( _ _ c p u _ f l u s h _ u s e r _ t l b _ r a n g e )
# ifndef C O N F I G _ C P U _ T L B _ S I N G L E _ E N T R Y _ D I S A B L E
mov r0 , r0 > > #P A G E _ S H I F T @ a l i g n a d d r e s s
mov r0 , r0 < < #P A G E _ S H I F T
vma_ v m _ f l a g s r2 , r2 @ get vma->vm_flags
1 :
movc p0 . c6 , r0 , #3
nop8
cand. a r2 , #V M _ E X E C @ E x e c u t a b l e a r e a ?
beq 2 f
movc p0 . c6 , r0 , #5
nop8
2 :
add r0 , r0 , #P A G E _ S Z
csub. a r0 , r1
beb 1 b
# else
movc p0 . c6 , r0 , #2
nop8
cand. a r2 , #V M _ E X E C @ E x e c u t a b l e a r e a ?
beq 2 f
movc p0 . c6 , r0 , #4
nop8
2 :
# endif
mov p c , l r
/ *
* _ _ cpu_ f l u s h _ k e r n _ t l b _ r a n g e ( s t a r t ,e n d )
*
* Invalidate a r a n g e o f k e r n e l T L B e n t r i e s
*
* - start - s t a r t a d d r e s s ( m a y n o t b e a l i g n e d )
* - end - e n d a d d r e s s ( e x c l u s i v e , m a y n o t b e a l i g n e d )
* /
ENTRY( _ _ c p u _ f l u s h _ k e r n _ t l b _ r a n g e )
# ifndef C O N F I G _ C P U _ T L B _ S I N G L E _ E N T R Y _ D I S A B L E
mov r0 , r0 > > #P A G E _ S H I F T @ a l i g n a d d r e s s
mov r0 , r0 < < #P A G E _ S H I F T
1 :
movc p0 . c6 , r0 , #3
nop8
movc p0 . c6 , r0 , #5
nop8
add r0 , r0 , #P A G E _ S Z
csub. a r0 , r1
beb 1 b
# else
movc p0 . c6 , r0 , #2
nop8
movc p0 . c6 , r0 , #4
nop8
# endif
mov p c , l r