Skip to content

Commit

Permalink
[ARM] arm32: improve coment to explain SWP instruction support in abo…
Browse files Browse the repository at this point in the history
…rt for ARM V5.

Signed-off-by: Anup Patel <anup@brainfault.org>
  • Loading branch information
jcdubois authored and avpatel committed May 27, 2012
1 parent ad6d014 commit 4ab0a09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/arm/cpu/arm32/include/cpu_inline_asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,15 @@ static inline u32 read_dfsr(void)
* all STM/STR/LDM/LDR instructions have bit 20 to indicate
* if it is a read or write operation. We test this bit
* to set or clear bit 11 on the DFSR result.
* FIXME: We need also to handle the swap instruction
* SWP instruction is reading and writing to memory. So we
* assume write. SWP has 0 on bit 20 (like STM or STR).
*/
if (inst & (1 << 20)) {
/* LDM or LDR type instruction */
rval &= ~(1 << 11);
} else {
/* STM or STR type instruction */
/* SWP instruction is writing to memory */
rval |= (1 << 11);
}

Expand Down

0 comments on commit 4ab0a09

Please sign in to comment.