]> granicus.if.org Git - esp-idf/commitdiff
intr_alloc: mark inline asm operand as earlyclobber
authorIvan Grokhotkov <ivan@espressif.com>
Wed, 18 Jan 2017 10:31:06 +0000 (18:31 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Wed, 18 Jan 2017 10:31:06 +0000 (18:31 +0800)
When compiling in release mode, compiler was choosing same register for
oldint and intmask variables, so INTENABLE was never modified.
This effectively broke disabling of non-IRAM interrupts during flash
operations, observed in the existing tests if task watchdog is enabled.
This change adds an extra constraint tells the compiler that output
operand should not be placed into the same register as an input one.

components/esp32/intr_alloc.c

index bfd6c51206dea0f9b586b0fca2a52de198523cda..d9cc627e17d8c1e3e34754694b16675f3e372beb 100644 (file)
@@ -700,7 +700,7 @@ void esp_intr_noniram_disable()
         "and a3,%0,%1\n"        //mask ints that need disabling
         "wsr a3,INTENABLE\n"    //write back
         "rsync\n"
-        :"=r"(oldint):"r"(intmask):"a3");
+        :"=&r"(oldint):"r"(intmask):"a3");
     //Save which ints we did disable
     non_iram_int_disabled[cpu]=oldint&non_iram_int_mask[cpu];
 }