2005-04-17 02:20:36 +04:00
# 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 >
2005-04-30 01:08:33 +04:00
# include " a b o r t - m a c r o . S "
2005-04-17 02:20:36 +04:00
/ *
* Function : v6 _ e a r l y _ a b o r t
*
2011-06-26 19:01:26 +04:00
* Params : r2 = p t _ r e g s
* : r4 = a b o r t e d c o n t e x t p c
2011-06-26 17:35:07 +04:00
* : r5 = a b o r t e d c o n t e x t p s r
2005-04-17 02:20:36 +04:00
*
2011-06-26 19:01:26 +04:00
* Returns : r4 - r11 , r13 p r e s e r v e d
2005-04-17 02:20:36 +04:00
*
* Purpose : o b t a i n i n f o r m a t i o n a b o u t c u r r e n t a b o r t e d i n s t r u c t i o n .
2005-04-30 01:08:33 +04:00
* Note : we r e a d u s e r s p a c e . T h i s m e a n s w e m i g h t c a u s e a d a t a
* abort h e r e i f t h e I - T L B a n d D - T L B a r e n ' t s e e i n g t h e s a m e
* picture. U n f o r t u n a t e l y , t h i s d o e s h a p p e n . W e l i v e w i t h i t .
2005-04-17 02:20:36 +04:00
* /
.align 5
ENTRY( v6 _ e a r l y _ a b o r t )
2011-01-17 18:35:37 +03:00
# ifdef C O N F I G _ C P U _ V 6
2009-03-03 00:39:36 +03:00
sub r1 , s p , #4 @ Get unused stack location
strex r0 , r1 , [ r1 ] @ Clear the exclusive monitor
2011-01-17 18:35:37 +03:00
# elif d e f i n e d ( C O N F I G _ C P U _ 3 2 v6 K )
clrex
2005-10-03 01:34:35 +04:00
# endif
2005-04-17 02:20:36 +04:00
mrc p15 , 0 , r1 , c5 , c0 , 0 @ get FSR
mrc p15 , 0 , r0 , c6 , c0 , 0 @ get FAR
2005-04-30 01:08:33 +04:00
/ *
2009-04-01 16:53:48 +04:00
* Faulty S W P i n s t r u c t i o n o n 1 1 3 6 d o e s n ' t s e t b i t 1 1 i n D F S R ( e r r a t u m 3 2 6 1 0 3 ) .
2005-04-30 01:08:33 +04:00
* The t e s t b e l o w c o v e r s a l l t h e w r i t e s i t u a t i o n s , i n c l u d i n g J a v a b y t e c o d e s
* /
2009-04-01 16:53:48 +04:00
bic r1 , r1 , #1 < < 1 1 @ clear bit 11 of FSR
2011-06-26 17:35:07 +04:00
tst r5 , #P S R _ J _ B I T @ J a v a ?
2011-06-26 19:01:26 +04:00
bne d o _ D a t a A b o r t
2011-06-26 17:35:07 +04:00
do_ t h u m b _ a b o r t f s r =r1 , p c =r4 , p s r =r5 , t m p =r3
ldreq r3 , [ r4 ] @ read aborted ARM instruction
2009-05-30 17:00:18 +04:00
# ifdef C O N F I G _ C P U _ E N D I A N _ B E 8
reveq r3 , r3
# endif
2011-06-26 17:42:02 +04:00
do_ l d r d _ a b o r t t m p =ip , i n s n =r3
2005-04-30 01:08:33 +04:00
tst r3 , #1 < < 2 0 @ L = 0 -> write
orreq r1 , r1 , #1 < < 1 1 @ yes.
2011-06-26 19:01:26 +04:00
b d o _ D a t a A b o r t