2013-03-21 20:16:43 +04:00
/ *
* Copyright ( C ) 2 0 1 3 A R M L t d .
2014-04-28 09:11:29 +04:00
* Copyright ( C ) 2 0 1 3 L i n a r o .
*
* This c o d e i s b a s e d o n g l i b c c o r t e x s t r i n g s w o r k o r i g i n a l l y a u t h o r e d b y L i n a r o
* and r e - l i c e n s e d u n d e r G P L v2 f o r t h e L i n u x k e r n e l . T h e o r i g i n a l c o d e c a n
* be f o u n d @
*
* http : / / bazaar. l a u n c h p a d . n e t / ~ l i n a r o - t o o l c h a i n - d e v / c o r t e x - s t r i n g s / t r u n k /
* files/ h e a d : / s r c / a a r c h64 /
2013-03-21 20:16:43 +04:00
*
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify
* it u n d e r t h e 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 a s
* published b y t h e F r e e S o f t w a r e F o u n d a t i o n .
*
* This p r o g r a m i s d i s t r i b u t e d i n t h e h o p e t h a t i t w i l l b e u s e f u l ,
* but W I T H O U T A N Y W A R R A N T Y ; without even the implied warranty of
* MERCHANTABILITY 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 . S e e t h e
* GNU G e n e r a l P u b l i c L i c e n s e f o r m o r e d e t a i l s .
*
* You s h o u l d h a v e r e c e i v e d a c o p y 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
* along w i t h t h i s p r o g r a m . I f n o t , s e e < h t t p : / / w w w . g n u . o r g / l i c e n s e s / > .
* /
# 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 >
2014-04-28 09:11:29 +04:00
# include < a s m / c a c h e . h >
2013-03-21 20:16:43 +04:00
/ *
* Copy a b u f f e r f r o m s r c t o d e s t ( a l i g n m e n t h a n d l e d b y t h e h a r d w a r e )
*
* Parameters :
* x0 - d e s t
* x1 - s r c
* x2 - n
* Returns :
* x0 - d e s t
* /
2015-09-23 21:55:38 +03:00
.macro ldrb1 ptr, r e g B , v a l
ldrb \ p t r , [ \ r e g B ] , \ v a l
.endm
2014-04-28 09:11:29 +04:00
2015-09-23 21:55:38 +03:00
.macro strb1 ptr, r e g B , v a l
strb \ p t r , [ \ r e g B ] , \ v a l
.endm
2014-04-28 09:11:29 +04:00
2015-09-23 21:55:38 +03:00
.macro ldrh1 ptr, r e g B , v a l
ldrh \ p t r , [ \ r e g B ] , \ v a l
.endm
2014-04-28 09:11:29 +04:00
2015-09-23 21:55:38 +03:00
.macro strh1 ptr, r e g B , v a l
strh \ p t r , [ \ r e g B ] , \ v a l
.endm
2014-04-28 09:11:29 +04:00
2015-09-23 21:55:38 +03:00
.macro ldr1 ptr, r e g B , v a l
ldr \ p t r , [ \ r e g B ] , \ v a l
.endm
2014-04-28 09:11:29 +04:00
2015-09-23 21:55:38 +03:00
.macro str1 ptr, r e g B , v a l
str \ p t r , [ \ r e g B ] , \ v a l
.endm
2014-04-28 09:11:29 +04:00
2015-09-23 21:55:38 +03:00
.macro ldp1 ptr, r e g B , r e g C , v a l
ldp \ p t r , \ r e g B , [ \ r e g C ] , \ v a l
.endm
2014-04-28 09:11:29 +04:00
2015-09-23 21:55:38 +03:00
.macro stp1 ptr, r e g B , r e g C , v a l
stp \ p t r , \ r e g B , [ \ r e g C ] , \ v a l
.endm
2014-04-28 09:11:29 +04:00
2015-10-12 18:52:58 +03:00
.weak memcpy
ENTRY( _ _ m e m c p y )
2015-09-23 21:55:38 +03:00
ENTRY( m e m c p y )
# include " c o p y _ t e m p l a t e . S "
2014-04-28 09:11:29 +04:00
ret
2015-10-08 22:02:03 +03:00
ENDPIPROC( m e m c p y )
2015-10-12 18:52:58 +03:00
ENDPROC( _ _ m e m c p y )