2012-08-13 11:44:13 +01:00
/ *
* linux/ a r c h / a r m / l i b / i o - w r i t e s w - a r m v3 . S
*
* Copyright ( C ) 1 9 9 5 - 2 0 0 0 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 .
* /
# 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 >
.Loutsw_bad_alignment :
adr r0 , . L o u t s w _ b a d _ a l i g n _ m s g
mov r2 , l r
b p a n i c
.Loutsw_bad_align_msg :
.asciz " outsw : bad b u f f e r a l i g n m e n t ( 0 x % p , l r =0x % 0 8 l X ) \ n "
.align
.Loutsw_align : tst r1 , #1
bne . L o u t s w _ b a d _ a l i g n m e n t
add r1 , r1 , #2
ldr r3 , [ r1 , #- 4 ]
mov r3 , r3 , l s r #16
orr r3 , r3 , r3 , l s l #16
str r3 , [ r0 ]
subs r2 , r2 , #1
2014-06-30 16:29:12 +01:00
reteq l r
2012-08-13 11:44:13 +01:00
ENTRY( _ _ r a w _ w r i t e s w )
teq r2 , #0 @ do we have to check for the zero len?
2014-06-30 16:29:12 +01:00
reteq l r
2012-08-13 11:44:13 +01:00
tst r1 , #3
bne . L o u t s w _ a l i g n
stmfd s p ! , { r4 , r5 , r6 , l r }
subs r2 , r2 , #8
bmi . L n o _ o u t s w _ 8
.Loutsw_8_lp : ldmia r1 ! , { r3 , r4 , r5 , r6 }
mov i p , r3 , l s l #16
orr i p , i p , i p , l s r #16
str i p , [ r0 ]
mov i p , r3 , l s r #16
orr i p , i p , i p , l s l #16
str i p , [ r0 ]
mov i p , r4 , l s l #16
orr i p , i p , i p , l s r #16
str i p , [ r0 ]
mov i p , r4 , l s r #16
orr i p , i p , i p , l s l #16
str i p , [ r0 ]
mov i p , r5 , l s l #16
orr i p , i p , i p , l s r #16
str i p , [ r0 ]
mov i p , r5 , l s r #16
orr i p , i p , i p , l s l #16
str i p , [ r0 ]
mov i p , r6 , l s l #16
orr i p , i p , i p , l s r #16
str i p , [ r0 ]
mov i p , r6 , l s r #16
orr i p , i p , i p , l s l #16
str i p , [ r0 ]
subs r2 , r2 , #8
bpl . L o u t s w _ 8 _ l p
tst r2 , #7
ldmeqfd s p ! , { r4 , r5 , r6 , p c }
.Lno_outsw_8 : tst r2 , #4
beq . L n o _ o u t s w _ 4
ldmia r1 ! , { r3 , r4 }
mov i p , r3 , l s l #16
orr i p , i p , i p , l s r #16
str i p , [ r0 ]
mov i p , r3 , l s r #16
orr i p , i p , i p , l s l #16
str i p , [ r0 ]
mov i p , r4 , l s l #16
orr i p , i p , i p , l s r #16
str i p , [ r0 ]
mov i p , r4 , l s r #16
orr i p , i p , i p , l s l #16
str i p , [ r0 ]
.Lno_outsw_4 : tst r2 , #2
beq . L n o _ o u t s w _ 2
ldr r3 , [ r1 ] , #4
mov i p , r3 , l s l #16
orr i p , i p , i p , l s r #16
str i p , [ r0 ]
mov i p , r3 , l s r #16
orr i p , i p , i p , l s l #16
str i p , [ r0 ]
.Lno_outsw_2 : tst r2 , #1
ldrne r3 , [ r1 ]
movne i p , r3 , l s l #16
orrne i p , i p , i p , l s r #16
strne i p , [ r0 ]
ldmfd s p ! , { r4 , r5 , r6 , p c }