2019-06-03 08:44:50 +03:00
/* SPDX-License-Identifier: GPL-2.0-only */
2012-03-05 15:49:33 +04:00
/ *
* 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 >
# include < l i n u x / c o n s t . h >
# include < a s m / a s s e m b l e r . h >
# include < a s m / p a g e . h >
2016-02-02 15:46:26 +03:00
# include < a s m / c p u f e a t u r e . h >
# include < a s m / a l t e r n a t i v e . h >
2012-03-05 15:49:33 +04:00
/ *
* Copy a p a g e f r o m s r c t o d e s t ( b o t h a r e p a g e a l i g n e d )
*
* Parameters :
* x0 - d e s t
* x1 - s r c
* /
2020-01-06 22:58:17 +03:00
SYM_ F U N C _ S T A R T ( c o p y _ p a g e )
2016-09-07 13:07:09 +03:00
alternative_ i f A R M 6 4 _ H A S _ N O _ H W _ P R E F E T C H
2017-07-12 17:44:14 +03:00
/ / Prefetch t h r e e c a c h e l i n e s a h e a d .
prfm p l d l 1 s t r m , [ x1 , #128 ]
prfm p l d l 1 s t r m , [ x1 , #256 ]
prfm p l d l 1 s t r m , [ x1 , #384 ]
2016-09-07 13:07:09 +03:00
alternative_ e l s e _ n o p _ e n d i f
2016-02-02 15:46:26 +03:00
2016-02-02 15:46:25 +03:00
ldp x2 , x3 , [ x1 ]
2012-03-05 15:49:33 +04:00
ldp x4 , x5 , [ x1 , #16 ]
ldp x6 , x7 , [ x1 , #32 ]
ldp x8 , x9 , [ x1 , #48 ]
2016-02-02 15:46:25 +03:00
ldp x10 , x11 , [ x1 , #64 ]
ldp x12 , x13 , [ x1 , #80 ]
ldp x14 , x15 , [ x1 , #96 ]
ldp x16 , x17 , [ x1 , #112 ]
2019-12-07 01:13:38 +03:00
add x0 , x0 , #256
2016-02-02 15:46:25 +03:00
add x1 , x1 , #128
1 :
2019-12-07 01:13:38 +03:00
tst x0 , #( P A G E _ S I Z E - 1 )
2016-02-02 15:46:25 +03:00
2016-09-07 13:07:09 +03:00
alternative_ i f A R M 6 4 _ H A S _ N O _ H W _ P R E F E T C H
2017-07-12 17:44:14 +03:00
prfm p l d l 1 s t r m , [ x1 , #384 ]
2016-09-07 13:07:09 +03:00
alternative_ e l s e _ n o p _ e n d i f
2016-02-02 15:46:26 +03:00
2019-12-07 01:13:38 +03:00
stnp x2 , x3 , [ x0 , #- 256 ]
2016-02-02 15:46:25 +03:00
ldp x2 , x3 , [ x1 ]
2019-12-07 01:13:38 +03:00
stnp x4 , x5 , [ x0 , #16 - 2 5 6 ]
2016-02-02 15:46:25 +03:00
ldp x4 , x5 , [ x1 , #16 ]
2019-12-07 01:13:38 +03:00
stnp x6 , x7 , [ x0 , #32 - 2 5 6 ]
2016-02-02 15:46:25 +03:00
ldp x6 , x7 , [ x1 , #32 ]
2019-12-07 01:13:38 +03:00
stnp x8 , x9 , [ x0 , #48 - 2 5 6 ]
2016-02-02 15:46:25 +03:00
ldp x8 , x9 , [ x1 , #48 ]
2019-12-07 01:13:38 +03:00
stnp x10 , x11 , [ x0 , #64 - 2 5 6 ]
2016-02-02 15:46:25 +03:00
ldp x10 , x11 , [ x1 , #64 ]
2019-12-07 01:13:38 +03:00
stnp x12 , x13 , [ x0 , #80 - 2 5 6 ]
2016-02-02 15:46:25 +03:00
ldp x12 , x13 , [ x1 , #80 ]
2019-12-07 01:13:38 +03:00
stnp x14 , x15 , [ x0 , #96 - 2 5 6 ]
2016-02-02 15:46:25 +03:00
ldp x14 , x15 , [ x1 , #96 ]
2019-12-07 01:13:38 +03:00
stnp x16 , x17 , [ x0 , #112 - 2 5 6 ]
2016-02-02 15:46:25 +03:00
ldp x16 , x17 , [ x1 , #112 ]
add x0 , x0 , #128
add x1 , x1 , #128
2019-12-07 01:13:38 +03:00
b. n e 1 b
2016-02-02 15:46:25 +03:00
2019-12-07 01:13:38 +03:00
stnp x2 , x3 , [ x0 , #- 256 ]
stnp x4 , x5 , [ x0 , #16 - 2 5 6 ]
stnp x6 , x7 , [ x0 , #32 - 2 5 6 ]
stnp x8 , x9 , [ x0 , #48 - 2 5 6 ]
stnp x10 , x11 , [ x0 , #64 - 2 5 6 ]
stnp x12 , x13 , [ x0 , #80 - 2 5 6 ]
stnp x14 , x15 , [ x0 , #96 - 2 5 6 ]
stnp x16 , x17 , [ x0 , #112 - 2 5 6 ]
2016-02-02 15:46:25 +03:00
2012-03-05 15:49:33 +04:00
ret
2020-01-06 22:58:17 +03:00
SYM_ F U N C _ E N D ( c o p y _ p a g e )
2018-12-07 21:08:19 +03:00
EXPORT_ S Y M B O L ( c o p y _ p a g e )