2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/lib/io-writesw-armv3.S
|
|
|
|
*
|
|
|
|
* Copyright (C) 1995-2000 Russell King
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
#include <linux/linkage.h>
|
|
|
|
#include <asm/assembler.h>
|
|
|
|
#include <asm/hardware.h>
|
|
|
|
|
2005-11-12 05:51:48 +08:00
|
|
|
.Loutsw_bad_alignment:
|
|
|
|
adr r0, .Loutsw_bad_align_msg
|
2005-04-17 06:20:36 +08:00
|
|
|
mov r2, lr
|
|
|
|
b panic
|
2005-11-12 05:51:48 +08:00
|
|
|
.Loutsw_bad_align_msg:
|
2005-04-17 06:20:36 +08:00
|
|
|
.asciz "outsw: bad buffer alignment (0x%p, lr=0x%08lX)\n"
|
|
|
|
.align
|
|
|
|
|
2005-11-12 05:51:48 +08:00
|
|
|
.Loutsw_align: tst r1, #1
|
|
|
|
bne .Loutsw_bad_alignment
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
add r1, r1, #2
|
|
|
|
|
|
|
|
ldr r3, [r1, #-4]
|
|
|
|
mov r3, r3, lsr #16
|
|
|
|
orr r3, r3, r3, lsl #16
|
|
|
|
str r3, [r0]
|
|
|
|
subs r2, r2, #1
|
2006-06-25 18:17:23 +08:00
|
|
|
moveq pc, lr
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
ENTRY(__raw_writesw)
|
|
|
|
teq r2, #0 @ do we have to check for the zero len?
|
|
|
|
moveq pc, lr
|
|
|
|
tst r1, #3
|
2005-11-12 05:51:48 +08:00
|
|
|
bne .Loutsw_align
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-11-12 05:51:48 +08:00
|
|
|
stmfd sp!, {r4, r5, r6, lr}
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
subs r2, r2, #8
|
2005-11-12 05:51:48 +08:00
|
|
|
bmi .Lno_outsw_8
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-11-12 05:51:48 +08:00
|
|
|
.Loutsw_8_lp: ldmia r1!, {r3, r4, r5, r6}
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
mov ip, r3, lsl #16
|
|
|
|
orr ip, ip, ip, lsr #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r3, lsr #16
|
|
|
|
orr ip, ip, ip, lsl #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r4, lsl #16
|
|
|
|
orr ip, ip, ip, lsr #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r4, lsr #16
|
|
|
|
orr ip, ip, ip, lsl #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r5, lsl #16
|
|
|
|
orr ip, ip, ip, lsr #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r5, lsr #16
|
|
|
|
orr ip, ip, ip, lsl #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r6, lsl #16
|
|
|
|
orr ip, ip, ip, lsr #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r6, lsr #16
|
|
|
|
orr ip, ip, ip, lsl #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
subs r2, r2, #8
|
2005-11-12 05:51:48 +08:00
|
|
|
bpl .Loutsw_8_lp
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
tst r2, #7
|
2006-06-25 18:23:45 +08:00
|
|
|
ldmeqfd sp!, {r4, r5, r6, pc}
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-11-12 05:51:48 +08:00
|
|
|
.Lno_outsw_8: tst r2, #4
|
|
|
|
beq .Lno_outsw_4
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
ldmia r1!, {r3, r4}
|
|
|
|
|
|
|
|
mov ip, r3, lsl #16
|
|
|
|
orr ip, ip, ip, lsr #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r3, lsr #16
|
|
|
|
orr ip, ip, ip, lsl #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r4, lsl #16
|
|
|
|
orr ip, ip, ip, lsr #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r4, lsr #16
|
|
|
|
orr ip, ip, ip, lsl #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
2005-11-12 05:51:48 +08:00
|
|
|
.Lno_outsw_4: tst r2, #2
|
|
|
|
beq .Lno_outsw_2
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
ldr r3, [r1], #4
|
|
|
|
|
|
|
|
mov ip, r3, lsl #16
|
|
|
|
orr ip, ip, ip, lsr #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
|
|
|
mov ip, r3, lsr #16
|
|
|
|
orr ip, ip, ip, lsl #16
|
|
|
|
str ip, [r0]
|
|
|
|
|
2005-11-12 05:51:48 +08:00
|
|
|
.Lno_outsw_2: tst r2, #1
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
ldrne r3, [r1]
|
|
|
|
|
|
|
|
movne ip, r3, lsl #16
|
|
|
|
orrne ip, ip, ip, lsr #16
|
|
|
|
strne ip, [r0]
|
|
|
|
|
2006-06-25 18:23:45 +08:00
|
|
|
ldmfd sp!, {r4, r5, r6, pc}
|