Skip to content

Commit 9549fff

Browse files
deepikabhavnani0xc0170
authored andcommitted
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 dd21ea0 commit 9549fff

File tree

1 file changed

+8
-1
lines changed
  • rtos/source/TARGET_CORTEX/rtx5/RTX/Source

1 file changed

+8
-1
lines changed

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

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

127127
// Idle Thread Stack
128+
#if defined (__CC_ARM)
129+
static uint64_t os_idle_thread_stack[OS_IDLE_THREAD_STACK_SIZE/8];
130+
#else
128131
static uint64_t os_idle_thread_stack[OS_IDLE_THREAD_STACK_SIZE/8] \
129132
__attribute__((section(".bss.os.thread.stack")));
130-
133+
#endif
131134
// Idle Thread Attributes
132135
static const osThreadAttr_t os_idle_thread_attr = {
133136
#if defined(OS_IDLE_THREAD_NAME)
@@ -181,9 +184,13 @@ __attribute__((section(".data.os.timer.mpi"))) =
181184
static osRtxThread_t os_timer_thread_cb \
182185
__attribute__((section(".bss.os.thread.cb")));
183186

187+
#if defined (__CC_ARM)
188+
static uint64_t os_timer_thread_stack[OS_TIMER_THREAD_STACK_SIZE/8];
189+
#else
184190
// Timer Thread Stack
185191
static uint64_t os_timer_thread_stack[OS_TIMER_THREAD_STACK_SIZE/8] \
186192
__attribute__((section(".bss.os.thread.stack")));
193+
#endif
187194

188195
// Timer Thread Attributes
189196
static const osThreadAttr_t os_timer_thread_attr = {

0 commit comments

Comments
 (0)