2019-05-27 09:55:01 +03:00
/* SPDX-License-Identifier: GPL-2.0-or-later */
2005-09-26 10:04:21 +04:00
/ *
2008-08-22 08:39:00 +04:00
* Copyright ( C ) 2 0 0 8 M a r k N e l s o n , I B M C o r p .
2005-09-26 10:04:21 +04:00
* /
2011-05-09 01:18:38 +04:00
# include < a s m / p a g e . h >
2005-09-26 10:04:21 +04:00
# include < a s m / p r o c e s s o r . h >
# include < a s m / p p c _ a s m . h >
2008-08-22 08:39:00 +04:00
# include < a s m / a s m - o f f s e t s . h >
2016-01-14 07:33:46 +03:00
# include < a s m / e x p o r t . h >
2018-07-05 19:25:01 +03:00
# include < a s m / f e a t u r e - f i x u p s . h >
2008-08-22 08:39:00 +04:00
.section " .toc " , " aw"
PPC64_CACHES :
.tc ppc6 4 _ c a c h e s [ T C ] ,p p c64 _ c a c h e s
.section " .text "
2014-06-05 02:04:39 +04:00
_ GLOBAL_ T O C ( c o p y _ p a g e )
2012-05-29 23:33:12 +04:00
BEGIN_ F T R _ S E C T I O N
2011-05-09 01:18:38 +04:00
lis r5 ,P A G E _ S I Z E @h
2012-05-29 23:33:12 +04:00
FTR_ S E C T I O N _ E L S E
2018-02-20 22:08:26 +03:00
# ifdef C O N F I G _ P P C _ B O O K 3 S _ 6 4
2014-02-04 09:04:35 +04:00
b c o p y p a g e _ p o w e r7
2018-02-20 22:08:26 +03:00
# endif
2012-05-29 23:33:12 +04:00
ALT_ F T R _ S E C T I O N _ E N D _ I F C L R ( C P U _ F T R _ V M X _ C O P Y )
2011-05-09 01:18:38 +04:00
ori r5 ,r5 ,P A G E _ S I Z E @l
2008-08-22 08:39:00 +04:00
BEGIN_ F T R _ S E C T I O N
ld r10 ,P P C 6 4 _ C A C H E S @toc(r2)
2017-01-09 02:31:45 +03:00
lwz r11 ,D C A C H E L 1 L O G B L O C K S I Z E ( r10 ) / * l o g 2 o f c a c h e b l o c k s i z e * /
lwz r12 ,D C A C H E L 1 B L O C K S I Z E ( r10 ) / * g e t c a c h e b l o c k s i z e * /
2008-08-22 08:39:00 +04:00
li r9 ,0
srd r8 ,r5 ,r11
mtctr r8
2009-10-18 05:23:28 +04:00
.Lsetup :
2008-08-22 08:39:00 +04:00
dcbt r9 ,r4
dcbz r9 ,r3
add r9 ,r9 ,r12
2009-10-18 05:23:28 +04:00
bdnz . L s e t u p
2008-08-22 08:39:00 +04:00
END_ F T R _ S E C T I O N _ I F S E T ( C P U _ F T R _ C P _ U S E _ D C B T Z )
2005-09-26 10:04:21 +04:00
addi r3 ,r3 ,- 8
2008-08-22 08:39:00 +04:00
srdi r8 ,r5 ,7 / * p a g e i s c o p i e d i n 1 2 8 b y t e s t r i d e s * /
addi r8 ,r8 ,- 1 / * o n e s t r i d e c o p i e d o u t s i d e l o o p * /
mtctr r8
ld r5 ,0 ( r4 )
ld r6 ,8 ( r4 )
ld r7 ,1 6 ( r4 )
ldu r8 ,2 4 ( r4 )
1 : std r5 ,8 ( r3 )
std r6 ,1 6 ( r3 )
2010-02-10 21:07:54 +03:00
ld r9 ,8 ( r4 )
2008-08-22 08:39:00 +04:00
ld r10 ,1 6 ( r4 )
std r7 ,2 4 ( r3 )
std r8 ,3 2 ( r3 )
2010-02-10 21:07:54 +03:00
ld r11 ,2 4 ( r4 )
2008-08-22 08:39:00 +04:00
ld r12 ,3 2 ( r4 )
std r9 ,4 0 ( r3 )
std r10 ,4 8 ( r3 )
2010-02-10 21:07:54 +03:00
ld r5 ,4 0 ( r4 )
2008-08-22 08:39:00 +04:00
ld r6 ,4 8 ( r4 )
std r11 ,5 6 ( r3 )
std r12 ,6 4 ( r3 )
2010-02-10 21:07:54 +03:00
ld r7 ,5 6 ( r4 )
2008-08-22 08:39:00 +04:00
ld r8 ,6 4 ( r4 )
std r5 ,7 2 ( r3 )
std r6 ,8 0 ( r3 )
2010-02-10 21:07:54 +03:00
ld r9 ,7 2 ( r4 )
2008-08-22 08:39:00 +04:00
ld r10 ,8 0 ( r4 )
std r7 ,8 8 ( r3 )
std r8 ,9 6 ( r3 )
2010-02-10 21:07:54 +03:00
ld r11 ,8 8 ( r4 )
2008-08-22 08:39:00 +04:00
ld r12 ,9 6 ( r4 )
std r9 ,1 0 4 ( r3 )
std r10 ,1 1 2 ( r3 )
2010-02-10 21:07:54 +03:00
ld r5 ,1 0 4 ( r4 )
2008-08-22 08:39:00 +04:00
ld r6 ,1 1 2 ( r4 )
std r11 ,1 2 0 ( r3 )
stdu r12 ,1 2 8 ( r3 )
2010-02-10 21:07:54 +03:00
ld r7 ,1 2 0 ( r4 )
2008-08-22 08:39:00 +04:00
ldu r8 ,1 2 8 ( r4 )
2005-09-26 10:04:21 +04:00
bdnz 1 b
2008-08-22 08:39:00 +04:00
std r5 ,8 ( r3 )
std r6 ,1 6 ( r3 )
2010-02-10 21:07:54 +03:00
ld r9 ,8 ( r4 )
2008-08-22 08:39:00 +04:00
ld r10 ,1 6 ( r4 )
std r7 ,2 4 ( r3 )
std r8 ,3 2 ( r3 )
2010-02-10 21:07:54 +03:00
ld r11 ,2 4 ( r4 )
2008-08-22 08:39:00 +04:00
ld r12 ,3 2 ( r4 )
std r9 ,4 0 ( r3 )
std r10 ,4 8 ( r3 )
2010-02-10 21:07:54 +03:00
ld r5 ,4 0 ( r4 )
2008-08-22 08:39:00 +04:00
ld r6 ,4 8 ( r4 )
std r11 ,5 6 ( r3 )
std r12 ,6 4 ( r3 )
2010-02-10 21:07:54 +03:00
ld r7 ,5 6 ( r4 )
2008-08-22 08:39:00 +04:00
ld r8 ,6 4 ( r4 )
std r5 ,7 2 ( r3 )
std r6 ,8 0 ( r3 )
2010-02-10 21:07:54 +03:00
ld r9 ,7 2 ( r4 )
2008-08-22 08:39:00 +04:00
ld r10 ,8 0 ( r4 )
std r7 ,8 8 ( r3 )
std r8 ,9 6 ( r3 )
2010-02-10 21:07:54 +03:00
ld r11 ,8 8 ( r4 )
2008-08-22 08:39:00 +04:00
ld r12 ,9 6 ( r4 )
std r9 ,1 0 4 ( r3 )
std r10 ,1 1 2 ( r3 )
std r11 ,1 2 0 ( r3 )
std r12 ,1 2 8 ( r3 )
2005-09-26 10:04:21 +04:00
blr
2016-01-14 07:33:46 +03:00
EXPORT_ S Y M B O L ( c o p y _ p a g e )