2005-04-17 02:20:36 +04:00
/ *
* File : mca_ d r v _ a s m . S
* Purpose : Assembly p o r t i o n o f G e n e r i c M C A h a n d l i n g
*
* Copyright ( C ) 2 0 0 4 F U J I T S U L I M I T E D
2008-01-07 04:11:57 +03:00
* Copyright ( C ) 2 0 0 4 H i d e t o s h i S e t o < s e t o . h i d e t o s h i @jp.fujitsu.com>
2005-04-17 02:20:36 +04:00
* /
# include < l i n u x / t h r e a d s . h >
# include < a s m / a s m m a c r o . h >
# include < a s m / p r o c e s s o r . h >
2005-04-06 11:07:00 +04:00
# include < a s m / p t r a c e . h >
2005-04-17 02:20:36 +04:00
GLOBAL_ E N T R Y ( m c a _ h a n d l e r _ b h h o o k )
2005-09-16 08:44:56 +04:00
invala / / c l e a r R S E ?
cover
;;
clrrrb
2005-04-17 02:20:36 +04:00
;;
2006-03-24 20:49:52 +03:00
alloc r16 =ar . p f s ,0 ,2 ,3 ,0 / / m a k e a n e w f r a m e
2005-09-16 08:44:56 +04:00
mov a r . r s c =0
mov r13 =IA64_KR ( C U R R E N T ) / / c u r r e n t t a s k p o i n t e r
2005-04-17 02:20:36 +04:00
;;
2005-09-16 08:44:56 +04:00
mov r2 =r13
2005-04-06 11:07:00 +04:00
;;
2005-09-16 08:44:56 +04:00
addl r22 =IA64_RBS_OFFSET ,r2
2005-04-06 11:07:00 +04:00
;;
2005-09-16 08:44:56 +04:00
mov a r . b s p s t o r e =r22
addl s p =IA64_STK_OFFSET - I A 6 4 _ P T _ R E G S _ S I Z E ,r2
2005-04-17 02:20:36 +04:00
;;
2005-09-16 08:44:56 +04:00
adds r2 =IA64_TASK_THREAD_ON_USTACK_OFFSET ,r13
2005-04-06 11:07:00 +04:00
;;
2005-09-16 08:44:56 +04:00
st1 [ r2 ] =r0 / / c l e a r c u r r e n t - > t h r e a d . o n _ u s t a c k f l a g
mov l o c0 =r16
movl l o c1 =mca_handler_bh / / r e c o v e r y C f u n c t i o n
2005-04-17 02:20:36 +04:00
;;
2005-09-16 08:44:56 +04:00
mov o u t 0 =r8 / / p o i s o n e d a d d r e s s
2006-03-24 20:49:52 +03:00
mov o u t 1 =r9 / / i i p
mov o u t 2 =r10 / / p s r
2005-09-16 08:44:56 +04:00
mov b6 =loc1
2005-04-17 02:20:36 +04:00
;;
2005-09-16 08:44:56 +04:00
mov l o c1 =rp
2007-06-29 03:05:34 +04:00
ssm p s r . i c
;;
srlz. i
;;
ssm p s r . i
2005-09-16 08:44:56 +04:00
br. c a l l . s p t k . m a n y r p =b6 / / d o e s n o t r e t u r n . . .
2005-04-17 02:20:36 +04:00
;;
2005-09-16 08:44:56 +04:00
mov a r . p f s =loc0
mov r p =loc1
2005-04-17 02:20:36 +04:00
;;
2005-09-16 08:44:56 +04:00
mov r8 =r0
2005-04-17 02:20:36 +04:00
br. r e t . s p t k . m a n y r p
END( m c a _ h a n d l e r _ b h h o o k )