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

InterlockedExchangeAdd equivalent

Note: This was originally posted on 11th February 2013 at http://forums.arm.com

I'm porting a Windows application to an ARM® Cortex-A9 based system running Ubuntu 12.04 and I need something equivalent the Windows function InterlockedExchangeAdd().  Is there a function like this available for ARM?  If not, can anyone provide some equivalent assembly code?
Parents
  • Note: This was originally posted on 13th February 2013 at http://forums.arm.com


    Hmm, depending what you are doing with them you are probably missing a barrier which ensures ordering relative to other instructions in the instruction stream. See http://infocenter.ar...ookbook_A08.pdf


    So if I understand you correctly, per section 7.2.1 of the document, in order to preserve ordering I need to add a "DMB" after the "BNE" command, right?  Sorry if that's a seemingly obvious question, but I'm somewhat new to ARM assembly language programming.
Reply
  • Note: This was originally posted on 13th February 2013 at http://forums.arm.com


    Hmm, depending what you are doing with them you are probably missing a barrier which ensures ordering relative to other instructions in the instruction stream. See http://infocenter.ar...ookbook_A08.pdf


    So if I understand you correctly, per section 7.2.1 of the document, in order to preserve ordering I need to add a "DMB" after the "BNE" command, right?  Sorry if that's a seemingly obvious question, but I'm somewhat new to ARM assembly language programming.
Children
No data