2019-05-24 13:04:10 +03:00
/* SPDX-License-Identifier: GPL-2.0-or-later */
2005-04-17 02:20:36 +04:00
/ *
* PARISC T L B a n d c a c h e f l u s h i n g s u p p o r t
* Copyright ( C ) 2 0 0 0 - 2 0 0 1 H e w l e t t - P a c k a r d ( J o h n M a r v i n )
* Copyright ( C ) 2 0 0 1 M a t t h e w W i l c o x ( w i l l y a t p a r i s c - l i n u x . o r g )
* Copyright ( C ) 2 0 0 2 R i c h a r d H i r s t ( r h i r s t w i t h p a r i s c - l i n u x . o r g )
* /
/ *
* NOTE : fdc,f i c , a n d p d c i n s t r u c t i o n s t h a t u s e b a s e r e g i s t e r m o d i f i c a t i o n
* should o n l y u s e i n d e x a n d b a s e r e g i s t e r s t h a t a r e n o t s h a d o w e d ,
* so t h a t t h e f a s t p a t h e m u l a t i o n i n t h e n o n a c c e s s m i s s h a n d l e r
* can b e u s e d .
* /
2005-10-22 06:46:48 +04:00
# ifdef C O N F I G _ 6 4 B I T
2005-04-17 02:20:36 +04:00
.level 2 .0w
# else
.level 2 .0
# endif
# include < a s m / p s w . h >
2005-10-22 06:40:07 +04:00
# include < a s m / a s s e m b l y . h >
2005-04-17 02:20:36 +04:00
# include < a s m / p g t a b l e . h >
# include < a s m / c a c h e . h >
2018-01-02 22:36:44 +03:00
# include < a s m / l d c w . h >
2018-10-16 23:38:22 +03:00
# include < a s m / a l t e r n a t i v e . h >
2007-01-25 00:36:32 +03:00
# include < l i n u x / l i n k a g e . h >
2018-04-10 19:55:13 +03:00
# include < l i n u x / i n i t . h >
2005-04-17 02:20:36 +04:00
2018-04-10 19:55:13 +03:00
.section .text .hot
.align 16
2005-04-17 02:20:36 +04:00
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ t l b _ a l l _ l o c a l )
2005-04-17 02:20:36 +04:00
/ *
* The p i t l b e a n d p d t l b e i n s t r u c t i o n s s h o u l d o n l y b e u s e d t o
* flush t h e e n t i r e t l b . A l s o , t h e r e n e e d s t o b e n o i n t e r v e n i n g
* tlb o p e r a t i o n s , e . g . t l b m i s s e s , s o t h e o p e r a t i o n n e e d s
* to h a p p e n i n r e a l m o d e w i t h a l l i n t e r r u p t i o n s d i s a b l e d .
* /
2005-10-22 06:40:07 +04:00
/* pcxt_ssm_bug - relied upon translation! PA 2.0 Arch. F-4 and F-5 */
2006-04-21 00:40:23 +04:00
rsm P S W _ S M _ I , % r19 / * s a v e I - b i t s t a t e * /
2005-10-22 06:40:07 +04:00
load3 2 P A ( 1 f ) , % r1
2005-04-17 02:20:36 +04:00
nop
nop
nop
nop
nop
2005-10-22 06:40:07 +04:00
rsm P S W _ S M _ Q , % r0 / * p r e p t o l o a d i i a q u e u e * /
2005-04-17 02:20:36 +04:00
mtctl % r0 , % c r17 / * C l e a r I I A S Q t a i l * /
mtctl % r0 , % c r17 / * C l e a r I I A S Q h e a d * /
mtctl % r1 , % c r18 / * I I A O Q h e a d * /
ldo 4 ( % r1 ) , % r1
mtctl % r1 , % c r18 / * I I A O Q t a i l * /
2005-10-22 06:40:07 +04:00
load3 2 R E A L _ M O D E _ P S W , % r1
mtctl % r1 , % i p s w
2005-04-17 02:20:36 +04:00
rfi
nop
2006-04-21 00:40:23 +04:00
1 : load3 2 P A ( c a c h e _ i n f o ) , % r1
2005-04-17 02:20:36 +04:00
/* Flush Instruction Tlb */
2019-07-21 01:55:48 +03:00
88 : LDREG I T L B _ S I D _ B A S E ( % r1 ) , % r20
2005-04-17 02:20:36 +04:00
LDREG I T L B _ S I D _ S T R I D E ( % r1 ) , % r21
LDREG I T L B _ S I D _ C O U N T ( % r1 ) , % r22
LDREG I T L B _ O F F _ B A S E ( % r1 ) , % a r g 0
LDREG I T L B _ O F F _ S T R I D E ( % r1 ) , % a r g 1
LDREG I T L B _ O F F _ C O U N T ( % r1 ) , % a r g 2
LDREG I T L B _ L O O P ( % r1 ) , % a r g 3
2008-05-15 18:53:57 +04:00
addib,C O N D ( = ) - 1 , % a r g 3 , f i t o n e l o o p / * P r e a d j u s t a n d t e s t * /
2005-04-17 02:20:36 +04:00
movb,< ,n % a r g 3 , % r31 , f i t d o n e / * I f l o o p < 0 , s k i p * /
copy % a r g 0 , % r28 / * I n i t b a s e a d d r * /
fitmanyloop : /* Loop if LOOP >= 2 */
mtsp % r20 , % s r1
add % r21 , % r20 , % r20 / * i n c r e m e n t s p a c e * /
copy % a r g 2 , % r29 / * I n i t m i d d l e l o o p c o u n t * /
fitmanymiddle : /* Loop if LOOP >= 2 */
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r31 , f i t m a n y m i d d l e / * A d j u s t e d i n n e r l o o p d e c r * /
2016-11-25 04:18:14 +03:00
pitlbe % r0 ( % s r1 , % r28 )
2005-04-17 02:20:36 +04:00
pitlbe,m % a r g 1 ( % s r1 , % r28 ) / * L a s t p i t l b e a n d a d d r a d j u s t * /
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r29 , f i t m a n y m i d d l e / * M i d d l e l o o p d e c r * /
2005-04-17 02:20:36 +04:00
copy % a r g 3 , % r31 / * R e - i n i t i n n e r l o o p c o u n t * /
movb,t r % a r g 0 , % r28 , f i t m a n y l o o p / * R e - i n i t b a s e a d d r * /
2008-05-15 18:53:57 +04:00
addib,C O N D ( < = ) ,n - 1 , % r22 , f i t d o n e / * O u t e r l o o p c o u n t d e c r * /
2005-04-17 02:20:36 +04:00
fitoneloop : /* Loop if LOOP = 1 */
mtsp % r20 , % s r1
copy % a r g 0 , % r28 / * i n i t b a s e a d d r * /
copy % a r g 2 , % r29 / * i n i t m i d d l e l o o p c o u n t * /
fitonemiddle : /* Loop if LOOP = 1 */
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r29 , f i t o n e m i d d l e / * M i d d l e l o o p c o u n t d e c r * /
2005-04-17 02:20:36 +04:00
pitlbe,m % a r g 1 ( % s r1 , % r28 ) / * p i t l b e f o r o n e l o o p * /
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r22 , f i t o n e l o o p / * O u t e r l o o p c o u n t d e c r * /
2005-04-17 02:20:36 +04:00
add % r21 , % r20 , % r20 / * i n c r e m e n t s p a c e * /
fitdone :
2019-07-21 01:55:48 +03:00
ALTERNATIVE( 8 8 b , f i t d o n e , A L T _ C O N D _ N O _ S P L I T _ T L B , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
/* Flush Data Tlb */
LDREG D T L B _ S I D _ B A S E ( % r1 ) , % r20
LDREG D T L B _ S I D _ S T R I D E ( % r1 ) , % r21
LDREG D T L B _ S I D _ C O U N T ( % r1 ) , % r22
LDREG D T L B _ O F F _ B A S E ( % r1 ) , % a r g 0
LDREG D T L B _ O F F _ S T R I D E ( % r1 ) , % a r g 1
LDREG D T L B _ O F F _ C O U N T ( % r1 ) , % a r g 2
LDREG D T L B _ L O O P ( % r1 ) , % a r g 3
2008-05-15 18:53:57 +04:00
addib,C O N D ( = ) - 1 , % a r g 3 , f d t o n e l o o p / * P r e a d j u s t a n d t e s t * /
2005-04-17 02:20:36 +04:00
movb,< ,n % a r g 3 , % r31 , f d t d o n e / * I f l o o p < 0 , s k i p * /
copy % a r g 0 , % r28 / * I n i t b a s e a d d r * /
fdtmanyloop : /* Loop if LOOP >= 2 */
mtsp % r20 , % s r1
add % r21 , % r20 , % r20 / * i n c r e m e n t s p a c e * /
copy % a r g 2 , % r29 / * I n i t m i d d l e l o o p c o u n t * /
fdtmanymiddle : /* Loop if LOOP >= 2 */
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r31 , f d t m a n y m i d d l e / * A d j u s t e d i n n e r l o o p d e c r * /
2016-11-25 04:18:14 +03:00
pdtlbe % r0 ( % s r1 , % r28 )
2005-04-17 02:20:36 +04:00
pdtlbe,m % a r g 1 ( % s r1 , % r28 ) / * L a s t p d t l b e a n d a d d r a d j u s t * /
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r29 , f d t m a n y m i d d l e / * M i d d l e l o o p d e c r * /
2005-04-17 02:20:36 +04:00
copy % a r g 3 , % r31 / * R e - i n i t i n n e r l o o p c o u n t * /
movb,t r % a r g 0 , % r28 , f d t m a n y l o o p / * R e - i n i t b a s e a d d r * /
2008-05-15 18:53:57 +04:00
addib,C O N D ( < = ) ,n - 1 , % r22 ,f d t d o n e / * O u t e r l o o p c o u n t d e c r * /
2005-04-17 02:20:36 +04:00
fdtoneloop : /* Loop if LOOP = 1 */
mtsp % r20 , % s r1
copy % a r g 0 , % r28 / * i n i t b a s e a d d r * /
copy % a r g 2 , % r29 / * i n i t m i d d l e l o o p c o u n t * /
fdtonemiddle : /* Loop if LOOP = 1 */
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r29 , f d t o n e m i d d l e / * M i d d l e l o o p c o u n t d e c r * /
2005-04-17 02:20:36 +04:00
pdtlbe,m % a r g 1 ( % s r1 , % r28 ) / * p d t l b e f o r o n e l o o p * /
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r22 , f d t o n e l o o p / * O u t e r l o o p c o u n t d e c r * /
2005-04-17 02:20:36 +04:00
add % r21 , % r20 , % r20 / * i n c r e m e n t s p a c e * /
2005-10-22 06:40:07 +04:00
fdtdone :
/ *
* Switch b a c k t o v i r t u a l m o d e
* /
/* pcxt_ssm_bug */
rsm P S W _ S M _ I , % r0
load3 2 2 f , % r1
nop
nop
nop
nop
nop
2005-04-17 02:20:36 +04:00
2005-10-22 06:40:07 +04:00
rsm P S W _ S M _ Q , % r0 / * p r e p t o l o a d i i a q u e u e * /
2005-04-17 02:20:36 +04:00
mtctl % r0 , % c r17 / * C l e a r I I A S Q t a i l * /
mtctl % r0 , % c r17 / * C l e a r I I A S Q h e a d * /
mtctl % r1 , % c r18 / * I I A O Q h e a d * /
ldo 4 ( % r1 ) , % r1
mtctl % r1 , % c r18 / * I I A O Q t a i l * /
2005-10-22 06:40:07 +04:00
load3 2 K E R N E L _ P S W , % r1
or % r1 , % r19 , % r1 / * I - b i t t o s t a t e o n e n t r y * /
mtctl % r1 , % i p s w / * r e s t o r e I - b i t ( e n t i r e P S W ) * /
2005-04-17 02:20:36 +04:00
rfi
nop
2 : bv % r0 ( % r2 )
nop
2019-08-12 20:13:20 +03:00
/ *
* When r u n n i n g i n q e m u , d r o p w h o l e f l u s h _ t l b _ a l l _ l o c a l f u n c t i o n a n d
* replace b y o n e p d t l b e i n s t r u c t i o n , f o r w h i c h Q E M U w i l l d r o p a l l
* local T L B e n t r i e s .
* /
3 : pdtlbe % r0 ( % s r1 ,% r0 )
bv,n % r0 ( % r2 )
ALTERNATIVE_ C O D E ( f l u s h _ t l b _ a l l _ l o c a l , 2 , A L T _ C O N D _ R U N _ O N _ Q E M U , 3 b )
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ t l b _ a l l _ l o c a l )
2005-04-17 02:20:36 +04:00
.import cache_ i n f o ,d a t a
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ i n s t r u c t i o n _ c a c h e _ l o c a l )
2018-10-16 23:38:22 +03:00
88 : load3 2 c a c h e _ i n f o , % r1
2005-04-17 02:20:36 +04:00
/* Flush Instruction Cache */
LDREG I C A C H E _ B A S E ( % r1 ) , % a r g 0
LDREG I C A C H E _ S T R I D E ( % r1 ) , % a r g 1
LDREG I C A C H E _ C O U N T ( % r1 ) , % a r g 2
LDREG I C A C H E _ L O O P ( % r1 ) , % a r g 3
2013-02-04 03:00:54 +04:00
rsm P S W _ S M _ I , % r22 / * N o m m g t o p s d u r i n g l o o p * /
mtsp % r0 , % s r1
2008-05-15 18:53:57 +04:00
addib,C O N D ( = ) - 1 , % a r g 3 , f i o n e l o o p / * P r e a d j u s t a n d t e s t * /
2005-04-17 02:20:36 +04:00
movb,< ,n % a r g 3 , % r31 , f i s y n c / * I f l o o p < 0 , d o s y n c * /
fimanyloop : /* Loop if LOOP >= 2 */
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r31 , f i m a n y l o o p / * A d j u s t e d i n n e r l o o p d e c r * /
2005-10-22 06:55:51 +04:00
fice % r0 ( % s r1 , % a r g 0 )
2005-04-17 02:20:36 +04:00
fice,m % a r g 1 ( % s r1 , % a r g 0 ) / * L a s t f i c e a n d a d d r a d j u s t * /
movb,t r % a r g 3 , % r31 , f i m a n y l o o p / * R e - i n i t i n n e r l o o p c o u n t * /
2008-05-15 18:53:57 +04:00
addib,C O N D ( < = ) ,n - 1 , % a r g 2 , f i s y n c / * O u t e r l o o p d e c r * /
2005-04-17 02:20:36 +04:00
fioneloop : /* Loop if LOOP = 1 */
2013-02-04 03:00:54 +04:00
/* Some implementations may flush with a single fice instruction */
cmpib,C O N D ( > > = ) ,n 1 5 , % a r g 2 , f i o n e l o o p2
fioneloop1 :
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
fice,m % a r g 1 ( % s r1 , % a r g 0 )
addib,C O N D ( > ) - 1 6 , % a r g 2 , f i o n e l o o p1
fice,m % a r g 1 ( % s r1 , % a r g 0 )
/* Check if done */
cmpb,C O N D ( = ) ,n % a r g 2 , % r0 , f i s y n c / * P r e d i c t b r a n c h t a k e n * /
fioneloop2 :
addib,C O N D ( > ) - 1 , % a r g 2 , f i o n e l o o p2 / * O u t e r l o o p c o u n t d e c r * /
2005-04-17 02:20:36 +04:00
fice,m % a r g 1 ( % s r1 , % a r g 0 ) / * F i c e f o r o n e l o o p * /
fisync :
sync
2005-10-22 06:40:07 +04:00
mtsm % r22 / * r e s t o r e I - b i t * /
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ I C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ i n s t r u c t i o n _ c a c h e _ l o c a l )
2005-04-17 02:20:36 +04:00
2007-01-25 00:36:32 +03:00
.import cache_ i n f o , d a t a
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ d a t a _ c a c h e _ l o c a l )
2018-10-16 23:38:22 +03:00
88 : load3 2 c a c h e _ i n f o , % r1
2005-04-17 02:20:36 +04:00
/* Flush Data Cache */
LDREG D C A C H E _ B A S E ( % r1 ) , % a r g 0
LDREG D C A C H E _ S T R I D E ( % r1 ) , % a r g 1
LDREG D C A C H E _ C O U N T ( % r1 ) , % a r g 2
LDREG D C A C H E _ L O O P ( % r1 ) , % a r g 3
2013-02-04 03:00:54 +04:00
rsm P S W _ S M _ I , % r22 / * N o m m g t o p s d u r i n g l o o p * /
mtsp % r0 , % s r1
2008-05-15 18:53:57 +04:00
addib,C O N D ( = ) - 1 , % a r g 3 , f d o n e l o o p / * P r e a d j u s t a n d t e s t * /
2005-04-17 02:20:36 +04:00
movb,< ,n % a r g 3 , % r31 , f d s y n c / * I f l o o p < 0 , d o s y n c * /
fdmanyloop : /* Loop if LOOP >= 2 */
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r31 , f d m a n y l o o p / * A d j u s t e d i n n e r l o o p d e c r * /
2005-10-22 06:55:51 +04:00
fdce % r0 ( % s r1 , % a r g 0 )
2005-04-17 02:20:36 +04:00
fdce,m % a r g 1 ( % s r1 , % a r g 0 ) / * L a s t f d c e a n d a d d r a d j u s t * /
movb,t r % a r g 3 , % r31 , f d m a n y l o o p / * R e - i n i t i n n e r l o o p c o u n t * /
2008-05-15 18:53:57 +04:00
addib,C O N D ( < = ) ,n - 1 , % a r g 2 , f d s y n c / * O u t e r l o o p d e c r * /
2005-04-17 02:20:36 +04:00
fdoneloop : /* Loop if LOOP = 1 */
2013-02-04 03:00:54 +04:00
/* Some implementations may flush with a single fdce instruction */
cmpib,C O N D ( > > = ) ,n 1 5 , % a r g 2 , f d o n e l o o p2
fdoneloop1 :
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
addib,C O N D ( > ) - 1 6 , % a r g 2 , f d o n e l o o p1
fdce,m % a r g 1 ( % s r1 , % a r g 0 )
/* Check if done */
cmpb,C O N D ( = ) ,n % a r g 2 , % r0 , f d s y n c / * P r e d i c t b r a n c h t a k e n * /
fdoneloop2 :
addib,C O N D ( > ) - 1 , % a r g 2 , f d o n e l o o p2 / * O u t e r l o o p c o u n t d e c r * /
2005-04-17 02:20:36 +04:00
fdce,m % a r g 1 ( % s r1 , % a r g 0 ) / * F d c e f o r o n e l o o p * /
fdsync :
syncdma
sync
2005-10-22 06:40:07 +04:00
mtsm % r22 / * r e s t o r e I - b i t * /
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ D C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ d a t a _ c a c h e _ l o c a l )
2005-04-17 02:20:36 +04:00
2013-02-04 03:00:54 +04:00
/* Clear page using kernel mapping. */
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( c l e a r _ p a g e _ a s m )
2013-02-04 03:00:54 +04:00
# ifdef C O N F I G _ 6 4 B I T
/* Unroll the loop. */
ldi ( P A G E _ S I Z E / 1 2 8 ) , % r1
1 :
std % r0 , 0 ( % r26 )
std % r0 , 8 ( % r26 )
std % r0 , 1 6 ( % r26 )
std % r0 , 2 4 ( % r26 )
std % r0 , 3 2 ( % r26 )
std % r0 , 4 0 ( % r26 )
std % r0 , 4 8 ( % r26 )
std % r0 , 5 6 ( % r26 )
std % r0 , 6 4 ( % r26 )
std % r0 , 7 2 ( % r26 )
std % r0 , 8 0 ( % r26 )
std % r0 , 8 8 ( % r26 )
std % r0 , 9 6 ( % r26 )
std % r0 , 1 0 4 ( % r26 )
std % r0 , 1 1 2 ( % r26 )
std % r0 , 1 2 0 ( % r26 )
/* Note reverse branch hint for addib is taken. */
addib,C O N D ( > ) ,n - 1 , % r1 , 1 b
ldo 1 2 8 ( % r26 ) , % r26
# else
/ *
* Note t h a t u n t i l ( i f ) w e s t a r t s a v i n g t h e f u l l 6 4 - b i t r e g i s t e r
* values o n i n t e r r u p t , w e c a n ' t u s e s t d o n a 3 2 b i t k e r n e l .
* /
ldi ( P A G E _ S I Z E / 6 4 ) , % r1
1 :
stw % r0 , 0 ( % r26 )
stw % r0 , 4 ( % r26 )
stw % r0 , 8 ( % r26 )
stw % r0 , 1 2 ( % r26 )
stw % r0 , 1 6 ( % r26 )
stw % r0 , 2 0 ( % r26 )
stw % r0 , 2 4 ( % r26 )
stw % r0 , 2 8 ( % r26 )
stw % r0 , 3 2 ( % r26 )
stw % r0 , 3 6 ( % r26 )
stw % r0 , 4 0 ( % r26 )
stw % r0 , 4 4 ( % r26 )
stw % r0 , 4 8 ( % r26 )
stw % r0 , 5 2 ( % r26 )
stw % r0 , 5 6 ( % r26 )
stw % r0 , 6 0 ( % r26 )
addib,C O N D ( > ) ,n - 1 , % r1 , 1 b
ldo 6 4 ( % r26 ) , % r26
# endif
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( c l e a r _ p a g e _ a s m )
2013-02-04 03:00:54 +04:00
/* Copy page using kernel mapping. */
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( c o p y _ p a g e _ a s m )
2005-10-22 06:46:48 +04:00
# ifdef C O N F I G _ 6 4 B I T
2005-04-17 02:20:36 +04:00
/ * PA8 x00 C P U s c a n c o n s u m e 2 l o a d s o r 1 s t o r e p e r c y c l e .
* Unroll t h e l o o p b y h a n d a n d a r r a n g e i n s n a p p r o p r i a t e l y .
2013-02-04 03:00:54 +04:00
* Prefetch d o e s n ' t i m p r o v e p e r f o r m a n c e o n r p34 4 0 .
* GCC p r o b a b l y c a n d o t h i s j u s t a s w e l l . . .
2005-04-17 02:20:36 +04:00
* /
2007-10-18 11:04:50 +04:00
ldi ( P A G E _ S I Z E / 1 2 8 ) , % r1
2006-04-21 00:40:23 +04:00
2013-02-04 03:00:54 +04:00
1 : ldd 0 ( % r25 ) , % r19
ldd 8 ( % r25 ) , % r20
2005-04-17 02:20:36 +04:00
ldd 1 6 ( % r25 ) , % r21
ldd 2 4 ( % r25 ) , % r22
std % r19 , 0 ( % r26 )
std % r20 , 8 ( % r26 )
ldd 3 2 ( % r25 ) , % r19
ldd 4 0 ( % r25 ) , % r20
std % r21 , 1 6 ( % r26 )
std % r22 , 2 4 ( % r26 )
ldd 4 8 ( % r25 ) , % r21
ldd 5 6 ( % r25 ) , % r22
std % r19 , 3 2 ( % r26 )
std % r20 , 4 0 ( % r26 )
ldd 6 4 ( % r25 ) , % r19
ldd 7 2 ( % r25 ) , % r20
std % r21 , 4 8 ( % r26 )
std % r22 , 5 6 ( % r26 )
ldd 8 0 ( % r25 ) , % r21
ldd 8 8 ( % r25 ) , % r22
std % r19 , 6 4 ( % r26 )
std % r20 , 7 2 ( % r26 )
ldd 9 6 ( % r25 ) , % r19
ldd 1 0 4 ( % r25 ) , % r20
std % r21 , 8 0 ( % r26 )
std % r22 , 8 8 ( % r26 )
ldd 1 1 2 ( % r25 ) , % r21
ldd 1 2 0 ( % r25 ) , % r22
2013-02-04 03:00:54 +04:00
ldo 1 2 8 ( % r25 ) , % r25
2005-04-17 02:20:36 +04:00
std % r19 , 9 6 ( % r26 )
std % r20 , 1 0 4 ( % r26 )
std % r21 , 1 1 2 ( % r26 )
std % r22 , 1 2 0 ( % r26 )
2013-02-04 03:00:54 +04:00
/* Note reverse branch hint for addib is taken. */
addib,C O N D ( > ) ,n - 1 , % r1 , 1 b
ldo 1 2 8 ( % r26 ) , % r26
2005-04-17 02:20:36 +04:00
# else
/ *
* This l o o p i s o p t i m i z e d f o r P C X L / P C X L 2 l d w / l d w a n d s t w / s t w
* bundles ( v e r y r e s t r i c t e d r u l e s f o r b u n d l i n g ) .
* Note t h a t u n t i l ( i f ) w e s t a r t s a v i n g
* the f u l l 6 4 b i t r e g i s t e r v a l u e s o n i n t e r r u p t , w e c a n ' t
* use l d d / s t d o n a 3 2 b i t k e r n e l .
* /
2005-10-22 06:55:34 +04:00
ldw 0 ( % r25 ) , % r19
2007-10-18 11:04:50 +04:00
ldi ( P A G E _ S I Z E / 6 4 ) , % r1
2005-04-17 02:20:36 +04:00
1 :
ldw 4 ( % r25 ) , % r20
ldw 8 ( % r25 ) , % r21
ldw 1 2 ( % r25 ) , % r22
stw % r19 , 0 ( % r26 )
stw % r20 , 4 ( % r26 )
stw % r21 , 8 ( % r26 )
stw % r22 , 1 2 ( % r26 )
ldw 1 6 ( % r25 ) , % r19
ldw 2 0 ( % r25 ) , % r20
ldw 2 4 ( % r25 ) , % r21
ldw 2 8 ( % r25 ) , % r22
stw % r19 , 1 6 ( % r26 )
stw % r20 , 2 0 ( % r26 )
stw % r21 , 2 4 ( % r26 )
stw % r22 , 2 8 ( % r26 )
ldw 3 2 ( % r25 ) , % r19
ldw 3 6 ( % r25 ) , % r20
ldw 4 0 ( % r25 ) , % r21
ldw 4 4 ( % r25 ) , % r22
stw % r19 , 3 2 ( % r26 )
stw % r20 , 3 6 ( % r26 )
stw % r21 , 4 0 ( % r26 )
stw % r22 , 4 4 ( % r26 )
ldw 4 8 ( % r25 ) , % r19
ldw 5 2 ( % r25 ) , % r20
ldw 5 6 ( % r25 ) , % r21
ldw 6 0 ( % r25 ) , % r22
stw % r19 , 4 8 ( % r26 )
stw % r20 , 5 2 ( % r26 )
2005-10-22 06:55:34 +04:00
ldo 6 4 ( % r25 ) , % r25
2005-04-17 02:20:36 +04:00
stw % r21 , 5 6 ( % r26 )
stw % r22 , 6 0 ( % r26 )
ldo 6 4 ( % r26 ) , % r26
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) ,n - 1 , % r1 , 1 b
2005-10-22 06:55:34 +04:00
ldw 0 ( % r25 ) , % r19
2005-04-17 02:20:36 +04:00
# endif
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( c o p y _ p a g e _ a s m )
2005-04-17 02:20:36 +04:00
/ *
* NOTE : Code i n c l e a r _ u s e r _ p a g e h a s a h a r d c o d e d d e p e n d e n c y o n t h e
* maximum a l i a s b o u n d a r y b e i n g 4 M b . W e ' v e b e e n a s s u r e d b y t h e
* parisc c h i p d e s i g n e r s t h a t t h e r e w i l l n o t e v e r b e a p a r i s c
* chip w i t h a l a r g e r a l i a s b o u n d a r y ( N e v e r s a y n e v e r : - ) ) .
*
* Subtle : the d t l b m i s s h a n d l e r s s u p p o r t t h e t e m p a l i a s r e g i o n b y
* " knowing" t h a t i f a d t l b m i s s h a p p e n s w i t h i n t h e t e m p a l i a s
* region i t m u s t h a v e o c c u r r e d w h i l e i n c l e a r _ u s e r _ p a g e . S i n c e
* this r o u t i n e m a k e s u s e o f p r o c e s s o r l o c a l t r a n s l a t i o n s , w e
* don' t w a n t t o i n s e r t t h e m i n t o t h e k e r n e l p a g e t a b l e . I n s t e a d ,
* we l o a d u p s o m e g e n e r a l r e g i s t e r s ( t h e y n e e d t o b e r e g i s t e r s
* which a r e n ' t s h a d o w e d ) w i t h t h e p h y s i c a l p a g e n u m b e r s ( p r e s h i f t e d
* for t l b i n s e r t i o n ) n e e d e d t o i n s e r t t h e t r a n s l a t i o n s . W h e n w e
* miss o n t h e t r a n s l a t i o n , t h e d t l b m i s s h a n d l e r i n s e r t s t h e
* translation i n t o t h e t l b u s i n g t h e s e v a l u e s :
*
* % r2 6 p h y s i c a l p a g e ( s h i f t e d f o r t l b i n s e r t ) o f " t o " t r a n s l a t i o n
* % r2 3 p h y s i c a l p a g e ( s h i f t e d f o r t l b i n s e r t ) o f " f r o m " t r a n s l a t i o n
* /
2013-05-03 00:41:45 +04:00
/* Drop prot bits and convert to page addr for iitlbt and idtlbt */
# define P A G E _ A D D _ S H I F T ( P A G E _ S H I F T - 1 2 )
.macro convert_phys_for_tlb_insert20 phys
extrd,u \ p h y s , 5 6 - P A G E _ A D D _ S H I F T , 3 2 - P A G E _ A D D _ S H I F T , \ p h y s
# if _ P A G E _ S I Z E _ E N C O D I N G _ D E F A U L T
depdi _ P A G E _ S I Z E _ E N C O D I N G _ D E F A U L T , 6 3 , ( 6 3 - 5 8 ) , \ p h y s
# endif
.endm
2005-04-17 02:20:36 +04:00
/ *
2016-09-20 19:59:39 +03:00
* copy_ u s e r _ p a g e _ a s m ( ) p e r f o r m s a p a g e c o p y u s i n g m a p p i n g s
* equivalent t o t h e u s e r p a g e m a p p i n g s . I t c a n b e u s e d t o
* implement c o p y _ u s e r _ p a g e ( ) b u t u n f o r t u n a t e l y b o t h t h e ` f r o m '
* and ` t o ' p a g e s n e e d t o b e f l u s h e d t h r o u g h m a p p i n g s e q u i v a l e n t
* to t h e u s e r m a p p i n g s a f t e r t h e c o p y b e c a u s e t h e k e r n e l a c c e s s e s
* the ` f r o m ' p a g e t h r o u g h t h e k m a p k e r n e l m a p p i n g a n d t h e ` t o '
* page n e e d s t o b e f l u s h e d s i n c e c o d e c a n b e c o p i e d . A s a
* result, t h i s i m p l e m e n t a t i o n i s l e s s e f f i c i e n t t h a n t h e s i m p l e r
* copy u s i n g t h e k e r n e l m a p p i n g . I t o n l y n e e d s t h e ` f r o m ' p a g e
* to f l u s h e d v i a t h e u s e r m a p p i n g . T h e k u n m a p r o u t i n e s h a n d l e
* the f l u s h e s n e e d e d f o r t h e k e r n e l m a p p i n g .
2005-04-17 02:20:36 +04:00
*
* I' m s t i l l k e e p i n g t h i s a r o u n d b e c a u s e i t m a y b e p o s s i b l e t o
* use i t i f m o r e i n f o r m a t i o n i s p a s s e d i n t o c o p y _ u s e r _ p a g e ( ) .
* Have t o d o s o m e m e a s u r e m e n t s t o s e e i f i t i s w o r t h w h i l e t o
* lobby f o r s u c h a c h a n g e .
2013-02-04 03:00:54 +04:00
*
2005-04-17 02:20:36 +04:00
* /
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( c o p y _ u s e r _ p a g e _ a s m )
2013-02-04 03:00:54 +04:00
/ * Convert v i r t u a l ` t o ' a n d ` f r o m ' a d d r e s s e s t o p h y s i c a l a d d r e s s e s .
Move ` f r o m ' p h y s i c a l a d d r e s s t o n o n s h a d o w e d r e g i s t e r . * /
2005-04-17 02:20:36 +04:00
ldil L % ( _ _ P A G E _ O F F S E T ) , % r1
sub % r26 , % r1 , % r26
2013-02-04 03:00:54 +04:00
sub % r25 , % r1 , % r23
2005-04-17 02:20:36 +04:00
ldil L % ( T M P A L I A S _ M A P _ S T A R T ) , % r28
2005-10-22 06:46:48 +04:00
# ifdef C O N F I G _ 6 4 B I T
2013-02-04 03:00:54 +04:00
# if ( T M P A L I A S _ M A P _ S T A R T > = 0 x80 0 0 0 0 0 0 )
depdi 0 , 3 1 ,3 2 , % r28 / * c l e a r a n y s i g n e x t e n s i o n * /
# endif
2013-05-03 00:41:45 +04:00
convert_ p h y s _ f o r _ t l b _ i n s e r t 2 0 % r26 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
convert_ p h y s _ f o r _ t l b _ i n s e r t 2 0 % r23 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
2013-02-04 03:00:54 +04:00
depd % r24 ,6 3 ,2 2 , % r28 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' t o ' * /
2013-05-17 00:51:41 +04:00
depdi 0 , 6 3 ,P A G E _ S H I F T , % r28 / * C l e a r a n y o f f s e t b i t s * /
2005-04-17 02:20:36 +04:00
copy % r28 , % r29
depdi 1 , 4 1 ,1 , % r29 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' f r o m ' * /
# else
extrw,u % r26 , 2 4 ,2 5 , % r26 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
extrw,u % r23 , 2 4 ,2 5 , % r23 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
depw % r24 , 3 1 ,2 2 , % r28 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' t o ' * /
2013-05-17 00:51:41 +04:00
depwi 0 , 3 1 ,P A G E _ S H I F T , % r28 / * C l e a r a n y o f f s e t b i t s * /
2005-04-17 02:20:36 +04:00
copy % r28 , % r29
depwi 1 , 9 ,1 , % r29 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' f r o m ' * /
# endif
/* Purge any old translations */
2013-02-04 03:00:54 +04:00
# ifdef C O N F I G _ P A 2 0
2016-11-25 04:18:14 +03:00
pdtlb,l % r0 ( % r28 )
pdtlb,l % r0 ( % r29 )
2013-02-04 03:00:54 +04:00
# else
2018-10-16 23:38:22 +03:00
0 : pdtlb % r0 ( % r28 )
1 : pdtlb % r0 ( % r29 )
ALTERNATIVE( 0 b , 0 b + 4 , A L T _ C O N D _ N O _ S M P , I N S N _ P x T L B )
ALTERNATIVE( 1 b , 1 b + 4 , A L T _ C O N D _ N O _ S M P , I N S N _ P x T L B )
2013-02-04 03:00:54 +04:00
# endif
# ifdef C O N F I G _ 6 4 B I T
/ * PA8 x00 C P U s c a n c o n s u m e 2 l o a d s o r 1 s t o r e p e r c y c l e .
* Unroll t h e l o o p b y h a n d a n d a r r a n g e i n s n a p p r o p r i a t e l y .
* GCC p r o b a b l y c a n d o t h i s j u s t a s w e l l .
* /
2005-04-17 02:20:36 +04:00
2013-02-04 03:00:54 +04:00
ldd 0 ( % r29 ) , % r19
ldi ( P A G E _ S I Z E / 1 2 8 ) , % r1
1 : ldd 8 ( % r29 ) , % r20
ldd 1 6 ( % r29 ) , % r21
ldd 2 4 ( % r29 ) , % r22
std % r19 , 0 ( % r28 )
std % r20 , 8 ( % r28 )
ldd 3 2 ( % r29 ) , % r19
ldd 4 0 ( % r29 ) , % r20
std % r21 , 1 6 ( % r28 )
std % r22 , 2 4 ( % r28 )
ldd 4 8 ( % r29 ) , % r21
ldd 5 6 ( % r29 ) , % r22
std % r19 , 3 2 ( % r28 )
std % r20 , 4 0 ( % r28 )
ldd 6 4 ( % r29 ) , % r19
ldd 7 2 ( % r29 ) , % r20
std % r21 , 4 8 ( % r28 )
std % r22 , 5 6 ( % r28 )
ldd 8 0 ( % r29 ) , % r21
ldd 8 8 ( % r29 ) , % r22
std % r19 , 6 4 ( % r28 )
std % r20 , 7 2 ( % r28 )
ldd 9 6 ( % r29 ) , % r19
ldd 1 0 4 ( % r29 ) , % r20
std % r21 , 8 0 ( % r28 )
std % r22 , 8 8 ( % r28 )
ldd 1 1 2 ( % r29 ) , % r21
ldd 1 2 0 ( % r29 ) , % r22
std % r19 , 9 6 ( % r28 )
std % r20 , 1 0 4 ( % r28 )
ldo 1 2 8 ( % r29 ) , % r29
std % r21 , 1 1 2 ( % r28 )
std % r22 , 1 2 0 ( % r28 )
ldo 1 2 8 ( % r28 ) , % r28
/ * conditional b r a n c h e s n u l l i f y o n f o r w a r d t a k e n b r a n c h , a n d o n
* non- t a k e n b a c k w a r d b r a n c h . N o t e t h a t . + 4 i s a b a c k w a r d s b r a n c h .
* The l d d s h o u l d o n l y g e t e x e c u t e d i f t h e b r a n c h i s t a k e n .
* /
addib,C O N D ( > ) ,n - 1 , % r1 , 1 b / * b u n d l e 1 0 * /
ldd 0 ( % r29 ) , % r19 / * s t a r t n e x t l o a d s * /
# else
ldi ( P A G E _ S I Z E / 6 4 ) , % r1
2005-04-17 02:20:36 +04:00
/ *
* This l o o p i s o p t i m i z e d f o r P C X L / P C X L 2 l d w / l d w a n d s t w / s t w
* bundles ( v e r y r e s t r i c t e d r u l e s f o r b u n d l i n g ) . I t p r o b a b l y
* does O K o n P C X U a n d b e t t e r , b u t w e c o u l d d o b e t t e r w i t h
* ldd/ s t d i n s t r u c t i o n s . N o t e t h a t u n t i l ( i f ) w e s t a r t s a v i n g
* the f u l l 6 4 b i t r e g i s t e r v a l u e s o n i n t e r r u p t , w e c a n ' t
* use l d d / s t d o n a 3 2 b i t k e r n e l .
* /
2013-02-04 03:00:54 +04:00
1 : ldw 0 ( % r29 ) , % r19
2005-04-17 02:20:36 +04:00
ldw 4 ( % r29 ) , % r20
ldw 8 ( % r29 ) , % r21
ldw 1 2 ( % r29 ) , % r22
stw % r19 , 0 ( % r28 )
stw % r20 , 4 ( % r28 )
stw % r21 , 8 ( % r28 )
stw % r22 , 1 2 ( % r28 )
ldw 1 6 ( % r29 ) , % r19
ldw 2 0 ( % r29 ) , % r20
ldw 2 4 ( % r29 ) , % r21
ldw 2 8 ( % r29 ) , % r22
stw % r19 , 1 6 ( % r28 )
stw % r20 , 2 0 ( % r28 )
stw % r21 , 2 4 ( % r28 )
stw % r22 , 2 8 ( % r28 )
ldw 3 2 ( % r29 ) , % r19
ldw 3 6 ( % r29 ) , % r20
ldw 4 0 ( % r29 ) , % r21
ldw 4 4 ( % r29 ) , % r22
stw % r19 , 3 2 ( % r28 )
stw % r20 , 3 6 ( % r28 )
stw % r21 , 4 0 ( % r28 )
stw % r22 , 4 4 ( % r28 )
ldw 4 8 ( % r29 ) , % r19
ldw 5 2 ( % r29 ) , % r20
ldw 5 6 ( % r29 ) , % r21
ldw 6 0 ( % r29 ) , % r22
stw % r19 , 4 8 ( % r28 )
stw % r20 , 5 2 ( % r28 )
stw % r21 , 5 6 ( % r28 )
stw % r22 , 6 0 ( % r28 )
ldo 6 4 ( % r28 ) , % r28
2013-02-04 03:00:54 +04:00
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r1 ,1 b
2005-04-17 02:20:36 +04:00
ldo 6 4 ( % r29 ) , % r29
2013-02-04 03:00:54 +04:00
# endif
2005-04-17 02:20:36 +04:00
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( c o p y _ u s e r _ p a g e _ a s m )
2005-04-17 02:20:36 +04:00
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( c l e a r _ u s e r _ p a g e _ a s m )
2005-04-17 02:20:36 +04:00
tophys_ r1 % r26
ldil L % ( T M P A L I A S _ M A P _ S T A R T ) , % r28
2005-10-22 06:46:48 +04:00
# ifdef C O N F I G _ 6 4 B I T
2005-04-17 02:20:36 +04:00
# if ( T M P A L I A S _ M A P _ S T A R T > = 0 x80 0 0 0 0 0 0 )
depdi 0 , 3 1 ,3 2 , % r28 / * c l e a r a n y s i g n e x t e n s i o n * /
# endif
2013-05-03 00:41:45 +04:00
convert_ p h y s _ f o r _ t l b _ i n s e r t 2 0 % r26 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
2005-04-17 02:20:36 +04:00
depd % r25 , 6 3 ,2 2 , % r28 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' t o ' * /
2013-05-03 00:41:45 +04:00
depdi 0 , 6 3 ,P A G E _ S H I F T , % r28 / * C l e a r a n y o f f s e t b i t s * /
2005-04-17 02:20:36 +04:00
# else
extrw,u % r26 , 2 4 ,2 5 , % r26 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
depw % r25 , 3 1 ,2 2 , % r28 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' t o ' * /
2013-05-17 00:51:41 +04:00
depwi 0 , 3 1 ,P A G E _ S H I F T , % r28 / * C l e a r a n y o f f s e t b i t s * /
2005-04-17 02:20:36 +04:00
# endif
/* Purge any old translation */
2013-02-04 03:00:54 +04:00
# ifdef C O N F I G _ P A 2 0
2016-11-25 04:18:14 +03:00
pdtlb,l % r0 ( % r28 )
2013-02-04 03:00:54 +04:00
# else
2018-10-16 23:38:22 +03:00
0 : pdtlb % r0 ( % r28 )
ALTERNATIVE( 0 b , 0 b + 4 , A L T _ C O N D _ N O _ S M P , I N S N _ P x T L B )
2013-02-04 03:00:54 +04:00
# endif
2005-04-17 02:20:36 +04:00
2005-10-22 06:46:48 +04:00
# ifdef C O N F I G _ 6 4 B I T
2007-10-18 11:04:50 +04:00
ldi ( P A G E _ S I Z E / 1 2 8 ) , % r1
2005-04-17 02:20:36 +04:00
/* PREFETCH (Write) has not (yet) been proven to help here */
2006-04-21 00:40:23 +04:00
/* #define PREFETCHW_OP ldd 256(%0), %r0 */
2005-04-17 02:20:36 +04:00
1 : std % r0 , 0 ( % r28 )
std % r0 , 8 ( % r28 )
std % r0 , 1 6 ( % r28 )
std % r0 , 2 4 ( % r28 )
std % r0 , 3 2 ( % r28 )
std % r0 , 4 0 ( % r28 )
std % r0 , 4 8 ( % r28 )
std % r0 , 5 6 ( % r28 )
std % r0 , 6 4 ( % r28 )
std % r0 , 7 2 ( % r28 )
std % r0 , 8 0 ( % r28 )
std % r0 , 8 8 ( % r28 )
std % r0 , 9 6 ( % r28 )
std % r0 , 1 0 4 ( % r28 )
std % r0 , 1 1 2 ( % r28 )
std % r0 , 1 2 0 ( % r28 )
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r1 , 1 b
2005-04-17 02:20:36 +04:00
ldo 1 2 8 ( % r28 ) , % r28
2005-10-22 06:46:48 +04:00
# else / * ! C O N F I G _ 6 4 B I T * /
2007-10-18 11:04:50 +04:00
ldi ( P A G E _ S I Z E / 6 4 ) , % r1
2005-04-17 02:20:36 +04:00
2013-02-04 03:00:54 +04:00
1 : stw % r0 , 0 ( % r28 )
2005-04-17 02:20:36 +04:00
stw % r0 , 4 ( % r28 )
stw % r0 , 8 ( % r28 )
stw % r0 , 1 2 ( % r28 )
stw % r0 , 1 6 ( % r28 )
stw % r0 , 2 0 ( % r28 )
stw % r0 , 2 4 ( % r28 )
stw % r0 , 2 8 ( % r28 )
stw % r0 , 3 2 ( % r28 )
stw % r0 , 3 6 ( % r28 )
stw % r0 , 4 0 ( % r28 )
stw % r0 , 4 4 ( % r28 )
stw % r0 , 4 8 ( % r28 )
stw % r0 , 5 2 ( % r28 )
stw % r0 , 5 6 ( % r28 )
stw % r0 , 6 0 ( % r28 )
2008-05-15 18:53:57 +04:00
addib,C O N D ( > ) - 1 , % r1 , 1 b
2005-04-17 02:20:36 +04:00
ldo 6 4 ( % r28 ) , % r28
2005-10-22 06:46:48 +04:00
# endif / * C O N F I G _ 6 4 B I T * /
2005-04-17 02:20:36 +04:00
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( c l e a r _ u s e r _ p a g e _ a s m )
2005-04-17 02:20:36 +04:00
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ d c a c h e _ p a g e _ a s m )
2010-12-22 19:22:11 +03:00
ldil L % ( T M P A L I A S _ M A P _ S T A R T ) , % r28
# ifdef C O N F I G _ 6 4 B I T
# if ( T M P A L I A S _ M A P _ S T A R T > = 0 x80 0 0 0 0 0 0 )
depdi 0 , 3 1 ,3 2 , % r28 / * c l e a r a n y s i g n e x t e n s i o n * /
# endif
2013-05-03 00:41:45 +04:00
convert_ p h y s _ f o r _ t l b _ i n s e r t 2 0 % r26 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
2010-12-22 19:22:11 +03:00
depd % r25 , 6 3 ,2 2 , % r28 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' t o ' * /
2013-05-03 00:41:45 +04:00
depdi 0 , 6 3 ,P A G E _ S H I F T , % r28 / * C l e a r a n y o f f s e t b i t s * /
2010-12-22 19:22:11 +03:00
# else
extrw,u % r26 , 2 4 ,2 5 , % r26 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
depw % r25 , 3 1 ,2 2 , % r28 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' t o ' * /
2013-05-17 00:51:41 +04:00
depwi 0 , 3 1 ,P A G E _ S H I F T , % r28 / * C l e a r a n y o f f s e t b i t s * /
2010-12-22 19:22:11 +03:00
# endif
/* Purge any old translation */
2013-02-04 03:00:54 +04:00
# ifdef C O N F I G _ P A 2 0
2016-11-25 04:18:14 +03:00
pdtlb,l % r0 ( % r28 )
2013-02-04 03:00:54 +04:00
# else
2018-10-16 23:38:22 +03:00
0 : pdtlb % r0 ( % r28 )
ALTERNATIVE( 0 b , 0 b + 4 , A L T _ C O N D _ N O _ S M P , I N S N _ P x T L B )
2013-02-04 03:00:54 +04:00
# endif
2010-12-22 19:22:11 +03:00
2018-10-16 23:38:22 +03:00
88 : ldil L % d c a c h e _ s t r i d e , % r1
2013-06-02 20:21:48 +04:00
ldw R % d c a c h e _ s t r i d e ( % r1 ) , r31
2005-04-17 02:20:36 +04:00
2005-10-22 06:46:48 +04:00
# ifdef C O N F I G _ 6 4 B I T
2005-04-17 02:20:36 +04:00
depdi,z 1 , 6 3 - P A G E _ S H I F T ,1 , % r25
# else
depwi,z 1 , 3 1 - P A G E _ S H I F T ,1 , % r25
# endif
2010-12-22 19:22:11 +03:00
add % r28 , % r25 , % r25
2013-06-02 20:21:48 +04:00
sub % r25 , r31 , % r25
2018-10-20 03:48:12 +03:00
1 : fdc,m r31 ( % r28 )
2013-06-02 20:21:48 +04:00
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
fdc,m r31 ( % r28 )
2018-10-20 03:48:12 +03:00
cmpb,C O N D ( > > ) % r25 , % r28 , 1 b / * p r e d i c t t a k e n * /
2013-06-02 20:21:48 +04:00
fdc,m r31 ( % r28 )
2005-04-17 02:20:36 +04:00
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ D C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
sync
bv % r0 ( % r2 )
2013-02-04 03:00:54 +04:00
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ d c a c h e _ p a g e _ a s m )
2010-12-22 19:22:11 +03:00
2018-10-20 03:48:12 +03:00
ENTRY_ C F I ( p u r g e _ d c a c h e _ p a g e _ a s m )
ldil L % ( T M P A L I A S _ M A P _ S T A R T ) , % r28
# ifdef C O N F I G _ 6 4 B I T
# if ( T M P A L I A S _ M A P _ S T A R T > = 0 x80 0 0 0 0 0 0 )
depdi 0 , 3 1 ,3 2 , % r28 / * c l e a r a n y s i g n e x t e n s i o n * /
# endif
convert_ p h y s _ f o r _ t l b _ i n s e r t 2 0 % r26 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
depd % r25 , 6 3 ,2 2 , % r28 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' t o ' * /
depdi 0 , 6 3 ,P A G E _ S H I F T , % r28 / * C l e a r a n y o f f s e t b i t s * /
# else
extrw,u % r26 , 2 4 ,2 5 , % r26 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
depw % r25 , 3 1 ,2 2 , % r28 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' t o ' * /
depwi 0 , 3 1 ,P A G E _ S H I F T , % r28 / * C l e a r a n y o f f s e t b i t s * /
# endif
/* Purge any old translation */
# ifdef C O N F I G _ P A 2 0
pdtlb,l % r0 ( % r28 )
# else
0 : pdtlb % r0 ( % r28 )
ALTERNATIVE( 0 b , 0 b + 4 , A L T _ C O N D _ N O _ S M P , I N S N _ P x T L B )
# endif
88 : ldil L % d c a c h e _ s t r i d e , % r1
ldw R % d c a c h e _ s t r i d e ( % r1 ) , r31
# ifdef C O N F I G _ 6 4 B I T
depdi,z 1 , 6 3 - P A G E _ S H I F T ,1 , % r25
# else
depwi,z 1 , 3 1 - P A G E _ S H I F T ,1 , % r25
# endif
add % r28 , % r25 , % r25
sub % r25 , r31 , % r25
1 : pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
pdc,m r31 ( % r28 )
cmpb,C O N D ( > > ) % r25 , % r28 , 1 b / * p r e d i c t t a k e n * /
pdc,m r31 ( % r28 )
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ D C A C H E , I N S N _ N O P )
sync
bv % r0 ( % r2 )
nop
ENDPROC_ C F I ( p u r g e _ d c a c h e _ p a g e _ a s m )
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ i c a c h e _ p a g e _ a s m )
2010-12-22 19:22:11 +03:00
ldil L % ( T M P A L I A S _ M A P _ S T A R T ) , % r28
2005-10-22 06:46:48 +04:00
# ifdef C O N F I G _ 6 4 B I T
2010-12-22 19:22:11 +03:00
# if ( T M P A L I A S _ M A P _ S T A R T > = 0 x80 0 0 0 0 0 0 )
depdi 0 , 3 1 ,3 2 , % r28 / * c l e a r a n y s i g n e x t e n s i o n * /
# endif
2013-05-03 00:41:45 +04:00
convert_ p h y s _ f o r _ t l b _ i n s e r t 2 0 % r26 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
2010-12-22 19:22:11 +03:00
depd % r25 , 6 3 ,2 2 , % r28 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' t o ' * /
2013-05-17 00:51:41 +04:00
depdi 0 , 6 3 ,P A G E _ S H I F T , % r28 / * C l e a r a n y o f f s e t b i t s * /
2005-04-17 02:20:36 +04:00
# else
2010-12-22 19:22:11 +03:00
extrw,u % r26 , 2 4 ,2 5 , % r26 / * c o n v e r t p h y s a d d r t o t l b i n s e r t f o r m a t * /
depw % r25 , 3 1 ,2 2 , % r28 / * F o r m a l i a s e d v i r t u a l a d d r e s s ' t o ' * /
2013-05-17 00:51:41 +04:00
depwi 0 , 3 1 ,P A G E _ S H I F T , % r28 / * C l e a r a n y o f f s e t b i t s * /
2005-04-17 02:20:36 +04:00
# endif
2016-11-25 04:18:14 +03:00
/ * Purge a n y o l d t r a n s l a t i o n . N o t e t h a t t h e F I C i n s t r u c t i o n
* may u s e e i t h e r t h e i n s t r u c t i o n o r d a t a T L B . G i v e n t h a t w e
* have a f l a t a d d r e s s s p a c e , i t ' s n o t c l e a r w h i c h T L B w i l l b e
* used. S o , w e p u r g e b o t h e n t r i e s . * /
2005-04-17 02:20:36 +04:00
2013-02-04 03:00:54 +04:00
# ifdef C O N F I G _ P A 2 0
2016-11-25 04:18:14 +03:00
pdtlb,l % r0 ( % r28 )
2018-10-16 23:38:22 +03:00
1 : pitlb,l % r0 ( % s r4 ,% r28 )
ALTERNATIVE( 1 b , 1 b + 4 , A L T _ C O N D _ N O _ S P L I T _ T L B , I N S N _ N O P )
2013-02-04 03:00:54 +04:00
# else
2018-10-16 23:38:22 +03:00
0 : pdtlb % r0 ( % r28 )
1 : pitlb % r0 ( % s r4 ,% r28 )
ALTERNATIVE( 0 b , 0 b + 4 , A L T _ C O N D _ N O _ S M P , I N S N _ P x T L B )
ALTERNATIVE( 1 b , 1 b + 4 , A L T _ C O N D _ N O _ S M P , I N S N _ P x T L B )
ALTERNATIVE( 1 b , 1 b + 4 , A L T _ C O N D _ N O _ S P L I T _ T L B , I N S N _ N O P )
2013-02-04 03:00:54 +04:00
# endif
2010-12-22 19:22:11 +03:00
2018-10-16 23:38:22 +03:00
88 : ldil L % i c a c h e _ s t r i d e , % r1
2013-06-02 20:21:48 +04:00
ldw R % i c a c h e _ s t r i d e ( % r1 ) , % r31
2010-12-22 19:22:11 +03:00
# ifdef C O N F I G _ 6 4 B I T
depdi,z 1 , 6 3 - P A G E _ S H I F T ,1 , % r25
# else
depwi,z 1 , 3 1 - P A G E _ S H I F T ,1 , % r25
# endif
add % r28 , % r25 , % r25
2013-06-02 20:21:48 +04:00
sub % r25 , % r31 , % r25
2010-12-22 19:22:11 +03:00
2012-05-16 13:14:52 +04:00
/ * fic o n l y h a s t h e t y p e 2 6 f o r m o n P A 1 . 1 , r e q u i r i n g a n
* explicit s p a c e s p e c i f i c a t i o n , s o u s e % s r4 * /
2013-06-02 20:21:48 +04:00
1 : fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
fic,m % r31 ( % s r4 ,% r28 )
2018-10-20 03:48:12 +03:00
cmpb,C O N D ( > > ) % r25 , % r28 , 1 b / * p r e d i c t t a k e n * /
2013-06-02 20:21:48 +04:00
fic,m % r31 ( % s r4 ,% r28 )
2005-04-17 02:20:36 +04:00
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ I C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
sync
bv % r0 ( % r2 )
2013-02-04 03:00:54 +04:00
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ i c a c h e _ p a g e _ a s m )
2005-04-17 02:20:36 +04:00
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ k e r n e l _ d c a c h e _ p a g e _ a s m )
2018-10-16 23:38:22 +03:00
88 : ldil L % d c a c h e _ s t r i d e , % r1
2005-04-17 02:20:36 +04:00
ldw R % d c a c h e _ s t r i d e ( % r1 ) , % r23
2005-10-22 06:46:48 +04:00
# ifdef C O N F I G _ 6 4 B I T
2005-04-17 02:20:36 +04:00
depdi,z 1 , 6 3 - P A G E _ S H I F T ,1 , % r25
# else
depwi,z 1 , 3 1 - P A G E _ S H I F T ,1 , % r25
# endif
add % r26 , % r25 , % r25
sub % r25 , % r23 , % r25
2010-12-22 19:22:11 +03:00
1 : fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
2018-10-20 03:48:12 +03:00
cmpb,C O N D ( > > ) % r25 , % r26 , 1 b / * p r e d i c t t a k e n * /
2010-12-22 19:22:11 +03:00
fdc,m % r23 ( % r26 )
2005-04-17 02:20:36 +04:00
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ D C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
sync
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ k e r n e l _ d c a c h e _ p a g e _ a s m )
2005-04-17 02:20:36 +04:00
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( p u r g e _ k e r n e l _ d c a c h e _ p a g e _ a s m )
2018-10-16 23:38:22 +03:00
88 : ldil L % d c a c h e _ s t r i d e , % r1
2005-04-17 02:20:36 +04:00
ldw R % d c a c h e _ s t r i d e ( % r1 ) , % r23
2005-10-22 06:46:48 +04:00
# ifdef C O N F I G _ 6 4 B I T
2005-04-17 02:20:36 +04:00
depdi,z 1 , 6 3 - P A G E _ S H I F T ,1 , % r25
# else
depwi,z 1 , 3 1 - P A G E _ S H I F T ,1 , % r25
# endif
add % r26 , % r25 , % r25
sub % r25 , % r23 , % r25
1 : pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
2018-10-20 03:48:12 +03:00
cmpb,C O N D ( > > ) % r25 , % r26 , 1 b / * p r e d i c t t a k e n * /
2005-04-17 02:20:36 +04:00
pdc,m % r23 ( % r26 )
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ D C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
sync
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( p u r g e _ k e r n e l _ d c a c h e _ p a g e _ a s m )
2005-04-17 02:20:36 +04:00
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ u s e r _ d c a c h e _ r a n g e _ a s m )
2018-10-16 23:38:22 +03:00
88 : ldil L % d c a c h e _ s t r i d e , % r1
2005-04-17 02:20:36 +04:00
ldw R % d c a c h e _ s t r i d e ( % r1 ) , % r23
ldo - 1 ( % r23 ) , % r21
ANDCM % r26 , % r21 , % r26
2018-10-20 03:48:12 +03:00
# ifdef C O N F I G _ 6 4 B I T
depd,z % r23 , 5 9 , 6 0 , % r21
# else
depw,z % r23 , 2 7 , 2 8 , % r21
# endif
add % r26 , % r21 , % r22
cmpb,C O N D ( > > ) ,n % r22 , % r25 , 2 f / * p r e d i c t n o t t a k e n * /
1 : add % r22 , % r21 , % r22
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
fdc,m % r23 ( % s r3 , % r26 )
cmpb,C O N D ( < < = ) % r22 , % r25 , 1 b / * p r e d i c t t a k e n * /
fdc,m % r23 ( % s r3 , % r26 )
2 : cmpb,C O N D ( > > ) ,n % r25 , % r26 , 2 b
2005-04-17 02:20:36 +04:00
fdc,m % r23 ( % s r3 , % r26 )
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ D C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
sync
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ u s e r _ d c a c h e _ r a n g e _ a s m )
2005-04-17 02:20:36 +04:00
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ k e r n e l _ d c a c h e _ r a n g e _ a s m )
2018-10-16 23:38:22 +03:00
88 : ldil L % d c a c h e _ s t r i d e , % r1
2005-04-17 02:20:36 +04:00
ldw R % d c a c h e _ s t r i d e ( % r1 ) , % r23
ldo - 1 ( % r23 ) , % r21
ANDCM % r26 , % r21 , % r26
2018-10-20 03:48:12 +03:00
# ifdef C O N F I G _ 6 4 B I T
depd,z % r23 , 5 9 , 6 0 , % r21
# else
depw,z % r23 , 2 7 , 2 8 , % r21
# endif
add % r26 , % r21 , % r22
cmpb,C O N D ( > > ) ,n % r22 , % r25 , 2 f / * p r e d i c t n o t t a k e n * /
1 : add % r22 , % r21 , % r22
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
fdc,m % r23 ( % r26 )
cmpb,C O N D ( < < = ) % r22 , % r25 , 1 b / * p r e d i c t t a k e n * /
fdc,m % r23 ( % r26 )
2 : cmpb,C O N D ( > > ) ,n % r25 , % r26 , 2 b / * p r e d i c t t a k e n * /
2005-04-17 02:20:36 +04:00
fdc,m % r23 ( % r26 )
sync
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ D C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
syncdma
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ k e r n e l _ d c a c h e _ r a n g e _ a s m )
2005-04-17 02:20:36 +04:00
2018-02-27 16:16:07 +03:00
ENTRY_ C F I ( p u r g e _ k e r n e l _ d c a c h e _ r a n g e _ a s m )
2018-10-16 23:38:22 +03:00
88 : ldil L % d c a c h e _ s t r i d e , % r1
2018-02-27 16:16:07 +03:00
ldw R % d c a c h e _ s t r i d e ( % r1 ) , % r23
ldo - 1 ( % r23 ) , % r21
ANDCM % r26 , % r21 , % r26
2018-10-20 03:48:12 +03:00
# ifdef C O N F I G _ 6 4 B I T
depd,z % r23 , 5 9 , 6 0 , % r21
# else
depw,z % r23 , 2 7 , 2 8 , % r21
# endif
add % r26 , % r21 , % r22
cmpb,C O N D ( > > ) ,n % r22 , % r25 , 2 f / * p r e d i c t n o t t a k e n * /
1 : add % r22 , % r21 , % r22
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
pdc,m % r23 ( % r26 )
cmpb,C O N D ( < < = ) % r22 , % r25 , 1 b / * p r e d i c t t a k e n * /
pdc,m % r23 ( % r26 )
2 : cmpb,C O N D ( > > ) ,n % r25 , % r26 , 2 b / * p r e d i c t t a k e n * /
2018-02-27 16:16:07 +03:00
pdc,m % r23 ( % r26 )
sync
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ D C A C H E , I N S N _ N O P )
2018-02-27 16:16:07 +03:00
syncdma
bv % r0 ( % r2 )
nop
ENDPROC_ C F I ( p u r g e _ k e r n e l _ d c a c h e _ r a n g e _ a s m )
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ u s e r _ i c a c h e _ r a n g e _ a s m )
2018-10-16 23:38:22 +03:00
88 : ldil L % i c a c h e _ s t r i d e , % r1
2005-04-17 02:20:36 +04:00
ldw R % i c a c h e _ s t r i d e ( % r1 ) , % r23
ldo - 1 ( % r23 ) , % r21
ANDCM % r26 , % r21 , % r26
2018-10-20 03:48:12 +03:00
# ifdef C O N F I G _ 6 4 B I T
depd,z % r23 , 5 9 , 6 0 , % r21
# else
depw,z % r23 , 2 7 , 2 8 , % r21
# endif
add % r26 , % r21 , % r22
cmpb,C O N D ( > > ) ,n % r22 , % r25 , 2 f / * p r e d i c t n o t t a k e n * /
1 : add % r22 , % r21 , % r22
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
fic,m % r23 ( % s r3 , % r26 )
cmpb,C O N D ( < < = ) % r22 , % r25 , 1 b / * p r e d i c t t a k e n * /
fic,m % r23 ( % s r3 , % r26 )
2 : cmpb,C O N D ( > > ) ,n % r25 , % r26 , 2 b
2005-04-17 02:20:36 +04:00
fic,m % r23 ( % s r3 , % r26 )
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ I C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
sync
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ u s e r _ i c a c h e _ r a n g e _ a s m )
2005-04-17 02:20:36 +04:00
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ k e r n e l _ i c a c h e _ p a g e )
2018-10-16 23:38:22 +03:00
88 : ldil L % i c a c h e _ s t r i d e , % r1
2005-04-17 02:20:36 +04:00
ldw R % i c a c h e _ s t r i d e ( % r1 ) , % r23
2005-10-22 06:46:48 +04:00
# ifdef C O N F I G _ 6 4 B I T
2005-04-17 02:20:36 +04:00
depdi,z 1 , 6 3 - P A G E _ S H I F T ,1 , % r25
# else
depwi,z 1 , 3 1 - P A G E _ S H I F T ,1 , % r25
# endif
add % r26 , % r25 , % r25
sub % r25 , % r23 , % r25
2005-10-22 06:56:14 +04:00
1 : fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
2018-10-20 03:48:12 +03:00
cmpb,C O N D ( > > ) % r25 , % r26 , 1 b / * p r e d i c t t a k e n * /
2005-10-22 06:56:14 +04:00
fic,m % r23 ( % s r4 , % r26 )
2005-04-17 02:20:36 +04:00
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ I C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
sync
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ k e r n e l _ i c a c h e _ p a g e )
2005-04-17 02:20:36 +04:00
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( f l u s h _ k e r n e l _ i c a c h e _ r a n g e _ a s m )
2018-10-16 23:38:22 +03:00
88 : ldil L % i c a c h e _ s t r i d e , % r1
2005-04-17 02:20:36 +04:00
ldw R % i c a c h e _ s t r i d e ( % r1 ) , % r23
ldo - 1 ( % r23 ) , % r21
ANDCM % r26 , % r21 , % r26
2018-10-20 03:48:12 +03:00
# ifdef C O N F I G _ 6 4 B I T
depd,z % r23 , 5 9 , 6 0 , % r21
# else
depw,z % r23 , 2 7 , 2 8 , % r21
# endif
add % r26 , % r21 , % r22
cmpb,C O N D ( > > ) ,n % r22 , % r25 , 2 f / * p r e d i c t n o t t a k e n * /
1 : add % r22 , % r21 , % r22
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
fic,m % r23 ( % s r4 , % r26 )
cmpb,C O N D ( < < = ) % r22 , % r25 , 1 b / * p r e d i c t t a k e n * /
fic,m % r23 ( % s r4 , % r26 )
2 : cmpb,C O N D ( > > ) ,n % r25 , % r26 , 2 b / * p r e d i c t t a k e n * /
2005-10-22 06:56:14 +04:00
fic,m % r23 ( % s r4 , % r26 )
2005-04-17 02:20:36 +04:00
2018-10-16 23:38:22 +03:00
89 : ALTERNATIVE( 8 8 b , 8 9 b , A L T _ C O N D _ N O _ I C A C H E , I N S N _ N O P )
2005-04-17 02:20:36 +04:00
sync
bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( f l u s h _ k e r n e l _ i c a c h e _ r a n g e _ a s m )
2005-04-17 02:20:36 +04:00
2018-04-10 19:55:13 +03:00
_ _ INIT
2005-10-22 06:40:07 +04:00
/ * align s h o u l d c o v e r u s e o f r f i i n d i s a b l e _ s r _ h a s h i n g _ a s m a n d
* srdis_ d o n e .
* /
.align 256
2016-10-05 23:28:46 +03:00
ENTRY_ C F I ( d i s a b l e _ s r _ h a s h i n g _ a s m )
2005-10-22 06:40:07 +04:00
/ *
* Switch t o r e a l m o d e
* /
/* pcxt_ssm_bug */
rsm P S W _ S M _ I , % r0
load3 2 P A ( 1 f ) , % r1
2005-04-17 02:20:36 +04:00
nop
nop
nop
nop
nop
2005-10-22 06:40:07 +04:00
rsm P S W _ S M _ Q , % r0 / * p r e p t o l o a d i i a q u e u e * /
2005-04-17 02:20:36 +04:00
mtctl % r0 , % c r17 / * C l e a r I I A S Q t a i l * /
mtctl % r0 , % c r17 / * C l e a r I I A S Q h e a d * /
mtctl % r1 , % c r18 / * I I A O Q h e a d * /
ldo 4 ( % r1 ) , % r1
mtctl % r1 , % c r18 / * I I A O Q t a i l * /
2005-10-22 06:40:07 +04:00
load3 2 R E A L _ M O D E _ P S W , % r1
mtctl % r1 , % i p s w
2005-04-17 02:20:36 +04:00
rfi
nop
1 : cmpib,= ,n S R H A S H _ P C X S T , % r26 ,s r d i s _ p c x s
cmpib,= ,n S R H A S H _ P C X L , % r26 ,s r d i s _ p c x l
cmpib,= ,n S R H A S H _ P A 2 0 , % r26 ,s r d i s _ p a20
b,n s r d i s _ d o n e
srdis_pcxs :
/* Disable Space Register Hashing for PCXS,PCXT,PCXT' */
.word 0x141c1a00 /* mfdiag %dr0, %r28 */
.word 0x141c1a00 /* must issue twice */
depwi 0 ,1 8 ,1 , % r28 / * C l e a r D H E ( d c a c h e h a s h e n a b l e ) * /
depwi 0 ,2 0 ,1 , % r28 / * C l e a r I H E ( i c a c h e h a s h e n a b l e ) * /
.word 0x141c1600 /* mtdiag %r28, %dr0 */
.word 0x141c1600 /* must issue twice */
b,n s r d i s _ d o n e
srdis_pcxl :
/* Disable Space Register Hashing for PCXL */
.word 0x141c0600 /* mfdiag %dr0, %r28 */
depwi 0 ,2 8 ,2 , % r28 / * C l e a r D H A S H _ E N & I H A S H _ E N * /
.word 0x141c0240 /* mtdiag %r28, %dr0 */
b,n s r d i s _ d o n e
srdis_pa20 :
2005-10-22 06:40:07 +04:00
/* Disable Space Register Hashing for PCXU,PCXU+,PCXW,PCXW+,PCXW2 */
2005-04-17 02:20:36 +04:00
.word 0x144008bc /* mfdiag %dr2, %r28 */
depdi 0 , 5 4 ,1 , % r28 / * c l e a r D I A G _ S P H A S H _ E N A B ( b i t 5 4 ) * /
.word 0x145c1840 /* mtdiag %r28, %dr2 */
2005-10-22 06:40:07 +04:00
srdis_done :
2005-04-17 02:20:36 +04:00
/* Switch back to virtual mode */
2005-10-22 06:40:07 +04:00
rsm P S W _ S M _ I , % r0 / * p r e p t o l o a d i i a q u e u e * /
load3 2 2 f , % r1
nop
nop
nop
nop
nop
2005-04-17 02:20:36 +04:00
2005-10-22 06:40:07 +04:00
rsm P S W _ S M _ Q , % r0 / * p r e p t o l o a d i i a q u e u e * /
2005-04-17 02:20:36 +04:00
mtctl % r0 , % c r17 / * C l e a r I I A S Q t a i l * /
mtctl % r0 , % c r17 / * C l e a r I I A S Q h e a d * /
mtctl % r1 , % c r18 / * I I A O Q h e a d * /
ldo 4 ( % r1 ) , % r1
mtctl % r1 , % c r18 / * I I A O Q t a i l * /
2005-10-22 06:40:07 +04:00
load3 2 K E R N E L _ P S W , % r1
mtctl % r1 , % i p s w
2005-04-17 02:20:36 +04:00
rfi
nop
2 : bv % r0 ( % r2 )
nop
2016-10-05 23:28:46 +03:00
ENDPROC_ C F I ( d i s a b l e _ s r _ h a s h i n g _ a s m )
2005-04-17 02:20:36 +04:00
.end