diff --git a/port/threadx/inc/tx_port.h b/port/threadx/inc/tx_port.h index e2fc50e..734eb81 100644 --- a/port/threadx/inc/tx_port.h +++ b/port/threadx/inc/tx_port.h @@ -348,13 +348,13 @@ ULONG _tx_thread_interrupt_control(unsigned int new_posture); /* Atomically read mstatus into tx_saved_posture and clear bit 3 of mstatus. */ #define TX_DISABLE \ { \ - __asm__("csrrci %0, mstatus, 0x08" : "=r"(tx_saved_posture) :); \ + __asm__ volatile("csrrci %0, mstatus, 0x08" : "=r"(tx_saved_posture) : : "memory"); \ }; /* We only care about mstatus.mie (bit 3), so mask tx_saved_posture and write to mstatus. */ #define TX_RESTORE \ { \ register ULONG __tempmask = tx_saved_posture & 0x08; \ - __asm__("csrrs x0, mstatus, %0 \n\t" : : "r"(__tempmask) :); \ + __asm__ volatile("csrrs x0, mstatus, %0" : : "r"(__tempmask) : "memory"); \ }; #endif