On Wed, Oct 18, 2017 at 01:50:31PM +0000, Bernd Edlinger wrote:
> Yes, the volatile is still necessary.

Certainly.  And to work around the bug, it should work to mention some
hard register as asm input.  Ideally something that is live anyway;
perhaps the stack pointer :-)  Like so:

  __asm volatile ("mrs %0,PRIMASK" : "=r" (status) :: "sp");

(I tested this, it does work around the bug).

Or hey, why not the program counter, that should make it even clearer
something is funny here:

  __asm volatile ("mrs %0,PRIMASK" : "=r" (status) :: "pc");

(also tested, works fine).


Segher

Reply via email to