2005-04-16 15:20:36 -07:00
| ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
| MOTOROLA M I C R O P R O C E S S O R & M E M O R Y T E C H N O L O G Y G R O U P
| M6 8 0 0 0 H i - P e r f o r m a n c e M i c r o p r o c e s s o r D i v i s i o n
| M6 8 0 6 0 S o f t w a r e P a c k a g e
| Production R e l e a s e P 1 . 0 0 - - O c t o b e r 1 0 , 1 9 9 4
|
2007-10-19 23:21:04 +02:00
| M6 8 0 6 0 S o f t w a r e P a c k a g e C o p y r i g h t © 1 9 9 3 , 1 9 9 4 M o t o r o l a I n c . A l l r i g h t s r e s e r v e d .
2005-04-16 15:20:36 -07:00
|
| THE S O F T W A R E i s p r o v i d e d o n a n " A S I S " b a s i s a n d w i t h o u t w a r r a n t y .
| To t h e m a x i m u m e x t e n t p e r m i t t e d b y a p p l i c a b l e l a w ,
| MOTOROLA D I S C L A I M S A L L W A R R A N T I E S W H E T H E R E X P R E S S O R I M P L I E D ,
| INCLUDING I M P L I E D W A R R A N T I E S O F M E R C H A N T A B I L I T Y O R F I T N E S S F O R A P A R T I C U L A R P U R P O S E
| and a n y w a r r a n t y a g a i n s t i n f r i n g e m e n t w i t h r e g a r d t o t h e S O F T W A R E
| ( INCLUDING A N Y M O D I F I E D V E R S I O N S T H E R E O F ) a n d a n y a c c o m p a n y i n g w r i t t e n m a t e r i a l s .
|
| To t h e m a x i m u m e x t e n t p e r m i t t e d b y a p p l i c a b l e l a w ,
| IN N O E V E N T S H A L L M O T O R O L A B E L I A B L E F O R A N Y D A M A G E S W H A T S O E V E R
| ( INCLUDING W I T H O U T L I M I T A T I O N , D A M A G E S F O R L O S S O F B U S I N E S S P R O F I T S ,
| BUSINESS I N T E R R U P T I O N , L O S S O F B U S I N E S S I N F O R M A T I O N , O R O T H E R P E C U N I A R Y L O S S )
| ARISING O F T H E U S E O R I N A B I L I T Y T O U S E T H E S O F T W A R E .
| Motorola a s s u m e s n o r e s p o n s i b i l i t y f o r t h e m a i n t e n a n c e a n d s u p p o r t o f t h e S O F T W A R E .
|
| You a r e h e r e b y g r a n t e d a c o p y r i g h t l i c e n s e t o u s e , m o d i f y , a n d d i s t r i b u t e t h e S O F T W A R E
| so l o n g a s t h i s e n t i r e n o t i c e i s r e t a i n e d w i t h o u t a l t e r a t i o n i n a n y m o d i f i e d a n d / o r
| redistributed v e r s i o n s , a n d t h a t s u c h m o d i f i e d v e r s i o n s a r e c l e a r l y i d e n t i f i e d a s s u c h .
| No l i c e n s e s a r e g r a n t e d b y i m p l i c a t i o n , e s t o p p e l o r o t h e r w i s e u n d e r a n y p a t e n t s
| or t r a d e m a r k s o f M o t o r o l a , I n c .
| ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
| fskeleton. s
|
| This f i l e c o n t a i n s :
| ( 1 ) example " C a l l - o u t " s
| ( 2 ) example p a c k a g e e n t r y c o d e
| ( 3 ) example " C a l l - o u t " t a b l e
|
# include < l i n u x / l i n k a g e . h >
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
| ( 1 ) EXAMPLE C A L L - O U T S #
| #
| _ 0 6 0 _ fpsp_ d o n e ( ) #
| _ 0 6 0 _ real_ o v f l ( ) #
| _ 0 6 0 _ real_ u n f l ( ) #
| _ 0 6 0 _ real_ o p e r r ( ) #
| _ 0 6 0 _ real_ s n a n ( ) #
| _ 0 6 0 _ real_ d z ( ) #
| _ 0 6 0 _ real_ i n e x ( ) #
| _ 0 6 0 _ real_ b s u n ( ) #
| _ 0 6 0 _ real_ f l i n e ( ) #
| _ 0 6 0 _ real_ f p u _ d i s a b l e d ( ) #
| _ 0 6 0 _ real_ t r a p ( ) #
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
| _ 0 6 0 _ fpsp_ d o n e ( ) :
|
| This i s t h e m a i n e x i t p o i n t f o r t h e 6 8 0 6 0 F l o a t i n g - P o i n t
| Software P a c k a g e . F o r a n o r m a l e x i t , a l l 0 6 0 F P S P r o u t i n e s c a l l t h i s
| routine. T h e o p e r a t i n g s y s t e m c a n d o s y s t e m d e p e n d e n t c l e a n - u p o r
| simply e x e c u t e a n " r t e " a s w i t h t h e s a m p l e c o d e b e l o w .
|
.global _060_fpsp_done
_060_fpsp_done :
bral _ 0 6 0 _ i s p _ d o n e | d o t h e s a m e a s i s p _ d o n e
|
| _ 0 6 0 _ real_ o v f l ( ) :
|
| This i s t h e e x i t p o i n t f o r t h e 0 6 0 F P S P w h e n a n e n a b l e d o v e r f l o w e x c e p t i o n
| is p r e s e n t . T h e r o u t i n e b e l o w s h o u l d p o i n t t o t h e o p e r a t i n g s y s t e m h a n d l e r
| for e n a b l e d o v e r f l o w c o n d i t i o n s . T h e e x c e p t i o n s t a c k f r a m e i s a n o v e r f l o w
| stack f r a m e . T h e F P s t a t e f r a m e h o l d s t h e E X C E P T I O N A L O P E R A N D .
|
| The s a m p l e r o u t i n e b e l o w s i m p l y c l e a r s t h e e x c e p t i o n s t a t u s b i t a n d
| does a n " r t e " .
|
.global _060_real_ovfl
_060_real_ovfl :
fsave - ( % s p )
move. w #0x6000 ,0 x2 ( % s p )
frestore ( % s p ) +
bral t r a p | j u m p t o t r a p h a n d l e r
|
| _ 0 6 0 _ real_ u n f l ( ) :
|
| This i s t h e e x i t p o i n t f o r t h e 0 6 0 F P S P w h e n a n e n a b l e d u n d e r f l o w e x c e p t i o n
| is p r e s e n t . T h e r o u t i n e b e l o w s h o u l d p o i n t t o t h e o p e r a t i n g s y s t e m h a n d l e r
| for e n a b l e d u n d e r f l o w c o n d i t i o n s . T h e e x c e p t i o n s t a c k f r a m e i s a n u n d e r f l o w
| stack f r a m e . T h e F P s t a t e f r a m e h o l d s t h e E X C E P T I O N A L O P E R A N D .
|
| The s a m p l e r o u t i n e b e l o w s i m p l y c l e a r s t h e e x c e p t i o n s t a t u s b i t a n d
| does a n " r t e " .
|
.global _060_real_unfl
_060_real_unfl :
fsave - ( % s p )
move. w #0x6000 ,0 x2 ( % s p )
frestore ( % s p ) +
bral t r a p | j u m p t o t r a p h a n d l e r
|
| _ 0 6 0 _ real_ o p e r r ( ) :
|
| This i s t h e e x i t p o i n t f o r t h e 0 6 0 F P S P w h e n a n e n a b l e d o p e r a n d e r r o r e x c e p t i o n
| is p r e s e n t . T h e r o u t i n e b e l o w s h o u l d p o i n t t o t h e o p e r a t i n g s y s t e m h a n d l e r
| for e n a b l e d o p e r a n d e r r o r e x c e p t i o n s . T h e e x c e p t i o n s t a c k f r a m e i s a n o p e r a n d e r r o r
| stack f r a m e . T h e F P s t a t e f r a m e h o l d s t h e s o u r c e o p e r a n d o f t h e f a u l t i n g
| instruction.
|
| The s a m p l e r o u t i n e b e l o w s i m p l y c l e a r s t h e e x c e p t i o n s t a t u s b i t a n d
| does a n " r t e " .
|
.global _060_real_operr
_060_real_operr :
fsave - ( % s p )
move. w #0x6000 ,0 x2 ( % s p )
frestore ( % s p ) +
bral t r a p | j u m p t o t r a p h a n d l e r
|
| _ 0 6 0 _ real_ s n a n ( ) :
|
| This i s t h e e x i t p o i n t f o r t h e 0 6 0 F P S P w h e n a n e n a b l e d s i g n a l l i n g N a N e x c e p t i o n
| is p r e s e n t . T h e r o u t i n e b e l o w s h o u l d p o i n t t o t h e o p e r a t i n g s y s t e m h a n d l e r
| for e n a b l e d s i g n a l l i n g N a N e x c e p t i o n s . T h e e x c e p t i o n s t a c k f r a m e i s a s i g n a l l i n g N a N
| stack f r a m e . T h e F P s t a t e f r a m e h o l d s t h e s o u r c e o p e r a n d o f t h e f a u l t i n g
| instruction.
|
| The s a m p l e r o u t i n e b e l o w s i m p l y c l e a r s t h e e x c e p t i o n s t a t u s b i t a n d
| does a n " r t e " .
|
.global _060_real_snan
_060_real_snan :
fsave - ( % s p )
move. w #0x6000 ,0 x2 ( % s p )
frestore ( % s p ) +
bral t r a p | j u m p t o t r a p h a n d l e r
|
| _ 0 6 0 _ real_ d z ( ) :
|
| This i s t h e e x i t p o i n t f o r t h e 0 6 0 F P S P w h e n a n e n a b l e d d i v i d e - b y - z e r o e x c e p t i o n
| is p r e s e n t . T h e r o u t i n e b e l o w s h o u l d p o i n t t o t h e o p e r a t i n g s y s t e m h a n d l e r
| for e n a b l e d d i v i d e - b y - z e r o e x c e p t i o n s . T h e e x c e p t i o n s t a c k f r a m e i s a d i v i d e - b y - z e r o
| stack f r a m e . T h e F P s t a t e f r a m e h o l d s t h e s o u r c e o p e r a n d o f t h e f a u l t i n g
| instruction.
|
| The s a m p l e r o u t i n e b e l o w s i m p l y c l e a r s t h e e x c e p t i o n s t a t u s b i t a n d
| does a n " r t e " .
|
.global _060_real_dz
_060_real_dz :
fsave - ( % s p )
move. w #0x6000 ,0 x2 ( % s p )
frestore ( % s p ) +
bral t r a p | j u m p t o t r a p h a n d l e r
|
| _ 0 6 0 _ real_ i n e x ( ) :
|
| This i s t h e e x i t p o i n t f o r t h e 0 6 0 F P S P w h e n a n e n a b l e d i n e x a c t e x c e p t i o n
| is p r e s e n t . T h e r o u t i n e b e l o w s h o u l d p o i n t t o t h e o p e r a t i n g s y s t e m h a n d l e r
| for e n a b l e d i n e x a c t e x c e p t i o n s . T h e e x c e p t i o n s t a c k f r a m e i s a n i n e x a c t
| stack f r a m e . T h e F P s t a t e f r a m e h o l d s t h e s o u r c e o p e r a n d o f t h e f a u l t i n g
| instruction.
|
| The s a m p l e r o u t i n e b e l o w s i m p l y c l e a r s t h e e x c e p t i o n s t a t u s b i t a n d
| does a n " r t e " .
|
.global _060_real_inex
_060_real_inex :
fsave - ( % s p )
move. w #0x6000 ,0 x2 ( % s p )
frestore ( % s p ) +
bral t r a p | j u m p t o t r a p h a n d l e r
|
| _ 0 6 0 _ real_ b s u n ( ) :
|
| This i s t h e e x i t p o i n t f o r t h e 0 6 0 F P S P w h e n a n e n a b l e d b s u n e x c e p t i o n
| is p r e s e n t . T h e r o u t i n e b e l o w s h o u l d p o i n t t o t h e o p e r a t i n g s y s t e m h a n d l e r
| for e n a b l e d b s u n e x c e p t i o n s . T h e e x c e p t i o n s t a c k f r a m e i s a b s u n
| stack f r a m e .
|
| The s a m p l e r o u t i n e b e l o w c l e a r s t h e e x c e p t i o n s t a t u s b i t , c l e a r s t h e N a N
| bit i n t h e F P S R , a n d d o e s a n " r t e " . T h e i n s t r u c t i o n t h a t c a u s e d t h e
| bsun w i l l n o w b e r e - e x e c u t e d b u t w i t h t h e N a N F P S R b i t c l e a r e d .
|
.global _060_real_bsun
_060_real_bsun :
| fsave - ( % s p )
fmove. l % f p s r ,- ( % s p )
andi. b #0xfe ,( % s p )
fmove. l ( % s p ) + ,% f p s r
bral t r a p | j u m p t o t r a p h a n d l e r
|
| _ 0 6 0 _ real_ f l i n e ( ) :
|
| This i s t h e e x i t p o i n t f o r t h e 0 6 0 F P S P w h e n a n F - L i n e I l l e g a l e x c e p t i o n i s
| encountered. T h r e e d i f f e r e n t t y p e s o f e x c e p t i o n s c a n e n t e r t h e F - L i n e e x c e p t i o n
| vector n u m b e r 1 1 : F P U n i m p l e m e n t e d I n s t r u c t i o n s , F P i m p l e m e n t e d i n s t r u c t i o n s w h e n
| the F P U i s d i s a b l e d , a n d F - L i n e I l l e g a l i n s t r u c t i o n s . T h e 0 6 0 F P S P m o d u l e
| _ fpsp_ f l i n e ( ) d i s t i n g u i s h e s b e t w e e n t h e t h r e e a n d a c t s a p p r o p r i a t e l y . F - L i n e
| Illegals b r a n c h h e r e .
|
.global _060_real_fline
_060_real_fline :
bral t r a p | j u m p t o t r a p h a n d l e r
|
| _ 0 6 0 _ real_ f p u _ d i s a b l e d ( ) :
|
| This i s t h e e x i t p o i n t f o r t h e 0 6 0 F P S P w h e n a n F P U d i s a b l e d e x c e p t i o n i s
| encountered. T h r e e d i f f e r e n t t y p e s o f e x c e p t i o n s c a n e n t e r t h e F - L i n e e x c e p t i o n
| vector n u m b e r 1 1 : F P U n i m p l e m e n t e d I n s t r u c t i o n s , F P i m p l e m e n t e d i n s t r u c t i o n s w h e n
| the F P U i s d i s a b l e d , a n d F - L i n e I l l e g a l i n s t r u c t i o n s . T h e 0 6 0 F P S P m o d u l e
| _ fpsp_ f l i n e ( ) d i s t i n g u i s h e s b e t w e e n t h e t h r e e a n d a c t s a p p r o p r i a t e l y . F P U d i s a b l e d
| exceptions b r a n c h h e r e .
|
| The s a m p l e c o d e b e l o w e n a b l e s t h e F P U , s e t s t h e P C f i e l d i n t h e e x c e p t i o n s t a c k
| frame t o t h e P C o f t h e i n s t r u c t i o n c a u s i n g t h e e x c e p t i o n , a n d d o e s a n " r t e " .
| The e x e c u t i o n o f t h e i n s t r u c t i o n t h e n p r o c e e d s w i t h a n e n a b l e d f l o a t i n g - p o i n t
| unit.
|
.global _060_real_fpu_disabled
_060_real_fpu_disabled :
move. l % d0 ,- ( % s p ) | e n a b l e d t h e f p u
.long 0x4E7A0808 | movec p c r ,% d0
bclr #0x1 ,% d0
.long 0x4E7B0808 | movec % d0 ,p c r
move. l ( % s p ) + ,% d0
move. l 0 x c ( % s p ) ,0 x2 ( % s p ) | s e t " C u r r e n t P C "
rte
|
| _ 0 6 0 _ real_ t r a p ( ) :
|
| This i s t h e e x i t p o i n t f o r t h e 0 6 0 F P S P w h e n a n e m u l a t e d " f t r a p c c " i n s t r u c t i o n
| discovers t h a t t h e t r a p c o n d i t i o n i s t r u e a n d i t s h o u l d b r a n c h t o t h e o p e r a t i n g
| system h a n d l e r f o r t h e t r a p e x c e p t i o n v e c t o r n u m b e r 7 .
|
| The s a m p l e c o d e b e l o w s i m p l y e x e c u t e s a n " r t e " .
|
.global _060_real_trap
_060_real_trap :
bral t r a p | j u m p t o t r a p h a n d l e r
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
| ( 2 ) EXAMPLE P A C K A G E E N T R Y C O D E #
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
.global _060_fpsp_snan
_060_fpsp_snan :
bra. l _ F P _ C A L L _ T O P + 0 x80 + 0 x00
.global _060_fpsp_operr
_060_fpsp_operr :
bra. l _ F P _ C A L L _ T O P + 0 x80 + 0 x08
.global _060_fpsp_ovfl
_060_fpsp_ovfl :
bra. l _ F P _ C A L L _ T O P + 0 x80 + 0 x10
.global _060_fpsp_unfl
_060_fpsp_unfl :
bra. l _ F P _ C A L L _ T O P + 0 x80 + 0 x18
.global _060_fpsp_dz
_060_fpsp_dz :
bra. l _ F P _ C A L L _ T O P + 0 x80 + 0 x20
.global _060_fpsp_inex
_060_fpsp_inex :
bra. l _ F P _ C A L L _ T O P + 0 x80 + 0 x28
.global _060_fpsp_fline
_060_fpsp_fline :
bra. l _ F P _ C A L L _ T O P + 0 x80 + 0 x30
.global _060_fpsp_unsupp
_060_fpsp_unsupp :
bra. l _ F P _ C A L L _ T O P + 0 x80 + 0 x38
.global _060_fpsp_effadd
_060_fpsp_effadd :
bra. l _ F P _ C A L L _ T O P + 0 x80 + 0 x40
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
| ( 3 ) EXAMPLE C A L L - O U T S E C T I O N #
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
| The s i z e o f t h i s s e c t i o n M U S T b e 1 2 8 b y t e s ! ! !
_FP_CALL_TOP :
.long _060_real_bsun - _ FP_ C A L L _ T O P
.long _060_real_snan - _ FP_ C A L L _ T O P
.long _060_real_operr - _ FP_ C A L L _ T O P
.long _060_real_ovfl - _ FP_ C A L L _ T O P
.long _060_real_unfl - _ FP_ C A L L _ T O P
.long _060_real_dz - _ FP_ C A L L _ T O P
.long _060_real_inex - _ FP_ C A L L _ T O P
.long _060_real_fline - _ FP_ C A L L _ T O P
.long _060_real_fpu_disabled - _ FP_ C A L L _ T O P
.long _060_real_trap - _ FP_ C A L L _ T O P
.long _060_real_trace - _ FP_ C A L L _ T O P
.long _060_real_access - _ FP_ C A L L _ T O P
.long _060_fpsp_done - _ FP_ C A L L _ T O P
.long 0 x0 0 0 0 0 0 0 0 , 0 x00 0 0 0 0 0 0 , 0 x00 0 0 0 0 0 0
.long _060_imem_read - _ FP_ C A L L _ T O P
.long _060_dmem_read - _ FP_ C A L L _ T O P
.long _060_dmem_write - _ FP_ C A L L _ T O P
.long _060_imem_read_word - _ FP_ C A L L _ T O P
.long _060_imem_read_long - _ FP_ C A L L _ T O P
.long _060_dmem_read_byte - _ FP_ C A L L _ T O P
.long _060_dmem_read_word - _ FP_ C A L L _ T O P
.long _060_dmem_read_long - _ FP_ C A L L _ T O P
.long _060_dmem_write_byte - _ FP_ C A L L _ T O P
.long _060_dmem_write_word - _ FP_ C A L L _ T O P
.long _060_dmem_write_long - _ FP_ C A L L _ T O P
.long 0x00000000
.long 0 x0 0 0 0 0 0 0 0 , 0 x00 0 0 0 0 0 0 , 0 x00 0 0 0 0 0 0 , 0 x00 0 0 0 0 0 0
| # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
| 0 6 0 FPSP K E R N E L P A C K A G E N E E D S T O G O H E R E ! ! !
# include " f p s p . s a "