@ -45,7 +45,7 @@
.level 2 .0
# endif
.import pa_ d b i t _ l o c k ,d a t a
.import pa_ t l b _ l o c k ,d a t a
/* space_to_prot macro creates a prot id from a space id */
@ -420,8 +420,8 @@
SHLREG % r9 ,P x D _ V A L U E _ S H I F T ,\ p m d
extru \ v a ,3 1 - P A G E _ S H I F T ,A S M _ B I T S _ P E R _ P T E ,\ i n d e x
dep % r0 ,3 1 ,P A G E _ S H I F T ,\ p m d / * c l e a r o f f s e t * /
shladd \ i n d e x ,B I T S _ P E R _ P T E _ E N T R Y ,\ p m d ,\ p m d
LDREG % r0 ( \ p m d ) ,\ p t e / * p m d i s n o w p t e * /
shladd \ i n d e x ,B I T S _ P E R _ P T E _ E N T R Y ,\ p m d ,\ p m d / * p m d i s n o w p t e * /
LDREG % r0 ( \ p m d ) ,\ p t e
bb,> = ,n \ p t e ,_ P A G E _ P R E S E N T _ B I T ,\ f a u l t
.endm
@ -453,57 +453,53 @@
L2 _ p t e p \ p g d ,\ p t e ,\ i n d e x ,\ v a ,\ f a u l t
.endm
/* Acquire pa_dbit_lock lock . */
.macro dbit_lock spc ,t m p ,t m p1
/* Acquire pa_tlb_lock lock and recheck page is still present . */
.macro tlb_lock spc,p t p ,p t e ,t m p ,t m p1 ,f a u l t
# ifdef C O N F I G _ S M P
cmpib,C O N D ( = ) ,n 0 ,\ s p c ,2 f
load3 2 P A ( p a _ d b i t _ l o c k ) ,\ t m p
load3 2 P A ( p a _ t l b _ l o c k ) ,\ t m p
1 : LDCW 0 ( \ t m p ) ,\ t m p1
cmpib,C O N D ( = ) 0 ,\ t m p1 ,1 b
nop
LDREG 0 ( \ p t p ) ,\ p t e
bb,< ,n \ p t e ,_ P A G E _ P R E S E N T _ B I T ,2 f
b \ f a u l t
stw \ s p c ,0 ( \ t m p )
2 :
# endif
.endm
/* Release pa_dbit _lock lock without reloading lock address. */
.macro dbit _unlock0 spc,t m p
/* Release pa_tlb _lock lock without reloading lock address. */
.macro tlb _unlock0 spc,t m p
# ifdef C O N F I G _ S M P
or,C O N D ( = ) % r0 ,\ s p c ,% r0
stw \ s p c ,0 ( \ t m p )
# endif
.endm
/* Release pa_dbit _lock lock. */
.macro dbit _unlock1 spc,t m p
/* Release pa_tlb _lock lock. */
.macro tlb _unlock1 spc,t m p
# ifdef C O N F I G _ S M P
load3 2 P A ( p a _ d b i t _ l o c k ) ,\ t m p
dbit _ u n l o c k 0 \ s p c ,\ t m p
load3 2 P A ( p a _ t l b _ l o c k ) ,\ t m p
tlb _ u n l o c k 0 \ s p c ,\ t m p
# endif
.endm
/ * Set t h e _ P A G E _ A C C E S S E D b i t o f t h e P T E . B e c l e v e r a n d
* don' t n e e d l e s s l y d i r t y t h e c a c h e l i n e i f i t w a s a l r e a d y s e t * /
.macro update_ptep spc,p t e p ,p t e ,t m p ,t m p1
# ifdef C O N F I G _ S M P
or,C O N D ( = ) % r0 ,\ s p c ,% r0
LDREG 0 ( \ p t e p ) ,\ p t e
# endif
.macro update_accessed ptp,p t e ,t m p ,t m p1
ldi _ P A G E _ A C C E S S E D ,\ t m p1
or \ t m p1 ,\ p t e ,\ t m p
and,C O N D ( < > ) \ t m p1 ,\ p t e ,% r0
STREG \ t m p ,0 ( \ p t e p )
STREG \ t m p ,0 ( \ p t p )
.endm
/ * Set t h e d i r t y b i t ( a n d a c c e s s e d b i t ) . N o n e e d t o b e
* clever, t h i s i s o n l y u s e d f r o m t h e d i r t y f a u l t * /
.macro update_dirty spc,p t e p ,p t e ,t m p
# ifdef C O N F I G _ S M P
or,C O N D ( = ) % r0 ,\ s p c ,% r0
LDREG 0 ( \ p t e p ) ,\ p t e
# endif
.macro update_dirty ptp,p t e ,t m p
ldi _ P A G E _ A C C E S S E D | _ P A G E _ D I R T Y ,\ t m p
or \ t m p ,\ p t e ,\ p t e
STREG \ p t e ,0 ( \ p t e p )
STREG \ p t e ,0 ( \ p t p )
.endm
/ * bitshift d i f f e r e n c e b e t w e e n a P F N ( b a s e d o n k e r n e l ' s P A G E _ S I Z E )
@ -1148,14 +1144,14 @@ dtlb_miss_20w:
L3 _ p t e p p t p ,p t e ,t 0 ,v a ,d t l b _ c h e c k _ a l i a s _ 2 0 w
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,d t l b _ c h e c k _ a l i a s _ 2 0 w
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b s p c ,p t e ,p r o t
idtlbt p t e ,p r o t
dbit_ u n l o c k 1 s p c ,t 0
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1174,14 +1170,14 @@ nadtlb_miss_20w:
L3 _ p t e p p t p ,p t e ,t 0 ,v a ,n a d t l b _ c h e c k _ a l i a s _ 2 0 w
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,n a d t l b _ c h e c k _ a l i a s _ 2 0 w
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b s p c ,p t e ,p r o t
idtlbt p t e ,p r o t
dbit_ u n l o c k 1 s p c ,t 0
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1202,20 +1198,20 @@ dtlb_miss_11:
L2 _ p t e p p t p ,p t e ,t 0 ,v a ,d t l b _ c h e c k _ a l i a s _ 1 1
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,d t l b _ c h e c k _ a l i a s _ 1 1
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b _ 1 1 s p c ,p t e ,p r o t
mfsp % s r1 ,t 0 / * S a v e s r1 s o w e c a n u s e i t i n t l b i n s e r t s * /
mfsp % s r1 ,t 1 / * S a v e s r1 s o w e c a n u s e i t i n t l b i n s e r t s * /
mtsp s p c ,% s r1
idtlba p t e ,( % s r1 ,v a )
idtlbp p r o t ,( % s r1 ,v a )
mtsp t 0 , % s r1 / * R e s t o r e s r1 * /
dbit_ u n l o c k 1 s p c ,t 0
mtsp t 1 , % s r1 / * R e s t o r e s r1 * /
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1235,21 +1231,20 @@ nadtlb_miss_11:
L2 _ p t e p p t p ,p t e ,t 0 ,v a ,n a d t l b _ c h e c k _ a l i a s _ 1 1
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,n a d t l b _ c h e c k _ a l i a s _ 1 1
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b _ 1 1 s p c ,p t e ,p r o t
mfsp % s r1 ,t 0 / * S a v e s r1 s o w e c a n u s e i t i n t l b i n s e r t s * /
mfsp % s r1 ,t 1 / * S a v e s r1 s o w e c a n u s e i t i n t l b i n s e r t s * /
mtsp s p c ,% s r1
idtlba p t e ,( % s r1 ,v a )
idtlbp p r o t ,( % s r1 ,v a )
mtsp t 0 , % s r1 / * R e s t o r e s r1 * /
dbit_ u n l o c k 1 s p c ,t 0
mtsp t 1 , % s r1 / * R e s t o r e s r1 * /
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1269,16 +1264,16 @@ dtlb_miss_20:
L2 _ p t e p p t p ,p t e ,t 0 ,v a ,d t l b _ c h e c k _ a l i a s _ 2 0
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,d t l b _ c h e c k _ a l i a s _ 2 0
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b s p c ,p t e ,p r o t
f_ e x t e n d p t e ,t 0
f_ e x t e n d p t e ,t 1
idtlbt p t e ,p r o t
dbit_ u n l o c k 1 s p c ,t 0
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1297,16 +1292,16 @@ nadtlb_miss_20:
L2 _ p t e p p t p ,p t e ,t 0 ,v a ,n a d t l b _ c h e c k _ a l i a s _ 2 0
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,n a d t l b _ c h e c k _ a l i a s _ 2 0
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b s p c ,p t e ,p r o t
f_ e x t e n d p t e ,t 0
f_ e x t e n d p t e ,t 1
idtlbt p t e ,p r o t
dbit_ u n l o c k 1 s p c ,t 0
idtlbt p t e ,p r o t
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1406,14 +1401,14 @@ itlb_miss_20w:
L3 _ p t e p p t p ,p t e ,t 0 ,v a ,i t l b _ f a u l t
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,i t l b _ f a u l t
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b s p c ,p t e ,p r o t
iitlbt p t e ,p r o t
dbit_ u n l o c k 1 s p c ,t 0
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1430,14 +1425,14 @@ naitlb_miss_20w:
L3 _ p t e p p t p ,p t e ,t 0 ,v a ,n a i t l b _ c h e c k _ a l i a s _ 2 0 w
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,n a i t l b _ c h e c k _ a l i a s _ 2 0 w
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b s p c ,p t e ,p r o t
iitlbt p t e ,p r o t
dbit_ u n l o c k 1 s p c ,t 0
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1458,20 +1453,20 @@ itlb_miss_11:
L2 _ p t e p p t p ,p t e ,t 0 ,v a ,i t l b _ f a u l t
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,i t l b _ f a u l t
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b _ 1 1 s p c ,p t e ,p r o t
mfsp % s r1 ,t 0 / * S a v e s r1 s o w e c a n u s e i t i n t l b i n s e r t s * /
mfsp % s r1 ,t 1 / * S a v e s r1 s o w e c a n u s e i t i n t l b i n s e r t s * /
mtsp s p c ,% s r1
iitlba p t e ,( % s r1 ,v a )
iitlbp p r o t ,( % s r1 ,v a )
mtsp t 0 , % s r1 / * R e s t o r e s r1 * /
dbit_ u n l o c k 1 s p c ,t 0
mtsp t 1 , % s r1 / * R e s t o r e s r1 * /
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1482,20 +1477,20 @@ naitlb_miss_11:
L2 _ p t e p p t p ,p t e ,t 0 ,v a ,n a i t l b _ c h e c k _ a l i a s _ 1 1
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,n a i t l b _ c h e c k _ a l i a s _ 1 1
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b _ 1 1 s p c ,p t e ,p r o t
mfsp % s r1 ,t 0 / * S a v e s r1 s o w e c a n u s e i t i n t l b i n s e r t s * /
mfsp % s r1 ,t 1 / * S a v e s r1 s o w e c a n u s e i t i n t l b i n s e r t s * /
mtsp s p c ,% s r1
iitlba p t e ,( % s r1 ,v a )
iitlbp p r o t ,( % s r1 ,v a )
mtsp t 0 , % s r1 / * R e s t o r e s r1 * /
dbit_ u n l o c k 1 s p c ,t 0
mtsp t 1 , % s r1 / * R e s t o r e s r1 * /
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1516,16 +1511,16 @@ itlb_miss_20:
L2 _ p t e p p t p ,p t e ,t 0 ,v a ,i t l b _ f a u l t
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,i t l b _ f a u l t
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b s p c ,p t e ,p r o t
f_ e x t e n d p t e ,t 0
f_ e x t e n d p t e ,t 1
iitlbt p t e ,p r o t
dbit_ u n l o c k 1 s p c ,t 0
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1536,16 +1531,16 @@ naitlb_miss_20:
L2 _ p t e p p t p ,p t e ,t 0 ,v a ,n a i t l b _ c h e c k _ a l i a s _ 2 0
dbit _ l o c k s p c ,t 0 ,t 1
update_ p t e p s p c ,p t p ,p t e ,t 0 ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,n a i t l b _ c h e c k _ a l i a s _ 2 0
update_ a c c e s s e d p t p ,p t e ,t 0 ,t 1
make_ i n s e r t _ t l b s p c ,p t e ,p r o t
f_ e x t e n d p t e ,t 0
f_ e x t e n d p t e ,t 1
iitlbt p t e ,p r o t
dbit_ u n l o c k 1 s p c ,t 0
tlb_ u n l o c k 1 s p c ,t 0
rfir
nop
@ -1568,14 +1563,14 @@ dbit_trap_20w:
L3 _ p t e p p t p ,p t e ,t 0 ,v a ,d b i t _ f a u l t
dbit _ l o c k s p c ,t 0 ,t 1
update_ d i r t y s p c ,p t p ,p t e ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,d b i t _ f a u l t
update_ d i r t y p t p ,p t e ,t 1
make_ i n s e r t _ t l b s p c ,p t e ,p r o t
idtlbt p t e ,p r o t
dbit_ u n l o c k 0 s p c ,t 0
tlb_ u n l o c k 0 s p c ,t 0
rfir
nop
# else
@ -1588,8 +1583,8 @@ dbit_trap_11:
L2 _ p t e p p t p ,p t e ,t 0 ,v a ,d b i t _ f a u l t
dbit _ l o c k s p c ,t 0 ,t 1
update_ d i r t y s p c ,p t p ,p t e ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,d b i t _ f a u l t
update_ d i r t y p t p ,p t e ,t 1
make_ i n s e r t _ t l b _ 1 1 s p c ,p t e ,p r o t
@ -1600,8 +1595,8 @@ dbit_trap_11:
idtlbp p r o t ,( % s r1 ,v a )
mtsp t 1 , % s r1 / * R e s t o r e s r1 * /
dbit_ u n l o c k 0 s p c ,t 0
tlb_ u n l o c k 0 s p c ,t 0
rfir
nop
@ -1612,16 +1607,16 @@ dbit_trap_20:
L2 _ p t e p p t p ,p t e ,t 0 ,v a ,d b i t _ f a u l t
dbit _ l o c k s p c ,t 0 ,t 1
update_ d i r t y s p c ,p t p ,p t e ,t 1
tlb _ l o c k s p c ,p t p ,p t e ,t 0 ,t 1 ,d b i t _ f a u l t
update_ d i r t y p t p ,p t e ,t 1
make_ i n s e r t _ t l b s p c ,p t e ,p r o t
f_ e x t e n d p t e ,t 1
idtlbt p t e ,p r o t
dbit_ u n l o c k 0 s p c ,t 0
idtlbt p t e ,p r o t
tlb_ u n l o c k 0 s p c ,t 0
rfir
nop
# endif