Kim Phillips | 017f161 | 2013-11-06 05:15:24 +0100 | [diff] [blame] | 1 | #include <linux/linkage.h> |
Russell King | 6ebbf2c | 2014-06-30 16:29:12 +0100 | [diff] [blame] | 2 | #include <asm/assembler.h> |
Kim Phillips | 017f161 | 2013-11-06 05:15:24 +0100 | [diff] [blame] | 3 | |
| 4 | #if __LINUX_ARM_ARCH__ >= 6 |
| 5 | ENTRY(__bswapsi2) |
| 6 | rev r0, r0 |
| 7 | bx lr |
| 8 | ENDPROC(__bswapsi2) |
| 9 | |
| 10 | ENTRY(__bswapdi2) |
| 11 | rev r3, r0 |
| 12 | rev r0, r1 |
| 13 | mov r1, r3 |
| 14 | bx lr |
| 15 | ENDPROC(__bswapdi2) |
| 16 | #else |
| 17 | ENTRY(__bswapsi2) |
| 18 | eor r3, r0, r0, ror #16 |
| 19 | mov r3, r3, lsr #8 |
| 20 | bic r3, r3, #0xff00 |
| 21 | eor r0, r3, r0, ror #8 |
Russell King | 6ebbf2c | 2014-06-30 16:29:12 +0100 | [diff] [blame] | 22 | ret lr |
Kim Phillips | 017f161 | 2013-11-06 05:15:24 +0100 | [diff] [blame] | 23 | ENDPROC(__bswapsi2) |
| 24 | |
| 25 | ENTRY(__bswapdi2) |
| 26 | mov ip, r1 |
| 27 | eor r3, ip, ip, ror #16 |
| 28 | eor r1, r0, r0, ror #16 |
| 29 | mov r1, r1, lsr #8 |
| 30 | mov r3, r3, lsr #8 |
| 31 | bic r3, r3, #0xff00 |
| 32 | bic r1, r1, #0xff00 |
| 33 | eor r1, r1, r0, ror #8 |
| 34 | eor r0, r3, ip, ror #8 |
Russell King | 6ebbf2c | 2014-06-30 16:29:12 +0100 | [diff] [blame] | 35 | ret lr |
Kim Phillips | 017f161 | 2013-11-06 05:15:24 +0100 | [diff] [blame] | 36 | ENDPROC(__bswapdi2) |
| 37 | #endif |