From b8d4472657840a9deef94dba3b0387709b7c200d Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Sun, 22 Mar 2026 21:14:39 +0100 Subject: [PATCH] corrects interrupt disable and restore macros Turns out the port was really that shitty --- port/threadx/inc/tx_port.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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