This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STRD ATOMIC?

Hi, I make a software for Cortex-A9 and Cortex-M4 (both uni-processor system).

Question.

Is 64bit-aligned STRD(64bit memory access) atomic ?

(I know tha It is not atomic, but i don't know behavior.)

For example:

LDR R2,=buff

mov R0, #1

mov R1, #2

STRD R0, R1, [R2]

mov R0, #3

mov R1, #4

STRD R0, R1, [R2]   <-  interrupt occerd

handler:

LDR R2,=buff

LDR R0, R1, [R2]  <--- ???

Is[R0,R1] == [#3, #2] may?

If it is, require disable-interrupt between STRD?

Parents
  • Hello,

    Basically the answer for the question would be an implementation dependence.
    Therefore the situation would be different between Cortex-A9 and Cortex-M4.

    The instruction cycles of Cortex-A9 STRD is 1 and it cannot be aborted-restarted by an interrupt.

    But there is no guarantee for the fact.

    Regarding Cortex-M4, the execution logic of STRD would be the same as STM and it can be aborted-restarted by abn interrupt.

    However, in Cortex-M4 case, the interrupt abort of the multi-cycle instruction can be disabled by ACTLR (0xE000E008).

    And then, I think Cortex-M4 STRD would become atomic.

    Best regards,

    Yasuhiko Koumoto.

Reply
  • Hello,

    Basically the answer for the question would be an implementation dependence.
    Therefore the situation would be different between Cortex-A9 and Cortex-M4.

    The instruction cycles of Cortex-A9 STRD is 1 and it cannot be aborted-restarted by an interrupt.

    But there is no guarantee for the fact.

    Regarding Cortex-M4, the execution logic of STRD would be the same as STM and it can be aborted-restarted by abn interrupt.

    However, in Cortex-M4 case, the interrupt abort of the multi-cycle instruction can be disabled by ACTLR (0xE000E008).

    And then, I think Cortex-M4 STRD would become atomic.

    Best regards,

    Yasuhiko Koumoto.

Children