2008-04-28 11:47:20 +04:00
/ * These g e t p a t c h e d i n t o t h e t r a p t a b l e a t b o o t t i m e
* once w e k n o w w e h a v e a c h e e t a h p r o c e s s o r .
* /
.globl cheetah_fecc_trap_vector
.type cheetah_ f e c c _ t r a p _ v e c t o r ,#f u n c t i o n
cheetah_fecc_trap_vector :
membar #S y n c
ldxa [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G , % g 1
andn % g 1 , D C U _ D C | D C U _ I C , % g 1
stxa % g 1 , [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G
membar #S y n c
sethi % h i ( c h e e t a h _ f a s t _ e c c ) , % g 2
jmpl % g 2 + % l o ( c h e e t a h _ f a s t _ e c c ) , % g 0
mov 0 , % g 1
.size cheetah_ f e c c _ t r a p _ v e c t o r ,. - c h e e t a h _ f e c c _ t r a p _ v e c t o r
.globl cheetah_fecc_trap_vector_tl1
.type cheetah_ f e c c _ t r a p _ v e c t o r _ t l 1 ,#f u n c t i o n
cheetah_fecc_trap_vector_tl1 :
membar #S y n c
ldxa [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G , % g 1
andn % g 1 , D C U _ D C | D C U _ I C , % g 1
stxa % g 1 , [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G
membar #S y n c
sethi % h i ( c h e e t a h _ f a s t _ e c c ) , % g 2
jmpl % g 2 + % l o ( c h e e t a h _ f a s t _ e c c ) , % g 0
mov 1 , % g 1
.size cheetah_ f e c c _ t r a p _ v e c t o r _ t l 1 ,. - c h e e t a h _ f e c c _ t r a p _ v e c t o r _ t l 1
.globl cheetah_cee_trap_vector
.type cheetah_ c e e _ t r a p _ v e c t o r ,#f u n c t i o n
cheetah_cee_trap_vector :
membar #S y n c
ldxa [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G , % g 1
andn % g 1 , D C U _ I C , % g 1
stxa % g 1 , [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G
membar #S y n c
sethi % h i ( c h e e t a h _ c e e ) , % g 2
jmpl % g 2 + % l o ( c h e e t a h _ c e e ) , % g 0
mov 0 , % g 1
.size cheetah_ c e e _ t r a p _ v e c t o r ,. - c h e e t a h _ c e e _ t r a p _ v e c t o r
.globl cheetah_cee_trap_vector_tl1
.type cheetah_ c e e _ t r a p _ v e c t o r _ t l 1 ,#f u n c t i o n
cheetah_cee_trap_vector_tl1 :
membar #S y n c
ldxa [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G , % g 1
andn % g 1 , D C U _ I C , % g 1
stxa % g 1 , [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G
membar #S y n c
sethi % h i ( c h e e t a h _ c e e ) , % g 2
jmpl % g 2 + % l o ( c h e e t a h _ c e e ) , % g 0
mov 1 , % g 1
.size cheetah_ c e e _ t r a p _ v e c t o r _ t l 1 ,. - c h e e t a h _ c e e _ t r a p _ v e c t o r _ t l 1
.globl cheetah_deferred_trap_vector
.type cheetah_ d e f e r r e d _ t r a p _ v e c t o r ,#f u n c t i o n
cheetah_deferred_trap_vector :
membar #S y n c
ldxa [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G , % g 1 ;
andn % g 1 , D C U _ D C | D C U _ I C , % g 1 ;
stxa % g 1 , [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G ;
membar #S y n c ;
sethi % h i ( c h e e t a h _ d e f e r r e d _ t r a p ) , % g 2
jmpl % g 2 + % l o ( c h e e t a h _ d e f e r r e d _ t r a p ) , % g 0
mov 0 , % g 1
.size cheetah_ d e f e r r e d _ t r a p _ v e c t o r ,. - c h e e t a h _ d e f e r r e d _ t r a p _ v e c t o r
.globl cheetah_deferred_trap_vector_tl1
.type cheetah_ d e f e r r e d _ t r a p _ v e c t o r _ t l 1 ,#f u n c t i o n
cheetah_deferred_trap_vector_tl1 :
membar #S y n c ;
ldxa [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G , % g 1 ;
andn % g 1 , D C U _ D C | D C U _ I C , % g 1 ;
stxa % g 1 , [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G ;
membar #S y n c ;
sethi % h i ( c h e e t a h _ d e f e r r e d _ t r a p ) , % g 2
jmpl % g 2 + % l o ( c h e e t a h _ d e f e r r e d _ t r a p ) , % g 0
mov 1 , % g 1
.size cheetah_ d e f e r r e d _ t r a p _ v e c t o r _ t l 1 ,. - c h e e t a h _ d e f e r r e d _ t r a p _ v e c t o r _ t l 1
/ * Cheetah+ s p e c i f i c t r a p s . T h e s e a r e f o r t h e n e w I / D c a c h e p a r i t y
* error t r a p s . T h e f i r s t a r g u m e n t t o c h e e t a h _ p l u s _ p a r i t y _ h a n d l e r
* is e n c o d e d a s f o l l o w s :
*
* Bit0 : 0 = dcache,1 =icache
* Bit1 : 0 = recoverable,1 =unrecoverable
* /
.globl cheetah_plus_dcpe_trap_vector
.type cheetah_ p l u s _ d c p e _ t r a p _ v e c t o r ,#f u n c t i o n
cheetah_plus_dcpe_trap_vector :
membar #S y n c
sethi % h i ( d o _ c h e e t a h _ p l u s _ d a t a _ p a r i t y ) , % g 7
jmpl % g 7 + % l o ( d o _ c h e e t a h _ p l u s _ d a t a _ p a r i t y ) , % g 0
nop
nop
nop
nop
nop
.size cheetah_ p l u s _ d c p e _ t r a p _ v e c t o r ,. - c h e e t a h _ p l u s _ d c p e _ t r a p _ v e c t o r
.type do_ c h e e t a h _ p l u s _ d a t a _ p a r i t y ,#f u n c t i o n
do_cheetah_plus_data_parity :
rdpr % p i l , % g 2
2008-11-24 08:55:29 +03:00
wrpr % g 0 , P I L _ N O R M A L _ M A X , % p i l
2008-04-28 11:47:20 +04:00
ba,p t % x c c , e t r a p _ i r q
rd % p c , % g 7
# ifdef C O N F I G _ T R A C E _ I R Q F L A G S
call t r a c e _ h a r d i r q s _ o f f
nop
# endif
mov 0 x0 , % o 0
call c h e e t a h _ p l u s _ p a r i t y _ e r r o r
add % s p , P T R E G S _ O F F , % o 1
ba,a ,p t % x c c , r t r a p _ i r q
.size do_ c h e e t a h _ p l u s _ d a t a _ p a r i t y ,. - d o _ c h e e t a h _ p l u s _ d a t a _ p a r i t y
.globl cheetah_plus_dcpe_trap_vector_tl1
.type cheetah_ p l u s _ d c p e _ t r a p _ v e c t o r _ t l 1 ,#f u n c t i o n
cheetah_plus_dcpe_trap_vector_tl1 :
membar #S y n c
wrpr P S T A T E _ I G | P S T A T E _ P E F | P S T A T E _ P R I V , % p s t a t e
sethi % h i ( d o _ d c p e _ t l 1 ) , % g 3
jmpl % g 3 + % l o ( d o _ d c p e _ t l 1 ) , % g 0
nop
nop
nop
nop
.size cheetah_ p l u s _ d c p e _ t r a p _ v e c t o r _ t l 1 ,. - c h e e t a h _ p l u s _ d c p e _ t r a p _ v e c t o r _ t l 1
.globl cheetah_plus_icpe_trap_vector
.type cheetah_ p l u s _ i c p e _ t r a p _ v e c t o r ,#f u n c t i o n
cheetah_plus_icpe_trap_vector :
membar #S y n c
sethi % h i ( d o _ c h e e t a h _ p l u s _ i n s n _ p a r i t y ) , % g 7
jmpl % g 7 + % l o ( d o _ c h e e t a h _ p l u s _ i n s n _ p a r i t y ) , % g 0
nop
nop
nop
nop
nop
.size cheetah_ p l u s _ i c p e _ t r a p _ v e c t o r ,. - c h e e t a h _ p l u s _ i c p e _ t r a p _ v e c t o r
.type do_ c h e e t a h _ p l u s _ i n s n _ p a r i t y ,#f u n c t i o n
do_cheetah_plus_insn_parity :
rdpr % p i l , % g 2
2008-11-24 08:55:29 +03:00
wrpr % g 0 , P I L _ N O R M A L _ M A X , % p i l
2008-04-28 11:47:20 +04:00
ba,p t % x c c , e t r a p _ i r q
rd % p c , % g 7
# ifdef C O N F I G _ T R A C E _ I R Q F L A G S
call t r a c e _ h a r d i r q s _ o f f
nop
# endif
mov 0 x1 , % o 0
call c h e e t a h _ p l u s _ p a r i t y _ e r r o r
add % s p , P T R E G S _ O F F , % o 1
ba,a ,p t % x c c , r t r a p _ i r q
.size do_ c h e e t a h _ p l u s _ i n s n _ p a r i t y ,. - d o _ c h e e t a h _ p l u s _ i n s n _ p a r i t y
.globl cheetah_plus_icpe_trap_vector_tl1
.type cheetah_ p l u s _ i c p e _ t r a p _ v e c t o r _ t l 1 ,#f u n c t i o n
cheetah_plus_icpe_trap_vector_tl1 :
membar #S y n c
wrpr P S T A T E _ I G | P S T A T E _ P E F | P S T A T E _ P R I V , % p s t a t e
sethi % h i ( d o _ i c p e _ t l 1 ) , % g 3
jmpl % g 3 + % l o ( d o _ i c p e _ t l 1 ) , % g 0
nop
nop
nop
nop
.size cheetah_ p l u s _ i c p e _ t r a p _ v e c t o r _ t l 1 ,. - c h e e t a h _ p l u s _ i c p e _ t r a p _ v e c t o r _ t l 1
/ * If w e t a k e o n e o f t h e s e t r a p s w h e n t l > = 1 , t h e n w e
* jump t o i n t e r r u p t g l o b a l s . I f s o m e t r a p l e v e l a b o v e u s
* was a l s o u s i n g i n t e r r u p t g l o b a l s , w e c a n n o t r e c o v e r .
* We m a y u s e a l l i n t e r r u p t g l o b a l r e g i s t e r s e x c e p t % g 6 .
* /
.globl do_dcpe_tl1
.type do_ d c p e _ t l 1 ,#f u n c t i o n
do_dcpe_tl1 :
rdpr % t l , % g 1 ! S a v e o r i g i n a l t r a p l e v e l
mov 1 , % g 2 ! S e t u p T S T A T E c h e c k i n g l o o p
sethi % h i ( T S T A T E _ I G ) , % g 3 ! T S T A T E m a s k b i t
1 : wrpr % g 2 , % t l ! S e t t r a p l e v e l t o c h e c k
rdpr % t s t a t e , % g 4 ! R e a d T S T A T E f o r t h i s l e v e l
andcc % g 4 , % g 3 , % g 0 ! I n t e r r u p t g l o b a l s i n u s e ?
bne,a ,p n % x c c , d o _ d c p e _ t l 1 _ f a t a l ! Y e p , i r r e c o v e r a b l e
wrpr % g 1 , % t l ! R e s t o r e o r i g i n a l t r a p l e v e l
add % g 2 , 1 , % g 2 ! N e x t t r a p l e v e l
cmp % g 2 , % g 1 ! H i t t h e m a l l y e t ?
ble,p t % i c c , 1 b ! N o t y e t
nop
wrpr % g 1 , % t l ! R e s t o r e o r i g i n a l t r a p l e v e l
do_dcpe_tl1_nonfatal : /* Ok we may use interrupt globals safely. */
sethi % h i ( d c a c h e _ p a r i t y _ t l 1 _ o c c u r r e d ) , % g 2
lduw [ % g 2 + % l o ( d c a c h e _ p a r i t y _ t l 1 _ o c c u r r e d ) ] , % g 1
add % g 1 , 1 , % g 1
stw % g 1 , [ % g 2 + % l o ( d c a c h e _ p a r i t y _ t l 1 _ o c c u r r e d ) ]
/* Reset D-cache parity */
sethi % h i ( 1 < < 1 6 ) , % g 1 ! D - c a c h e s i z e
mov ( 1 < < 5 ) , % g 2 ! D - c a c h e l i n e s i z e
sub % g 1 , % g 2 , % g 1 ! M o v e d o w n 1 c a c h e l i n e
1 : srl % g 1 , 1 4 , % g 3 ! C o m p u t e U T A G
membar #S y n c
stxa % g 3 , [ % g 1 ] A S I _ D C A C H E _ U T A G
membar #S y n c
sub % g 2 , 8 , % g 3 ! 6 4 - b i t d a t a w o r d w i t h i n l i n e
2 : membar #S y n c
stxa % g 0 , [ % g 1 + % g 3 ] A S I _ D C A C H E _ D A T A
membar #S y n c
subcc % g 3 , 8 , % g 3 ! N e x t 6 4 - b i t d a t a w o r d
bge,p t % i c c , 2 b
nop
subcc % g 1 , % g 2 , % g 1 ! N e x t c a c h e l i n e
bge,p t % i c c , 1 b
nop
ba,p t % x c c , d c p e _ i c p e _ t l 1 _ c o m m o n
nop
do_dcpe_tl1_fatal :
sethi % h i ( 1 f ) , % g 7
ba,p t % x c c , e t r a p t l 1
1 : or % g 7 , % l o ( 1 b ) , % g 7
mov 0 x2 , % o 0
call c h e e t a h _ p l u s _ p a r i t y _ e r r o r
add % s p , P T R E G S _ O F F , % o 1
ba,p t % x c c , r t r a p
nop
.size do_ d c p e _ t l 1 ,. - d o _ d c p e _ t l 1
.globl do_icpe_tl1
.type do_ i c p e _ t l 1 ,#f u n c t i o n
do_icpe_tl1 :
rdpr % t l , % g 1 ! S a v e o r i g i n a l t r a p l e v e l
mov 1 , % g 2 ! S e t u p T S T A T E c h e c k i n g l o o p
sethi % h i ( T S T A T E _ I G ) , % g 3 ! T S T A T E m a s k b i t
1 : wrpr % g 2 , % t l ! S e t t r a p l e v e l t o c h e c k
rdpr % t s t a t e , % g 4 ! R e a d T S T A T E f o r t h i s l e v e l
andcc % g 4 , % g 3 , % g 0 ! I n t e r r u p t g l o b a l s i n u s e ?
bne,a ,p n % x c c , d o _ i c p e _ t l 1 _ f a t a l ! Y e p , i r r e c o v e r a b l e
wrpr % g 1 , % t l ! R e s t o r e o r i g i n a l t r a p l e v e l
add % g 2 , 1 , % g 2 ! N e x t t r a p l e v e l
cmp % g 2 , % g 1 ! H i t t h e m a l l y e t ?
ble,p t % i c c , 1 b ! N o t y e t
nop
wrpr % g 1 , % t l ! R e s t o r e o r i g i n a l t r a p l e v e l
do_icpe_tl1_nonfatal : /* Ok we may use interrupt globals safely. */
sethi % h i ( i c a c h e _ p a r i t y _ t l 1 _ o c c u r r e d ) , % g 2
lduw [ % g 2 + % l o ( i c a c h e _ p a r i t y _ t l 1 _ o c c u r r e d ) ] , % g 1
add % g 1 , 1 , % g 1
stw % g 1 , [ % g 2 + % l o ( i c a c h e _ p a r i t y _ t l 1 _ o c c u r r e d ) ]
/* Flush I-cache */
sethi % h i ( 1 < < 1 5 ) , % g 1 ! I - c a c h e s i z e
mov ( 1 < < 5 ) , % g 2 ! I - c a c h e l i n e s i z e
sub % g 1 , % g 2 , % g 1
1 : or % g 1 , ( 2 < < 3 ) , % g 3
stxa % g 0 , [ % g 3 ] A S I _ I C _ T A G
membar #S y n c
subcc % g 1 , % g 2 , % g 1
bge,p t % i c c , 1 b
nop
ba,p t % x c c , d c p e _ i c p e _ t l 1 _ c o m m o n
nop
do_icpe_tl1_fatal :
sethi % h i ( 1 f ) , % g 7
ba,p t % x c c , e t r a p t l 1
1 : or % g 7 , % l o ( 1 b ) , % g 7
mov 0 x3 , % o 0
call c h e e t a h _ p l u s _ p a r i t y _ e r r o r
add % s p , P T R E G S _ O F F , % o 1
ba,p t % x c c , r t r a p
nop
.size do_ i c p e _ t l 1 ,. - d o _ i c p e _ t l 1
.type dcpe_ i c p e _ t l 1 _ c o m m o n ,#f u n c t i o n
dcpe_icpe_tl1_common :
/ * Flush D - c a c h e , r e - e n a b l e D / I c a c h e s i n D C U a n d f i n a l l y
* retry t h e t r a p p i n g i n s t r u c t i o n .
* /
sethi % h i ( 1 < < 1 6 ) , % g 1 ! D - c a c h e s i z e
mov ( 1 < < 5 ) , % g 2 ! D - c a c h e l i n e s i z e
sub % g 1 , % g 2 , % g 1
1 : stxa % g 0 , [ % g 1 ] A S I _ D C A C H E _ T A G
membar #S y n c
subcc % g 1 , % g 2 , % g 1
bge,p t % i c c , 1 b
nop
ldxa [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G , % g 1
or % g 1 , ( D C U _ D C | D C U _ I C ) , % g 1
stxa % g 1 , [ % g 0 ] A S I _ D C U _ C O N T R O L _ R E G
membar #S y n c
retry
.size dcpe_ i c p e _ t l 1 _ c o m m o n ,. - d c p e _ i c p e _ t l 1 _ c o m m o n
/ * Capture I / D / E - c a c h e s t a t e i n t o p e r - c p u e r r o r s c o r e b o a r d .
*
* % g1 : ( TL> =0 ) ? 1 : 0
* % g2 : scratch
* % g3 : scratch
* % g4 : AFSR
* % g5 : AFAR
* % g6 : unused, w i l l h a v e c u r r e n t t h r e a d p t r a f t e r e t r a p
* % g7 : scratch
* /
.type _ _ cheetah_ l o g _ e r r o r ,#f u n c t i o n
__cheetah_log_error :
/* Put "TL1" software bit into AFSR. */
and % g 1 , 0 x1 , % g 1
sllx % g 1 , 6 3 , % g 2
or % g 4 , % g 2 , % g 4
/* Get log entry pointer for this cpu at this trap level. */
BRANCH_ I F _ J A L A P E N O ( g 2 ,g 3 ,5 0 f )
ldxa [ % g 0 ] A S I _ S A F A R I _ C O N F I G , % g 2
srlx % g 2 , 1 7 , % g 2
ba,p t % x c c , 6 0 f
and % g 2 , 0 x3 f f , % g 2
50 : ldxa [ % g 0 ] A S I _ J B U S _ C O N F I G , % g 2
srlx % g 2 , 1 7 , % g 2
and % g 2 , 0 x1 f , % g 2
60 : sllx % g 2 , 9 , % g 2
sethi % h i ( c h e e t a h _ e r r o r _ l o g ) , % g 3
ldx [ % g 3 + % l o ( c h e e t a h _ e r r o r _ l o g ) ] , % g 3
brz,p n % g 3 , 8 0 f
nop
add % g 3 , % g 2 , % g 3
sllx % g 1 , 8 , % g 1
add % g 3 , % g 1 , % g 1
/* %g1 holds pointer to the top of the logging scoreboard */
ldx [ % g 1 + 0 x0 ] , % g 7
cmp % g 7 , - 1
bne,p n % x c c , 8 0 f
nop
stx % g 4 , [ % g 1 + 0 x0 ]
stx % g 5 , [ % g 1 + 0 x8 ]
add % g 1 , 0 x10 , % g 1
/* %g1 now points to D-cache logging area */
set 0 x3 f f8 , % g 2 / * D C _ a d d r m a s k * /
and % g 5 , % g 2 , % g 2 / * D C _ a d d r b i t s o f A F A R * /
srlx % g 5 , 1 2 , % g 3
or % g 3 , 1 , % g 3 / * P H Y S t a g + v a l i d * /
10 : ldxa [ % g 2 ] A S I _ D C A C H E _ T A G , % g 7
cmp % g 3 , % g 7 / * T A G m a t c h ? * /
bne,p t % x c c , 1 3 f
nop
/* Yep, what we want, capture state. */
stx % g 2 , [ % g 1 + 0 x20 ]
stx % g 7 , [ % g 1 + 0 x28 ]
/* A membar Sync is required before and after utag access. */
membar #S y n c
ldxa [ % g 2 ] A S I _ D C A C H E _ U T A G , % g 7
membar #S y n c
stx % g 7 , [ % g 1 + 0 x30 ]
ldxa [ % g 2 ] A S I _ D C A C H E _ S N O O P _ T A G , % g 7
stx % g 7 , [ % g 1 + 0 x38 ]
clr % g 3
12 : ldxa [ % g 2 + % g 3 ] A S I _ D C A C H E _ D A T A , % g 7
stx % g 7 , [ % g 1 ]
add % g 3 , ( 1 < < 5 ) , % g 3
cmp % g 3 , ( 4 < < 5 )
bl,p t % x c c , 1 2 b
add % g 1 , 0 x8 , % g 1
ba,p t % x c c , 2 0 f
add % g 1 , 0 x20 , % g 1
13 : sethi % h i ( 1 < < 1 4 ) , % g 7
add % g 2 , % g 7 , % g 2
srlx % g 2 , 1 4 , % g 7
cmp % g 7 , 4
bl,p t % x c c , 1 0 b
nop
add % g 1 , 0 x40 , % g 1
/* %g1 now points to I-cache logging area */
20 : set 0 x1 f e 0 , % g 2 / * I C _ a d d r m a s k * /
and % g 5 , % g 2 , % g 2 / * I C _ a d d r b i t s o f A F A R * /
sllx % g 2 , 1 , % g 2 / * I C _ a d d r [ 1 3 : 6 ] = =VA [ 1 2 : 5 ] * /
srlx % g 5 , ( 1 3 - 8 ) , % g 3 / * M a k e P T A G * /
andn % g 3 , 0 x f f , % g 3 / * M a s k o f f u n d e f i n e d b i t s * /
21 : ldxa [ % g 2 ] A S I _ I C _ T A G , % g 7
andn % g 7 , 0 x f f , % g 7
cmp % g 3 , % g 7
bne,p t % x c c , 2 3 f
nop
/* Yep, what we want, capture state. */
stx % g 2 , [ % g 1 + 0 x40 ]
stx % g 7 , [ % g 1 + 0 x48 ]
add % g 2 , ( 1 < < 3 ) , % g 2
ldxa [ % g 2 ] A S I _ I C _ T A G , % g 7
add % g 2 , ( 1 < < 3 ) , % g 2
stx % g 7 , [ % g 1 + 0 x50 ]
ldxa [ % g 2 ] A S I _ I C _ T A G , % g 7
add % g 2 , ( 1 < < 3 ) , % g 2
stx % g 7 , [ % g 1 + 0 x60 ]
ldxa [ % g 2 ] A S I _ I C _ T A G , % g 7
stx % g 7 , [ % g 1 + 0 x68 ]
sub % g 2 , ( 3 < < 3 ) , % g 2
ldxa [ % g 2 ] A S I _ I C _ S T A G , % g 7
stx % g 7 , [ % g 1 + 0 x58 ]
clr % g 3
srlx % g 2 , 2 , % g 2
22 : ldxa [ % g 2 + % g 3 ] A S I _ I C _ I N S T R , % g 7
stx % g 7 , [ % g 1 ]
add % g 3 , ( 1 < < 3 ) , % g 3
cmp % g 3 , ( 8 < < 3 )
bl,p t % x c c , 2 2 b
add % g 1 , 0 x8 , % g 1
ba,p t % x c c , 3 0 f
add % g 1 , 0 x30 , % g 1
23 : sethi % h i ( 1 < < 1 4 ) , % g 7
add % g 2 , % g 7 , % g 2
srlx % g 2 , 1 4 , % g 7
cmp % g 7 , 4
bl,p t % x c c , 2 1 b
nop
add % g 1 , 0 x70 , % g 1
/* %g1 now points to E-cache logging area */
30 : andn % g 5 , ( 3 2 - 1 ) , % g 2
stx % g 2 , [ % g 1 + 0 x20 ]
ldxa [ % g 2 ] A S I _ E C _ T A G _ D A T A , % g 7
stx % g 7 , [ % g 1 + 0 x28 ]
ldxa [ % g 2 ] A S I _ E C _ R , % g 0
clr % g 3
31 : ldxa [ % g 3 ] A S I _ E C _ D A T A , % g 7
stx % g 7 , [ % g 1 + % g 3 ]
add % g 3 , 0 x8 , % g 3
cmp % g 3 , 0 x20
bl,p t % x c c , 3 1 b
nop
80 :
rdpr % t t , % g 2
cmp % g 2 , 0 x70
be c _ f a s t _ e c c
cmp % g 2 , 0 x63
be c _ c e e
nop
ba,p t % x c c , c _ d e f e r r e d
.size _ _ cheetah_ l o g _ e r r o r ,. - _ _ c h e e t a h _ l o g _ e r r o r
/ * Cheetah F E C C t r a p h a n d l i n g , w e g e t h e r e f r o m t l { 0 ,1 } _ f e c c
* in t h e t r a p t a b l e . T h a t c o d e h a s d o n e a m e m o r y b a r r i e r
* and h a s d i s a b l e d b o t h t h e I - c a c h e a n d D - c a c h e i n t h e D C U
* control r e g i s t e r . T h e I - c a c h e i s d i s a b l e d s o t h a t w e m a y
* capture t h e c o r r u p t e d c a c h e l i n e , a n d t h e D - c a c h e i s d i s a b l e d
* because c o r r u p t d a t a m a y h a v e b e e n p l a c e d t h e r e a n d w e d o n ' t
* want t o r e f e r e n c e i t .
*
* % g1 i s o n e i f t h i s t r a p o c c u r r e d a t % t l > = 1 .
*
* Next, w e t u r n o f f e r r o r r e p o r t i n g s o t h a t w e d o n ' t r e c u r s e .
* /
.globl cheetah_fast_ecc
.type cheetah_ f a s t _ e c c ,#f u n c t i o n
cheetah_fast_ecc :
ldxa [ % g 0 ] A S I _ E S T A T E _ E R R O R _ E N , % g 2
andn % g 2 , E S T A T E _ E R R O R _ N C E E N | E S T A T E _ E R R O R _ C E E N , % g 2
stxa % g 2 , [ % g 0 ] A S I _ E S T A T E _ E R R O R _ E N
membar #S y n c
/* Fetch and clear AFSR/AFAR */
ldxa [ % g 0 ] A S I _ A F S R , % g 4
ldxa [ % g 0 ] A S I _ A F A R , % g 5
stxa % g 4 , [ % g 0 ] A S I _ A F S R
membar #S y n c
ba,p t % x c c , _ _ c h e e t a h _ l o g _ e r r o r
nop
.size cheetah_ f a s t _ e c c ,. - c h e e t a h _ f a s t _ e c c
.type c_ f a s t _ e c c ,#f u n c t i o n
c_fast_ecc :
rdpr % p i l , % g 2
2008-11-24 08:55:29 +03:00
wrpr % g 0 , P I L _ N O R M A L _ M A X , % p i l
2008-04-28 11:47:20 +04:00
ba,p t % x c c , e t r a p _ i r q
rd % p c , % g 7
# ifdef C O N F I G _ T R A C E _ I R Q F L A G S
call t r a c e _ h a r d i r q s _ o f f
nop
# endif
mov % l 4 , % o 1
mov % l 5 , % o 2
call c h e e t a h _ f e c c _ h a n d l e r
add % s p , P T R E G S _ O F F , % o 0
ba,a ,p t % x c c , r t r a p _ i r q
.size c_ f a s t _ e c c ,. - c _ f a s t _ e c c
/* Our caller has disabled I-cache and performed membar Sync. */
.globl cheetah_cee
.type cheetah_ c e e ,#f u n c t i o n
cheetah_cee :
ldxa [ % g 0 ] A S I _ E S T A T E _ E R R O R _ E N , % g 2
andn % g 2 , E S T A T E _ E R R O R _ C E E N , % g 2
stxa % g 2 , [ % g 0 ] A S I _ E S T A T E _ E R R O R _ E N
membar #S y n c
/* Fetch and clear AFSR/AFAR */
ldxa [ % g 0 ] A S I _ A F S R , % g 4
ldxa [ % g 0 ] A S I _ A F A R , % g 5
stxa % g 4 , [ % g 0 ] A S I _ A F S R
membar #S y n c
ba,p t % x c c , _ _ c h e e t a h _ l o g _ e r r o r
nop
.size cheetah_ c e e ,. - c h e e t a h _ c e e
.type c_ c e e ,#f u n c t i o n
c_cee :
rdpr % p i l , % g 2
2008-11-24 08:55:29 +03:00
wrpr % g 0 , P I L _ N O R M A L _ M A X , % p i l
2008-04-28 11:47:20 +04:00
ba,p t % x c c , e t r a p _ i r q
rd % p c , % g 7
# ifdef C O N F I G _ T R A C E _ I R Q F L A G S
call t r a c e _ h a r d i r q s _ o f f
nop
# endif
mov % l 4 , % o 1
mov % l 5 , % o 2
call c h e e t a h _ c e e _ h a n d l e r
add % s p , P T R E G S _ O F F , % o 0
ba,a ,p t % x c c , r t r a p _ i r q
.size c_ c e e ,. - c _ c e e
/* Our caller has disabled I-cache+D-cache and performed membar Sync. */
.globl cheetah_deferred_trap
.type cheetah_ d e f e r r e d _ t r a p ,#f u n c t i o n
cheetah_deferred_trap :
ldxa [ % g 0 ] A S I _ E S T A T E _ E R R O R _ E N , % g 2
andn % g 2 , E S T A T E _ E R R O R _ N C E E N | E S T A T E _ E R R O R _ C E E N , % g 2
stxa % g 2 , [ % g 0 ] A S I _ E S T A T E _ E R R O R _ E N
membar #S y n c
/* Fetch and clear AFSR/AFAR */
ldxa [ % g 0 ] A S I _ A F S R , % g 4
ldxa [ % g 0 ] A S I _ A F A R , % g 5
stxa % g 4 , [ % g 0 ] A S I _ A F S R
membar #S y n c
ba,p t % x c c , _ _ c h e e t a h _ l o g _ e r r o r
nop
.size cheetah_ d e f e r r e d _ t r a p ,. - c h e e t a h _ d e f e r r e d _ t r a p
.type c_ d e f e r r e d ,#f u n c t i o n
c_deferred :
rdpr % p i l , % g 2
2008-11-24 08:55:29 +03:00
wrpr % g 0 , P I L _ N O R M A L _ M A X , % p i l
2008-04-28 11:47:20 +04:00
ba,p t % x c c , e t r a p _ i r q
rd % p c , % g 7
# ifdef C O N F I G _ T R A C E _ I R Q F L A G S
call t r a c e _ h a r d i r q s _ o f f
nop
# endif
mov % l 4 , % o 1
mov % l 5 , % o 2
call c h e e t a h _ d e f e r r e d _ h a n d l e r
add % s p , P T R E G S _ O F F , % o 0
ba,a ,p t % x c c , r t r a p _ i r q
.size c_ d e f e r r e d ,. - c _ d e f e r r e d