2006-11-27 06:06:26 +03:00
/ *
2005-04-17 02:20:36 +04:00
* _ _ clear_ u s e r _ p a g e , _ _ c l e a r _ u s e r , c l e a r _ p a g e i m p l e m e n t a t i o n o f S u p e r H
*
* Copyright ( C ) 2 0 0 1 K a z K o j i m a
* Copyright ( C ) 2 0 0 1 , 2 0 0 2 N i i b e Y u t a k a
2006-11-27 06:06:26 +03:00
* Copyright ( C ) 2 0 0 6 P a u l M u n d t
2005-04-17 02:20:36 +04:00
* /
# include < l i n u x / l i n k a g e . h >
2006-11-27 06:06:26 +03:00
# include < a s m / p a g e . h >
2005-04-17 02:20:36 +04:00
ENTRY( _ _ c l e a r _ u s e r )
!
mov #0 , r0
2009-08-24 12:09:53 +04:00
mov #0xffffffe0 , r1
2005-04-17 02:20:36 +04:00
!
! r4 . . ( r4 + 3 1 ) & ~ 3 2 - - - - - - - - n o t a l i g n e d [ A r e a 0 ]
! ( r4 + 3 1 ) & ~ 3 2 . . ( r4 + r5 ) & ~ 3 2 - - - - - - - - a l i g n e d [ A r e a 1 ]
! ( r4 + r5 ) & ~ 3 2 . . r4 + r5 - - - - - - - - n o t a l i g n e d [ A r e a 2 ]
!
! Clear a r e a 0
mov r4 , r2
!
tst r1 , r5 ! l e n g t h < 3 2
bt . L a r e a2 ! s k i p t o r e m a i n d e r
!
add #31 , r2
and r1 , r2
cmp/ e q r4 , r2
bt . L a r e a1
mov r2 , r3
sub r4 , r3
mov r3 , r7
mov r4 , r2
!
.L0 : dt r3
0 : mov. b r0 , @r2
bf/ s . L 0
add #1 , r2
!
sub r7 , r5
mov r2 , r4
.Larea1 :
mov r4 , r3
add r5 , r3
and r1 , r3
cmp/ h i r2 , r3
bf . L a r e a2
!
! Clear a r e a 1
# if d e f i n e d ( C O N F I G _ C P U _ S H 4 )
1 : movca. l r0 , @r2
# else
1 : mov. l r0 , @r2
# endif
add #4 , r2
2 : mov. l r0 , @r2
add #4 , r2
3 : mov. l r0 , @r2
add #4 , r2
4 : mov. l r0 , @r2
add #4 , r2
5 : mov. l r0 , @r2
add #4 , r2
6 : mov. l r0 , @r2
add #4 , r2
7 : mov. l r0 , @r2
add #4 , r2
8 : mov. l r0 , @r2
add #4 , r2
cmp/ h i r2 , r3
bt/ s 1 b
nop
!
! Clear a r e a 2
.Larea2 :
mov r4 , r3
add r5 , r3
cmp/ h s r3 , r2
bt/ s . L d o n e
sub r2 , r3
.L2 : dt r3
9 : mov. b r0 , @r2
bf/ s . L 2
add #1 , r2
!
.Ldone : rts
mov #0 , r0 ! r e t u r n 0 a s n o r m a l r e t u r n
! return t h e n u m b e r o f b y t e s r e m a i n e d
.Lbad_clear_user :
mov r4 , r0
add r5 , r0
rts
sub r2 , r0
.section _ _ ex_ t a b l e ," a "
.align 2
.long 0 b, . L b a d _ c l e a r _ u s e r
.long 1 b, . L b a d _ c l e a r _ u s e r
.long 2 b, . L b a d _ c l e a r _ u s e r
.long 3 b, . L b a d _ c l e a r _ u s e r
.long 4 b, . L b a d _ c l e a r _ u s e r
.long 5 b, . L b a d _ c l e a r _ u s e r
.long 6 b, . L b a d _ c l e a r _ u s e r
.long 7 b, . L b a d _ c l e a r _ u s e r
.long 8 b, . L b a d _ c l e a r _ u s e r
.long 9 b, . L b a d _ c l e a r _ u s e r
.previous