2012-03-05 11:49:32 +00: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 .
*
* 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 >
2015-07-22 19:05:54 +01:00
2015-09-23 11:55:39 -07:00
# include < a s m / c a c h e . h >
2016-12-26 04:10:19 -05:00
# include < a s m / a s m - u a c c e s s . h >
2012-03-05 11:49:32 +00: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
* /
2015-09-23 11:55:39 -07:00
.macro ldrb1 ptr, r e g B , v a l
2016-02-05 14:58:48 +00:00
uao_ u s e r _ a l t e r n a t i v e 9 9 9 8 f , l d r b , l d t r b , \ p t r , \ r e g B , \ v a l
2015-09-23 11:55:39 -07:00
.endm
.macro strb1 ptr, r e g B , v a l
2016-02-05 14:58:48 +00:00
uao_ u s e r _ a l t e r n a t i v e 9 9 9 8 f , s t r b , s t t r b , \ p t r , \ r e g B , \ v a l
2015-09-23 11:55:39 -07:00
.endm
.macro ldrh1 ptr, r e g B , v a l
2016-02-05 14:58:48 +00:00
uao_ u s e r _ a l t e r n a t i v e 9 9 9 8 f , l d r h , l d t r h , \ p t r , \ r e g B , \ v a l
2015-09-23 11:55:39 -07:00
.endm
.macro strh1 ptr, r e g B , v a l
2016-02-05 14:58:48 +00:00
uao_ u s e r _ a l t e r n a t i v e 9 9 9 8 f , s t r h , s t t r h , \ p t r , \ r e g B , \ v a l
2015-09-23 11:55:39 -07:00
.endm
.macro ldr1 ptr, r e g B , v a l
2016-02-05 14:58:48 +00:00
uao_ u s e r _ a l t e r n a t i v e 9 9 9 8 f , l d r , l d t r , \ p t r , \ r e g B , \ v a l
2015-09-23 11:55:39 -07:00
.endm
.macro str1 ptr, r e g B , v a l
2016-02-05 14:58:48 +00:00
uao_ u s e r _ a l t e r n a t i v e 9 9 9 8 f , s t r , s t t r , \ p t r , \ r e g B , \ v a l
2015-09-23 11:55:39 -07:00
.endm
.macro ldp1 ptr, r e g B , r e g C , v a l
2016-02-05 14:58:48 +00:00
uao_ l d p 9 9 9 8 f , \ p t r , \ r e g B , \ r e g C , \ v a l
2015-09-23 11:55:39 -07:00
.endm
.macro stp1 ptr, r e g B , r e g C , v a l
2016-02-05 14:58:48 +00:00
uao_ s t p 9 9 9 8 f , \ p t r , \ r e g B , \ r e g C , \ v a l
2015-09-23 11:55:39 -07:00
.endm
end . r e q x5
2018-02-05 15:34:23 +00:00
ENTRY( _ _ a r c h _ c o p y _ i n _ u s e r )
2017-08-10 13:58:16 +01:00
uaccess_ e n a b l e _ n o t _ u a o x3 , x4 , x5
2015-09-23 11:55:39 -07:00
add e n d , x0 , x2
# include " c o p y _ t e m p l a t e . S "
2018-01-10 13:18:30 +00:00
uaccess_ d i s a b l e _ n o t _ u a o x3 , x4
2015-09-23 11:55:39 -07:00
mov x0 , #0
2012-03-05 11:49:32 +00:00
ret
2018-02-05 15:34:23 +00:00
ENDPROC( _ _ a r c h _ c o p y _ i n _ u s e r )
2012-03-05 11:49:32 +00:00
.section .fixup , " ax"
.align 2
2015-09-23 11:55:39 -07: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 11:49:32 +00:00
ret
.previous