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

Binary Semaphore upset by FIQ

semaphore_take:   

    mov    w2, #1                 // LOCK value
    dmb    sy                     // ensure all observers observe data before aquire is attempted
    ldaxr    w1, [x0]             // attempt to read and aquire lock
    cbnz    w1, semaphore_take    // lock is not zero so loop and try and aquire again
    stxr    w3, w2, [x0]          // attempt to store LOCK value
    cbnz    w3, semaphore_take    // retry if store failed
    dmb    sy                     // ensures that all subsequent accesses are observed after gaining of the lock is observed

The above semaphore code worked flawlessly until the moment I added FIQ code.

Now the semaphore leaks thru critical sections even though the FIQ does not come anywhere near the semaphore.

Is there something I need to know about FIQ and LDREX/STREX functions?

Parents
  • Nope it fails I tried mixing around various combos they don't seem to be paired like you suggest.

    "ldaxr" and "stxr"  works the same "ldaxr" and "stlxr" and every other combo probably because I have the dmb sy in place.

    A forum comment says that ldaxr is essentially ldxr + dmb sy  ... or is that not correct

Reply
  • Nope it fails I tried mixing around various combos they don't seem to be paired like you suggest.

    "ldaxr" and "stxr"  works the same "ldaxr" and "stlxr" and every other combo probably because I have the dmb sy in place.

    A forum comment says that ldaxr is essentially ldxr + dmb sy  ... or is that not correct

Children