2005-04-17 02:20:36 +04:00
/ *
* This f i l e i s s u b j e c t t o t h e t e r m s a n d c o n d i t i o n s o f t h e G N U G e n e r a l P u b l i c
* License. S e e t h e f i l e " C O P Y I N G " i n t h e m a i n d i r e c t o r y o f t h i s a r c h i v e
* for m o r e d e t a i l s .
*
* Copyright ( C ) 1 9 9 6 , 1 9 9 8 b y R a l f B a e c h l e
*
* Multi- a r c h a b s t r a c t i o n a n d a s m m a c r o s f o r e a s i e r r e a d i n g :
* Copyright ( C ) 1 9 9 6 D a v i d S . M i l l e r ( d m @engr.sgi.com)
*
* Further m o d i f i c a t i o n s t o m a k e t h i s w o r k :
* Copyright ( c ) 1 9 9 8 H a r a l d K o e r f g e n
* /
# include < a s m / a s m . h >
# include < a s m / e r r n o . h >
# include < a s m / f p r e g d e f . h >
# include < a s m / m i p s r e g s . h >
2005-09-10 00:32:31 +04:00
# include < a s m / a s m - o f f s e t s . h >
2005-04-17 02:20:36 +04:00
# include < a s m / r e g d e f . h >
# define E X ( a ,b ) \
9 : a,## b ; \
.section _ _ ex_ t a b l e ," a " ; \
PTR 9 b ,b a d _ s t a c k ; \
.previous
.set noreorder
.set mips1
/* Save floating point context */
LEAF( _ s a v e _ f p _ c o n t e x t )
li v0 , 0 # a s s u m e s u c c e s s
cfc1 t 1 ,f c r31
EX( s w c1 $ f0 ,( S C _ F P R E G S + 0 ) ( a0 ) )
EX( s w c1 $ f1 ,( S C _ F P R E G S + 8 ) ( a0 ) )
EX( s w c1 $ f2 ,( S C _ F P R E G S + 1 6 ) ( a0 ) )
EX( s w c1 $ f3 ,( S C _ F P R E G S + 2 4 ) ( a0 ) )
EX( s w c1 $ f4 ,( S C _ F P R E G S + 3 2 ) ( a0 ) )
EX( s w c1 $ f5 ,( S C _ F P R E G S + 4 0 ) ( a0 ) )
EX( s w c1 $ f6 ,( S C _ F P R E G S + 4 8 ) ( a0 ) )
EX( s w c1 $ f7 ,( S C _ F P R E G S + 5 6 ) ( a0 ) )
EX( s w c1 $ f8 ,( S C _ F P R E G S + 6 4 ) ( a0 ) )
EX( s w c1 $ f9 ,( S C _ F P R E G S + 7 2 ) ( a0 ) )
EX( s w c1 $ f10 ,( S C _ F P R E G S + 8 0 ) ( a0 ) )
EX( s w c1 $ f11 ,( S C _ F P R E G S + 8 8 ) ( a0 ) )
EX( s w c1 $ f12 ,( S C _ F P R E G S + 9 6 ) ( a0 ) )
EX( s w c1 $ f13 ,( S C _ F P R E G S + 1 0 4 ) ( a0 ) )
EX( s w c1 $ f14 ,( S C _ F P R E G S + 1 1 2 ) ( a0 ) )
EX( s w c1 $ f15 ,( S C _ F P R E G S + 1 2 0 ) ( a0 ) )
EX( s w c1 $ f16 ,( S C _ F P R E G S + 1 2 8 ) ( a0 ) )
EX( s w c1 $ f17 ,( S C _ F P R E G S + 1 3 6 ) ( a0 ) )
EX( s w c1 $ f18 ,( S C _ F P R E G S + 1 4 4 ) ( a0 ) )
EX( s w c1 $ f19 ,( S C _ F P R E G S + 1 5 2 ) ( a0 ) )
EX( s w c1 $ f20 ,( S C _ F P R E G S + 1 6 0 ) ( a0 ) )
EX( s w c1 $ f21 ,( S C _ F P R E G S + 1 6 8 ) ( a0 ) )
EX( s w c1 $ f22 ,( S C _ F P R E G S + 1 7 6 ) ( a0 ) )
EX( s w c1 $ f23 ,( S C _ F P R E G S + 1 8 4 ) ( a0 ) )
EX( s w c1 $ f24 ,( S C _ F P R E G S + 1 9 2 ) ( a0 ) )
EX( s w c1 $ f25 ,( S C _ F P R E G S + 2 0 0 ) ( a0 ) )
EX( s w c1 $ f26 ,( S C _ F P R E G S + 2 0 8 ) ( a0 ) )
EX( s w c1 $ f27 ,( S C _ F P R E G S + 2 1 6 ) ( a0 ) )
EX( s w c1 $ f28 ,( S C _ F P R E G S + 2 2 4 ) ( a0 ) )
EX( s w c1 $ f29 ,( S C _ F P R E G S + 2 3 2 ) ( a0 ) )
EX( s w c1 $ f30 ,( S C _ F P R E G S + 2 4 0 ) ( a0 ) )
EX( s w c1 $ f31 ,( S C _ F P R E G S + 2 4 8 ) ( a0 ) )
EX( s w t 1 ,( S C _ F P C _ C S R ) ( a0 ) )
cfc1 t 0 ,$ 0 # i m p l e m e n t a t i o n / v e r s i o n
jr r a
.set nomacro
EX( s w t 0 ,( S C _ F P C _ E I R ) ( a0 ) )
.set macro
END( _ s a v e _ f p _ c o n t e x t )
/ *
* Restore F P U s t a t e :
* - fp g p r e g i s t e r s
* - cp1 s t a t u s / c o n t r o l r e g i s t e r
*
* We b a s e t h e d e c i s i o n w h i c h r e g i s t e r s t o r e s t o r e f r o m t h e s i g n a l s t a c k
* frame o n t h e c u r r e n t c o n t e n t o f c0 _ s t a t u s , n o t o n t h e c o n t e n t o f t h e
* stack f r a m e w h i c h m i g h t h a v e b e e n c h a n g e d b y t h e u s e r .
* /
LEAF( _ r e s t o r e _ f p _ c o n t e x t )
li v0 , 0 # a s s u m e s u c c e s s
EX( l w t 0 ,( S C _ F P C _ C S R ) ( a0 ) )
EX( l w c1 $ f0 ,( S C _ F P R E G S + 0 ) ( a0 ) )
EX( l w c1 $ f1 ,( S C _ F P R E G S + 8 ) ( a0 ) )
EX( l w c1 $ f2 ,( S C _ F P R E G S + 1 6 ) ( a0 ) )
EX( l w c1 $ f3 ,( S C _ F P R E G S + 2 4 ) ( a0 ) )
EX( l w c1 $ f4 ,( S C _ F P R E G S + 3 2 ) ( a0 ) )
EX( l w c1 $ f5 ,( S C _ F P R E G S + 4 0 ) ( a0 ) )
EX( l w c1 $ f6 ,( S C _ F P R E G S + 4 8 ) ( a0 ) )
EX( l w c1 $ f7 ,( S C _ F P R E G S + 5 6 ) ( a0 ) )
EX( l w c1 $ f8 ,( S C _ F P R E G S + 6 4 ) ( a0 ) )
EX( l w c1 $ f9 ,( S C _ F P R E G S + 7 2 ) ( a0 ) )
EX( l w c1 $ f10 ,( S C _ F P R E G S + 8 0 ) ( a0 ) )
EX( l w c1 $ f11 ,( S C _ F P R E G S + 8 8 ) ( a0 ) )
EX( l w c1 $ f12 ,( S C _ F P R E G S + 9 6 ) ( a0 ) )
EX( l w c1 $ f13 ,( S C _ F P R E G S + 1 0 4 ) ( a0 ) )
EX( l w c1 $ f14 ,( S C _ F P R E G S + 1 1 2 ) ( a0 ) )
EX( l w c1 $ f15 ,( S C _ F P R E G S + 1 2 0 ) ( a0 ) )
EX( l w c1 $ f16 ,( S C _ F P R E G S + 1 2 8 ) ( a0 ) )
EX( l w c1 $ f17 ,( S C _ F P R E G S + 1 3 6 ) ( a0 ) )
EX( l w c1 $ f18 ,( S C _ F P R E G S + 1 4 4 ) ( a0 ) )
EX( l w c1 $ f19 ,( S C _ F P R E G S + 1 5 2 ) ( a0 ) )
EX( l w c1 $ f20 ,( S C _ F P R E G S + 1 6 0 ) ( a0 ) )
EX( l w c1 $ f21 ,( S C _ F P R E G S + 1 6 8 ) ( a0 ) )
EX( l w c1 $ f22 ,( S C _ F P R E G S + 1 7 6 ) ( a0 ) )
EX( l w c1 $ f23 ,( S C _ F P R E G S + 1 8 4 ) ( a0 ) )
EX( l w c1 $ f24 ,( S C _ F P R E G S + 1 9 2 ) ( a0 ) )
EX( l w c1 $ f25 ,( S C _ F P R E G S + 2 0 0 ) ( a0 ) )
EX( l w c1 $ f26 ,( S C _ F P R E G S + 2 0 8 ) ( a0 ) )
EX( l w c1 $ f27 ,( S C _ F P R E G S + 2 1 6 ) ( a0 ) )
EX( l w c1 $ f28 ,( S C _ F P R E G S + 2 2 4 ) ( a0 ) )
EX( l w c1 $ f29 ,( S C _ F P R E G S + 2 3 2 ) ( a0 ) )
EX( l w c1 $ f30 ,( S C _ F P R E G S + 2 4 0 ) ( a0 ) )
EX( l w c1 $ f31 ,( S C _ F P R E G S + 2 4 8 ) ( a0 ) )
jr r a
ctc1 t 0 ,f c r31
END( _ r e s t o r e _ f p _ c o n t e x t )
.set reorder
.type fault@function
.ent fault
fault : li v0 , - E F A U L T
jr r a
.end fault