2005-04-16 15:20:36 -07:00
/ *
* linux/ a r c h / a r m / l i b / c o p y p a g e . S
*
* Copyright ( C ) 1 9 9 5 - 1 9 9 9 R u s s e l l K i n g
*
* 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 .
*
* ASM o p t i m i s e d s t r i n g f u n c t i o n 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 >
2005-09-09 21:08:59 +02:00
# include < a s m / a s m - o f f s e t s . h >
2009-09-15 10:26:33 +01:00
# include < a s m / c a c h e . h >
2005-04-16 15:20:36 -07:00
2009-09-15 10:26:33 +01:00
# define C O P Y _ C O U N T ( P A G E _ S Z / ( 2 * L 1 _ C A C H E _ B Y T E S ) P L D ( - 1 ) )
2005-04-16 15:20:36 -07:00
.text
.align 5
/ *
* StrongARM o p t i m i s e d c o p y _ p a g e r o u t i n e
* now 1 . 7 8 b y t e s / c y c l e , w a s 1 . 6 0 b y t e s / c y c l e ( 5 0 M H z b u s - > 8 9 M B / s )
* Note t h a t w e p r o b a b l y a c h i e v e c l o s e r t o t h e 1 0 0 M B / s t a r g e t w i t h
* the c o r e c l o c k s w i t c h i n g .
* /
ENTRY( c o p y _ p a g e )
stmfd s p ! , { r4 , l r } @ 2
PLD( p l d [ r1 , #0 ] )
2009-09-15 10:26:33 +01:00
PLD( p l d [ r1 , #L 1 _ C A C H E _ B Y T E S ] )
2005-04-16 15:20:36 -07:00
mov r2 , #C O P Y _ C O U N T @ 1
ldmia r1 ! , { r3 , r4 , i p , l r } @ 4+1
2009-09-15 10:26:33 +01:00
1 : PLD( p l d [ r1 , #2 * L 1 _ C A C H E _ B Y T E S ] )
PLD( p l d [ r1 , #3 * L 1 _ C A C H E _ B Y T E S ] )
2 :
.rept ( 2 * L1 _ C A C H E _ B Y T E S / 1 6 - 1 )
2005-04-16 15:20:36 -07:00
stmia r0 ! , { r3 , r4 , i p , l r } @ 4
ldmia r1 ! , { r3 , r4 , i p , l r } @ 4
2009-09-15 10:26:33 +01:00
.endr
2005-04-16 15:20:36 -07:00
subs r2 , r2 , #1 @ 1
stmia r0 ! , { r3 , r4 , i p , l r } @ 4
ldmgtia r1 ! , { r3 , r4 , i p , l r } @ 4
bgt 1 b @ 1
PLD( l d m e q i a r1 ! , { r3 , r4 , i p , l r } )
PLD( b e q 2 b )
2006-06-25 11:23:45 +01:00
ldmfd s p ! , { r4 , p c } @ 3
2008-08-28 11:22:32 +01:00
ENDPROC( c o p y _ p a g e )