Hello,
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
1. Put the return value in r0 (I guess that the resumed previous caller would fetch r0 as the return value, though not 100% sure about it)
2. Jump back to previous caller
The final return statement simply fetches the value at *pcMutex and returns it, making it appear to the compiler that the value of pcMutex is used.
The compiler makes no guarantees about the interaction of inline assembly code with any other compiler feature or C code; for this reason, the compiler team recommends avoiding inline assembly code entirely. The author clearly intends for those four assembly instructions to be the entire body of the function, which will only be guaranteed if this function is actually written as assembly source code. Writing it as a C function with inline assembly will not make it inlinable.