[riot-notifications] [RIOT-OS/RIOT] cpu/arm7_common: Make irq_*() compiler barriers (#11440)

Marian Buschsieweke notifications at github.com
Wed Apr 24 19:01:19 CEST 2019


maribu commented on this pull request.



>      return retval;
 }
 
 int irq_is_in(void)
 {
     int retval;
-    __asm__ volatile(" mrs  %0, cpsr" : "=r"(retval) : /* no inputs */);
+    __asm__ volatile(" mrs  %0, cpsr" : "=r"(retval) : /* no inputs */ : "memory");

Hmm, not a good example. `lock()`/`unlock()` would need to be `irq_disable()`/`irq_restore()` for that to be correct. But then it would be more elegant to call those regardsless of interrupt-/thread-context. But it would be technically correct, even though inelegant. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11440#discussion_r278225963
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190424/578c82d0/attachment.html>


More information about the notifications mailing list