Introduces Regression for 32 and 64 bit threadx and smp kernel in Debug, MinSizeRel and Release configuration #4

Merged
alex merged 79 commits from feature/test into main 2026-04-02 14:09:29 +01:00
3 changed files with 7 additions and 20 deletions
Showing only changes of commit 8a41f3e0fa - Show all commits

View File

@@ -80,20 +80,15 @@ _tx_thread_schedule:
la t0, _tx_thread_execute_ptr // Pickup address of execute ptr
add t0, t0, t4 // Select this hart's execute slot
_tx_thread_schedule_loop:
csrci mstatus, 0x08 // Lockout interrupts
LOAD t1, 0(t0) // Pickup next thread to execute
bnez t1, _tx_thread_schedule_thread // If non-NULL, continue
csrsi mstatus, 0x08 // Enable interrupts
#ifdef TX_ENABLE_WFI
csrci mstatus, 0x08 // Lockout interrupts
LOAD t1, 0(t0) // Pickup next thread to execute
bnez t1, _tx_thread_schedule_thread // If non-NULL, continue
csrsi mstatus, 0x08 // Enable interrupts
wfi // Wait for interrupt
j _tx_thread_schedule_loop // Keep looking for a thread
#else
csrci mstatus, 0x08 // Lockout interrupts
LOAD t1, 0(t0) // Pickup next thread to execute
bnez t1, _tx_thread_schedule_thread // If non-NULL, continue
csrsi mstatus, 0x08 // Enable interrupts
j _tx_thread_schedule_loop // Keep looking for a thread
#endif
j _tx_thread_schedule_loop // Keep looking for a thread
_tx_thread_schedule_thread:
/* Atomically claim the thread's ready token so only one hart can

View File

@@ -23,18 +23,11 @@ _tx_thread_smp_protect:
/* Try to get the protection. */
LWU t4, 0(t1) // Pickup protection flag
beqz t4, _get_protection // If clear, try to claim it
/* Protection is busy. Restore interrupts and retry. */
csrw mstatus, a0 // Restore interrupts
j _tx_thread_smp_protect // Restart the protection attempt
_get_protection:
bnez t4, _protection_busy // If set, protection is busy
li t4, 1 // Build lock value
amoswap.w.aq t5, t4, (t1) // Attempt to get protection
bnez t5, _protection_busy // If old value != 0, retry
_got_protection:
fence rw, rw // Ensure lock acquisition is visible
sw t2, 4(t1) // Save owning hart

View File

@@ -35,7 +35,6 @@ _tx_thread_smp_unprotect:
/* Release the protection. */
li t3, -1 // Invalid owner value
sw t3, 4(t2) // Mark owning hart invalid
fence rw, rw // Ensure shared accesses complete
amoswap.w.rl x0, x0, (t2) // Release protection flag
_still_protected: