Commit aad13e8
committed
Implement WFI for Idle Loops and Enforce Shadow Stack Alignment
Optimized system reliability and interrupt latency by implementing wfi in the idle loop
and enforcing 16-byte alignment for the system stack.
Details:
1. Reliability (WFI) Implementation: Modified tx_thread_schedule.S to include the
wfi (Wait For Interrupt) instruction in the idle loop.
The scheduler now enters low-power sleep mode when no threads are ready,
instead of busy-waiting, reducing significant power consumption.
2. Interrupt Latency (Shadow Stack Alignment): Updated tx_initialize_low_level.S to
enforce 16-byte alignment on the system stack pointer (sp) before saving it to
_tx_thread_system_stack_ptr.
Ensures strict adherence to the RISC-V ABI and prevents misaligned access faults
or performance penalties during context switches to the interrupt stack.1 parent 85d0626 commit aad13e8
2 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
0 commit comments