2007-07-11 12:18:41 -07:00
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
*
* Copyright ( C ) 1 9 9 1 , 1 9 9 2 L i n u s T o r v a l d s
* Copyright 2 0 0 7 r P a t h , I n c . - A l l R i g h t s R e s e r v e d
*
* This f i l e i s p a r t o f t h e L i n u x k e r n e l , a n d i s m a d e a v a i l a b l e u n d e r
* the t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e v e r s i o n 2 .
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * /
2009-02-14 00:50:20 +03:00
# include < l i n u x / l i n k a g e . h >
2007-07-11 12:18:41 -07:00
/ *
* Memory c o p y r o u t i n e s
* /
.code16gcc
.text
2009-02-14 00:50:20 +03:00
GLOBAL( m e m c p y )
2007-07-11 12:18:41 -07:00
pushw % s i
pushw % d i
movw % a x , % d i
movw % d x , % s i
pushw % c x
shrw $ 2 , % c x
rep; movsl
popw % c x
andw $ 3 , % c x
rep; movsb
popw % d i
popw % s i
ret
2009-02-14 00:50:20 +03:00
ENDPROC( m e m c p y )
2007-07-11 12:18:41 -07:00
2009-02-14 00:50:20 +03:00
GLOBAL( m e m s e t )
2007-07-11 12:18:41 -07:00
pushw % d i
movw % a x , % d i
movzbl % d l , % e a x
imull $ 0 x01 0 1 0 1 0 1 ,% e a x
pushw % c x
shrw $ 2 , % c x
rep; stosl
popw % c x
andw $ 3 , % c x
rep; stosb
popw % d i
ret
2009-02-14 00:50:20 +03:00
ENDPROC( m e m s e t )
2007-07-11 12:18:41 -07:00
2009-02-14 00:50:20 +03:00
GLOBAL( c o p y _ f r o m _ f s )
2007-07-11 12:18:41 -07:00
pushw % d s
pushw % f s
popw % d s
call m e m c p y
popw % d s
ret
2009-02-14 00:50:20 +03:00
ENDPROC( c o p y _ f r o m _ f s )
2007-07-11 12:18:41 -07:00
2009-02-14 00:50:20 +03:00
GLOBAL( c o p y _ t o _ f s )
2007-07-11 12:18:41 -07:00
pushw % e s
pushw % f s
popw % e s
call m e m c p y
popw % e s
ret
2009-02-14 00:50:20 +03:00
ENDPROC( c o p y _ t o _ f s )
2007-07-11 12:18:41 -07:00
# if 0 / * N o t c u r r e n t l y u s e d , b u t c a n b e e n a b l e d a s n e e d e d * /
2009-02-14 00:50:20 +03:00
GLOBAL( c o p y _ f r o m _ g s )
2007-07-11 12:18:41 -07:00
pushw % d s
pushw % g s
popw % d s
call m e m c p y
popw % d s
ret
2009-02-14 00:50:20 +03:00
ENDPROC( c o p y _ f r o m _ g s )
2007-07-11 12:18:41 -07:00
2009-02-14 00:50:20 +03:00
GLOBAL( c o p y _ t o _ g s )
2007-07-11 12:18:41 -07:00
pushw % e s
pushw % g s
popw % e s
call m e m c p y
popw % e s
ret
2009-02-14 00:50:20 +03:00
ENDPROC( c o p y _ t o _ g s )
2007-07-11 12:18:41 -07:00
# endif