corrects interrupt disable and restore macros

Turns out the port was really that shitty
This commit is contained in:
2026-03-22 21:14:39 +01:00
parent 78163ebb99
commit b8d4472657

View File

@@ -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