2012-09-26 21:11:01 -07:00
/ * NG4 c o p y _ p a g e . S : N i a g a r a - 4 o p t i m i z e d c o p y p a g e .
*
* Copyright ( C ) 2 0 1 2 ( d a v e m @davemloft.net)
* /
# include < a s m / a s i . h >
# include < a s m / p a g e . h >
.text
.align 32
.register % g2 , #s c r a t c h
.register % g3 , #s c r a t c h
.globl NG4copy_user_page
NG4copy_user_page : /* %o0=dest, %o1=src, %o2=vaddr */
prefetch [ % o 1 + 0 x00 0 ] , #n _ r e a d s _ s t r o n g
prefetch [ % o 1 + 0 x04 0 ] , #n _ r e a d s _ s t r o n g
prefetch [ % o 1 + 0 x08 0 ] , #n _ r e a d s _ s t r o n g
prefetch [ % o 1 + 0 x0 c0 ] , #n _ r e a d s _ s t r o n g
set P A G E _ S I Z E , % g 7
prefetch [ % o 1 + 0 x10 0 ] , #n _ r e a d s _ s t r o n g
prefetch [ % o 1 + 0 x14 0 ] , #n _ r e a d s _ s t r o n g
prefetch [ % o 1 + 0 x18 0 ] , #n _ r e a d s _ s t r o n g
prefetch [ % o 1 + 0 x1 c0 ] , #n _ r e a d s _ s t r o n g
1 :
ldx [ % o 1 + 0 x00 ] , % o 2
subcc % g 7 , 0 x40 , % g 7
ldx [ % o 1 + 0 x08 ] , % o 3
ldx [ % o 1 + 0 x10 ] , % o 4
ldx [ % o 1 + 0 x18 ] , % o 5
ldx [ % o 1 + 0 x20 ] , % g 1
2012-10-05 13:45:26 -07:00
stxa % o 2 , [ % o 0 ] A S I _ S T _ B L K I N I T _ M R U _ P
2012-09-26 21:11:01 -07:00
add % o 0 , 0 x08 , % o 0
ldx [ % o 1 + 0 x28 ] , % g 2
2012-10-05 13:45:26 -07:00
stxa % o 3 , [ % o 0 ] A S I _ S T _ B L K I N I T _ M R U _ P
2012-09-26 21:11:01 -07:00
add % o 0 , 0 x08 , % o 0
ldx [ % o 1 + 0 x30 ] , % g 3
2012-10-05 13:45:26 -07:00
stxa % o 4 , [ % o 0 ] A S I _ S T _ B L K I N I T _ M R U _ P
2012-09-26 21:11:01 -07:00
add % o 0 , 0 x08 , % o 0
ldx [ % o 1 + 0 x38 ] , % o 2
add % o 1 , 0 x40 , % o 1
2012-10-05 13:45:26 -07:00
stxa % o 5 , [ % o 0 ] A S I _ S T _ B L K I N I T _ M R U _ P
2012-09-26 21:11:01 -07:00
add % o 0 , 0 x08 , % o 0
2012-10-05 13:45:26 -07:00
stxa % g 1 , [ % o 0 ] A S I _ S T _ B L K I N I T _ M R U _ P
2012-09-26 21:11:01 -07:00
add % o 0 , 0 x08 , % o 0
2012-10-05 13:45:26 -07:00
stxa % g 2 , [ % o 0 ] A S I _ S T _ B L K I N I T _ M R U _ P
2012-09-26 21:11:01 -07:00
add % o 0 , 0 x08 , % o 0
2012-10-05 13:45:26 -07:00
stxa % g 3 , [ % o 0 ] A S I _ S T _ B L K I N I T _ M R U _ P
2012-09-26 21:11:01 -07:00
add % o 0 , 0 x08 , % o 0
2012-10-05 13:45:26 -07:00
stxa % o 2 , [ % o 0 ] A S I _ S T _ B L K I N I T _ M R U _ P
2012-09-26 21:11:01 -07:00
add % o 0 , 0 x08 , % o 0
bne,p t % i c c , 1 b
prefetch [ % o 1 + 0 x20 0 ] , #n _ r e a d s _ s t r o n g
retl
membar #S t o r e L o a d | # S t o r e S t o r e
.size NG4 c o p y _ u s e r _ p a g e ,. - N G 4 c o p y _ u s e r _ p a g e