implements proper linker script to support TLS

This change updates the linker script and dependend wile so that thread local
storage sections are properly supported and initailaized
This commit is contained in:
2026-02-01 06:43:47 +01:00
parent 6d5871687c
commit 1c9c00235d
7 changed files with 121 additions and 175 deletions

View File

@@ -135,12 +135,12 @@ trap_handler:
*/
.global _tx_initialize_low_level
.weak _tx_initialize_low_level
.extern _end
.extern __heap_start
.extern board_init
_tx_initialize_low_level:
STORE sp, _tx_thread_system_stack_ptr, t0 // Save system stack pointer
la t0, _end // Pickup first free address
la t0, __heap_start // Pickup first free address
STORE t0, _tx_initialize_unused_memory, t1 // Save unused memory address
li t0, MSTATUS_MIE
csrrc zero, mstatus, t0 // clear MSTATUS_MIE bit