You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The preemption path in __tx_preempt_load_context corrupted the
thread's r1, r2, and r3 during minimal-to-full frame conversion.
The old code read r0-r3 from the minimal frame into physical
registers, then overwrote r1 with PC, r2 with SPSR, and r3 with
a mode constant before pushing all four to the full frame.
This replaces broken STMDB-based approach with an indexed LDR/STR
strategy that avoids register conflicts:
- Save the thread's banked LR into r0 before mode switch (lr is
not in the minimal frame and must be captured while still in
the thread's mode)
- Use a frame base pointer (r3) for deferred reads from the
minimal frame
- Compute SP as SUB sp, r3, eclipse-threadx#28 instead of SUB sp, sp, eclipse-threadx#60 to
be mode-independent (sp is banked between SYS and SVC)
- Use CPS for register-free mode switch to SVC
- Fill r0-r3 from the minimal frame BEFORE callee-saved writes,
since for SVC-mode threads the full frame overlaps the minimal
frame on the same stack (r7-r10 slots alias r0-r3 slots)
0 commit comments