From 9947ce8d5213291ffce74a6df1e64ffa4c03f35a Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Sun, 22 Mar 2026 15:56:00 +0100 Subject: [PATCH] corrects naming of TX_INTERRUPT_SAVE_AREA to meet test expectations Also corrects the sizes, as ULONG is XLEN bits --- port/threadx/inc/tx_port.h | 18 +++++++++--------- port/threadx_smp/inc/tx_port.h | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/port/threadx/inc/tx_port.h b/port/threadx/inc/tx_port.h index 7ee7252..e2fc50e 100644 --- a/port/threadx/inc/tx_port.h +++ b/port/threadx/inc/tx_port.h @@ -335,25 +335,25 @@ extern TEST_FLAG test_forced_mutex_timeout; #ifdef TX_DISABLE_INLINE -ULONG64 _tx_thread_interrupt_control(unsigned int new_posture); +ULONG _tx_thread_interrupt_control(unsigned int new_posture); -#define TX_INTERRUPT_SAVE_AREA register ULONG64 interrupt_save; +#define TX_INTERRUPT_SAVE_AREA register ULONG tx_saved_posture; -#define TX_DISABLE interrupt_save = _tx_thread_interrupt_control(TX_INT_DISABLE); -#define TX_RESTORE _tx_thread_interrupt_control(interrupt_save); +#define TX_DISABLE tx_saved_posture = _tx_thread_interrupt_control(TX_INT_DISABLE); +#define TX_RESTORE _tx_thread_interrupt_control(tx_saved_posture); #else -#define TX_INTERRUPT_SAVE_AREA ULONG64 interrupt_save; -/* Atomically read mstatus into interrupt_save and clear bit 3 of mstatus. */ +#define TX_INTERRUPT_SAVE_AREA ULONG tx_saved_posture; +/* Atomically read mstatus into tx_saved_posture and clear bit 3 of mstatus. */ #define TX_DISABLE \ { \ - __asm__("csrrci %0, mstatus, 0x08" : "=r"(interrupt_save) :); \ + __asm__("csrrci %0, mstatus, 0x08" : "=r"(tx_saved_posture) :); \ }; -/* We only care about mstatus.mie (bit 3), so mask interrupt_save and write to mstatus. */ +/* We only care about mstatus.mie (bit 3), so mask tx_saved_posture and write to mstatus. */ #define TX_RESTORE \ { \ - register ULONG64 __tempmask = interrupt_save & 0x08; \ + register ULONG __tempmask = tx_saved_posture & 0x08; \ __asm__("csrrs x0, mstatus, %0 \n\t" : : "r"(__tempmask) :); \ }; diff --git a/port/threadx_smp/inc/tx_port.h b/port/threadx_smp/inc/tx_port.h index aefe3fd..698f36a 100644 --- a/port/threadx_smp/inc/tx_port.h +++ b/port/threadx_smp/inc/tx_port.h @@ -315,10 +315,10 @@ typedef struct TX_THREAD_SMP_PROTECT_STRUCT is used to define a local function save area for the disable and restore macros. */ -#define TX_INTERRUPT_SAVE_AREA ULONG64 interrupt_save; +#define TX_INTERRUPT_SAVE_AREA ULONG tx_saved_posture; -#define TX_DISABLE interrupt_save = _tx_thread_smp_protect(); -#define TX_RESTORE _tx_thread_smp_unprotect(interrupt_save); +#define TX_DISABLE tx_saved_posture = _tx_thread_smp_protect(); +#define TX_RESTORE _tx_thread_smp_unprotect(tx_saved_posture); /************* End ThreadX SMP data type and function prototype definitions. *************/