forked from linux-sunxi/sunxi-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fel: Implement fel_clrsetbits_le32() helper
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 <[email protected]>
- Loading branch information
Showing
5 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* 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) */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* <fel_clrsetbits_le32>: */ | ||
htole32(0xe59f0018), /* 0: ldr r0, [pc, #24] */ | ||
htole32(0xe5901000), /* 4: ldr r1, [r0] */ | ||
htole32(0xe59f2014), /* 8: ldr r2, [pc, #20] */ | ||
htole32(0xe1c11002), /* c: bic r1, r1, r2 */ | ||
htole32(0xe59f2010), /* 10: ldr r2, [pc, #16] */ | ||
htole32(0xe1811002), /* 14: orr r1, r1, r2 */ | ||
htole32(0xe5801000), /* 18: str r1, [r0] */ | ||
htole32(0xe12fff1e), /* 1c: bx lr */ |