2019-06-03 08:44:50 +03:00
/* SPDX-License-Identifier: GPL-2.0-only */
2012-03-05 15:49:32 +04:00
/ *
* Copy f r o m u s e r s p a c e t o u s e r s p a c e
*
* Copyright ( C ) 2 0 1 2 A R M L t d .
* /
# include < l i n u x / l i n k a g e . h >
2015-07-22 21:05:54 +03:00
2016-12-26 12:10:19 +03:00
# include < a s m / a s m - u a c c e s s . h >
2018-12-07 21:08:20 +03:00
# include < a s m / a s s e m b l e r . h >
# include < a s m / c a c h e . h >
2012-03-05 15:49:32 +04:00
/ *
* Copy f r o m u s e r s p a c e t o u s e r s p a c e ( 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 - t o
* x1 - f r o m
* x2 - n
* Returns :
* x0 - b y t e s n o t c o p i e d
* /
2020-04-29 21:37:02 +03:00
.macro ldrb1 reg, p t r , v a l
2020-12-02 16:15:54 +03:00
user_ l d s t 9 9 9 8 f , l d t r b , \ r e g , \ p t r , \ v a l
2015-09-23 21:55:39 +03:00
.endm
2020-04-29 21:37:02 +03:00
.macro strb1 reg, p t r , v a l
2020-12-02 16:15:54 +03:00
user_ l d s t 9 9 9 8 f , s t t r b , \ r e g , \ p t r , \ v a l
2015-09-23 21:55:39 +03:00
.endm
2020-04-29 21:37:02 +03:00
.macro ldrh1 reg, p t r , v a l
2020-12-02 16:15:54 +03:00
user_ l d s t 9 9 9 8 f , l d t r h , \ r e g , \ p t r , \ v a l
2015-09-23 21:55:39 +03:00
.endm
2020-04-29 21:37:02 +03:00
.macro strh1 reg, p t r , v a l
2020-12-02 16:15:54 +03:00
user_ l d s t 9 9 9 8 f , s t t r h , \ r e g , \ p t r , \ v a l
2015-09-23 21:55:39 +03:00
.endm
2020-04-29 21:37:02 +03:00
.macro ldr1 reg, p t r , v a l
2020-12-02 16:15:54 +03:00
user_ l d s t 9 9 9 8 f , l d t r , \ r e g , \ p t r , \ v a l
2015-09-23 21:55:39 +03:00
.endm
2020-04-29 21:37:02 +03:00
.macro str1 reg, p t r , v a l
2020-12-02 16:15:54 +03:00
user_ l d s t 9 9 9 8 f , s t t r , \ r e g , \ p t r , \ v a l
2015-09-23 21:55:39 +03:00
.endm
2020-04-29 21:37:02 +03:00
.macro ldp1 reg1 , r e g 2 , p t r , v a l
2020-12-02 16:15:54 +03:00
user_ l d p 9 9 9 8 f , \ r e g 1 , \ r e g 2 , \ p t r , \ v a l
2015-09-23 21:55:39 +03:00
.endm
2020-04-29 21:37:02 +03:00
.macro stp1 reg1 , r e g 2 , p t r , v a l
2020-12-02 16:15:54 +03:00
user_ s t p 9 9 9 8 f , \ r e g 1 , \ r e g 2 , \ p t r , \ v a l
2015-09-23 21:55:39 +03:00
.endm
end . r e q x5
2018-02-05 18:34:23 +03:00
2020-01-06 22:58:17 +03:00
SYM_ F U N C _ S T A R T ( _ _ a r c h _ c o p y _ i n _ u s e r )
2015-09-23 21:55:39 +03:00
add e n d , x0 , x2
# include " c o p y _ t e m p l a t e . S "
mov x0 , #0
2012-03-05 15:49:32 +04:00
ret
2020-01-06 22:58:17 +03:00
SYM_ F U N C _ E N D ( _ _ a r c h _ c o p y _ i n _ u s e r )
2018-12-07 21:08:20 +03:00
EXPORT_ S Y M B O L ( _ _ a r c h _ c o p y _ i n _ u s e r )
2012-03-05 15:49:32 +04:00
.section .fixup , " ax"
.align 2
2015-09-23 21:55:39 +03:00
9998 : sub x0 , e n d , d s t / / b y t e s n o t c o p i e d
2012-03-05 15:49:32 +04:00
ret
.previous