From dd0c8379308133dcf6fd1d4fd696077eba368197 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Mon, 30 Mar 2026 19:48:09 +0200 Subject: [PATCH] corrects stack alignment --- port/threadx/src/tx_thread_stack_build.S | 2 +- port/threadx_smp/src/tx_thread_stack_build.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/port/threadx/src/tx_thread_stack_build.S b/port/threadx/src/tx_thread_stack_build.S index ec6f90b..2436d30 100644 --- a/port/threadx/src/tx_thread_stack_build.S +++ b/port/threadx/src/tx_thread_stack_build.S @@ -139,7 +139,7 @@ If floating point support: Stack Bottom: (higher memory address) */ LOAD t0, TX_THREAD_STACK_END_OFFSET(a0) // Pickup end of stack area - andi t0, t0, -4*REGBYTES // Ensure alignment (16-byte for RV32 & 32-byte for RV64) + andi t0, t0, -16 // Ensure 16-byte alignment /* Actually build the stack frame. */ diff --git a/port/threadx_smp/src/tx_thread_stack_build.S b/port/threadx_smp/src/tx_thread_stack_build.S index d11d2bf..bc6fc73 100644 --- a/port/threadx_smp/src/tx_thread_stack_build.S +++ b/port/threadx_smp/src/tx_thread_stack_build.S @@ -139,7 +139,7 @@ If floating point support: Stack Bottom: (higher memory address) */ LOAD t0, TX_THREAD_STACK_END_OFFSET(a0) // Pickup end of stack area - andi t0, t0, -4*REGBYTES // Ensure alignment (16-byte for RV32 & 32-byte for RV64) + andi t0, t0, -16 // Ensure 16-byte alignment /* Actually build the stack frame. */