mirror of
https://github.com/linux-sunxi/sunxi-tools.git
synced 2024-11-26 19:33:58 +08:00
0858b7105c
This function provides bitwise clear/set operations on 32-bit words via FEL. It may help with implementing future functionality, where ARM register manipulations often involve such bit level access. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
18 lines
458 B
ArmAsm
18 lines
458 B
ArmAsm
/*
|
|
* Thunk code to assist with bitwise operations (set/clear) via FEL
|
|
*/
|
|
|
|
fel_clrsetbits_le32:
|
|
ldr r0, 1f /* address */
|
|
ldr r1, [r0] /* load value */
|
|
ldr r2, 2f /* clrbits mask */
|
|
bic r1, r2 /* clear bits, post-increment r1 */
|
|
ldr r2, 3f /* setbits mask */
|
|
orr r1, r2 /* set bits (logical "or") */
|
|
str r1, [r0] /* store result */
|
|
bx lr
|
|
|
|
1: .word 0 /* addr */
|
|
2: .word 0 /* clrbits (= bits to clear) */
|
|
3: .word 0 /* setbits (= bits to set) */
|