arch/x86_64: don't place the idle stack base below _ebss

The -16 in g_idle_topstack put the derived CPU0 idle stack base at
_ebss - 16, and tls_init_info() writes the TLS info there, corrupting
the last 16 bytes of .bss. Start the stack at _ebss like other
architectures.

Assisted-by: Claude Code
Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
raiden00pl 2026-08-26 14:48:44 +02:00 • committed by Alan C. Assis
parent d855b5662d
commit b4ea7848c6

View file

@ -55,8 +55,10 @@
* Public Functions
****************************************************************************/
/* The CPU0 idle stack starts at _ebss */
const uintptr_t g_idle_topstack = (uintptr_t)_ebss +
CONFIG_IDLETHREAD_STACKSIZE - 16;
CONFIG_IDLETHREAD_STACKSIZE;
/****************************************************************************
* Name: up_allocate_heap