Skip to content

Commit ba92372

Browse files
author
deepikabhavnani
committed
CMSIS/RTX: Move Idle and Timer thread stack to bss section.
In case of ARM compiler, idle and timer thread stack though assigned to `.bss.os` section since not zero initialized are part of `data` section. In this commit, we are moving stacks of idle and timer thread to bss section and thereby saving ROM space.
1 parent 255661e commit ba92372

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

rtos/TARGET_CORTEX/rtx5/RTX/Source/rtx_lib.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ static osRtxThread_t os_idle_thread_cb \
122122
__attribute__((section(".bss.os.thread.cb")));
123123

124124
// Idle Thread Stack
125+
#if defined (__CC_ARM)
126+
static uint64_t os_idle_thread_stack[OS_IDLE_THREAD_STACK_SIZE/8];
127+
#else
125128
static uint64_t os_idle_thread_stack[OS_IDLE_THREAD_STACK_SIZE/8] \
126129
__attribute__((section(".bss.os.thread.stack")));
127-
130+
#endif
128131
// Idle Thread Attributes
129132
static const osThreadAttr_t os_idle_thread_attr = {
130133
#if defined(OS_IDLE_THREAD_NAME)
@@ -178,9 +181,13 @@ __attribute__((section(".data.os.timer.mpi"))) =
178181
static osRtxThread_t os_timer_thread_cb \
179182
__attribute__((section(".bss.os.thread.cb")));
180183

184+
#if defined (__CC_ARM)
185+
static uint64_t os_timer_thread_stack[OS_TIMER_THREAD_STACK_SIZE/8];
186+
#else
181187
// Timer Thread Stack
182188
static uint64_t os_timer_thread_stack[OS_TIMER_THREAD_STACK_SIZE/8] \
183189
__attribute__((section(".bss.os.thread.stack")));
190+
#endif
184191

185192
// Timer Thread Attributes
186193
static const osThreadAttr_t os_timer_thread_attr = {

0 commit comments

Comments
 (0)