Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  linux/arch/arm/lib/io-writesl.S
0004  *
0005  *  Copyright (C) 1995-2000 Russell King
0006  */
0007 #include <linux/linkage.h>
0008 #include <asm/assembler.h>
0009 
0010 ENTRY(__raw_writesl)
0011         teq r2, #0      @ do we have to check for the zero len?
0012         reteq   lr
0013         ands    ip, r1, #3
0014         bne 3f
0015 
0016         subs    r2, r2, #4
0017         bmi 2f
0018         stmfd   sp!, {r4, lr}
0019 1:      ldmia   r1!, {r3, r4, ip, lr}
0020         subs    r2, r2, #4
0021         str r3, [r0, #0]
0022         str r4, [r0, #0]
0023         str ip, [r0, #0]
0024         str lr, [r0, #0]
0025         bpl 1b
0026         ldmfd   sp!, {r4, lr}
0027 2:      movs    r2, r2, lsl #31
0028         ldmiacs r1!, {r3, ip}
0029         strcs   r3, [r0, #0]
0030         ldrne   r3, [r1, #0]
0031         strcs   ip, [r0, #0]
0032         strne   r3, [r0, #0]
0033         ret lr
0034 
0035 3:      bic r1, r1, #3
0036         ldr r3, [r1], #4
0037         cmp ip, #2
0038         blt 5f
0039         bgt 6f
0040 
0041 4:      mov ip, r3, lspull #16
0042         ldr r3, [r1], #4
0043         subs    r2, r2, #1
0044         orr ip, ip, r3, lspush #16
0045         str ip, [r0]
0046         bne 4b
0047         ret lr
0048 
0049 5:      mov ip, r3, lspull #8
0050         ldr r3, [r1], #4
0051         subs    r2, r2, #1
0052         orr ip, ip, r3, lspush #24
0053         str ip, [r0]
0054         bne 5b
0055         ret lr
0056 
0057 6:      mov ip, r3, lspull #24
0058         ldr r3, [r1], #4
0059         subs    r2, r2, #1
0060         orr ip, ip, r3, lspush #8
0061         str ip, [r0]
0062         bne 6b
0063         ret lr
0064 ENDPROC(__raw_writesl)