Skip to content

Commit ab3c1e3

Browse files
c1728p90xc0170
authored andcommitted
RTX: Support stacks larger than 64k
Cherry pick commit d587474 - "RTX: Support stacks larger than 64k" This allows the latest version of the RTOS to run mbed client over ethernet without crashing.
1 parent 007223c commit ab3c1e3

File tree

10 files changed

+12
-11
lines changed

10 files changed

+12
-11
lines changed

libraries/rtos/rtx/TARGET_CORTEX_M/TARGET_M0/TOOLCHAIN_GCC/HAL_CM0.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
.file "HAL_CM0.S"
3636
.syntax unified
3737

38-
.equ TCB_TSTACK, 40
38+
.equ TCB_TSTACK, 44
3939

4040

4141
/*----------------------------------------------------------------------------

libraries/rtos/rtx/TARGET_CORTEX_M/TARGET_M0/TOOLCHAIN_IAR/HAL_CM0.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
NAME HAL_CM0.S
3636

37-
#define TCB_TSTACK 40
37+
#define TCB_TSTACK 44
3838

3939
EXTERN os_flags
4040
EXTERN os_tsk

libraries/rtos/rtx/TARGET_CORTEX_M/TARGET_M0P/TOOLCHAIN_GCC/HAL_CM0.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
.file "HAL_CM0.S"
3636
.syntax unified
3737

38-
.equ TCB_TSTACK, 40
38+
.equ TCB_TSTACK, 44
3939

4040

4141
/*----------------------------------------------------------------------------

libraries/rtos/rtx/TARGET_CORTEX_M/TARGET_M0P/TOOLCHAIN_IAR/HAL_CM0.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
NAME HAL_CM0.S
3636

37-
#define TCB_TSTACK 40
37+
#define TCB_TSTACK 44
3838

3939
EXTERN os_flags
4040
EXTERN os_tsk

libraries/rtos/rtx/TARGET_CORTEX_M/TARGET_M3/TOOLCHAIN_GCC/HAL_CM3.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
.file "HAL_CM3.S"
3636
.syntax unified
3737

38-
.equ TCB_TSTACK, 40
38+
.equ TCB_TSTACK, 44
3939

4040

4141
/*----------------------------------------------------------------------------

libraries/rtos/rtx/TARGET_CORTEX_M/TARGET_M3/TOOLCHAIN_IAR/HAL_CM3.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
NAME HAL_CM3.S
3636

37-
#define TCB_TSTACK 40
37+
#define TCB_TSTACK 44
3838

3939
EXTERN os_flags
4040
EXTERN os_tsk

libraries/rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC/HAL_CM4.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
.syntax unified
3737

3838
.equ TCB_STACKF, 37
39-
.equ TCB_TSTACK, 40
39+
.equ TCB_TSTACK, 44
4040

4141

4242
/*----------------------------------------------------------------------------

libraries/rtos/rtx/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_IAR/HAL_CM4.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
NAME HAL_CM4.S
3636

3737
#define TCB_STACKF 37
38-
#define TCB_TSTACK 40
38+
#define TCB_TSTACK 44
3939

4040
EXTERN os_flags
4141
EXTERN os_tsk

libraries/rtos/rtx/TARGET_CORTEX_M/rt_Task.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ OS_TID rt_tsk_create (FUNCP task, U32 prio_stksz, void *stk, void *argv) {
233233
}
234234
/* If "size != 0" use a private user provided stack. */
235235
task_context->stack = stk;
236-
task_context->priv_stack = (U16)(prio_stksz >> 8);
236+
task_context->priv_stack = prio_stksz >> 8;
237237
/* Pass parameter 'argv' to 'rt_init_context' */
238238
task_context->msg = argv;
239239
/* For 'size == 0' system allocates the user stack from the memory pool. */

libraries/rtos/rtx/TARGET_CORTEX_M/rt_TypeDef.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,17 @@ typedef struct OS_TCB {
7171

7272
/* Hardware dependant part: specific for CM processor */
7373
U8 stack_frame; /* Stack frame: 0=Basic, 1=Extended, */
74+
U16 reserved; /* Two reserved bytes for alignment */
7475
/* (2=VFP/D16 stacked, 4=NEON/D32 stacked) */
75-
U16 priv_stack; /* Private stack size, 0= system assigned */
76+
U32 priv_stack; /* Private stack size, 0= system assigned */
7677
U32 tsk_stack; /* Current task Stack pointer (R13) */
7778
U32 *stack; /* Pointer to Task Stack memory block */
7879

7980
/* Task entry point used for uVision debugger */
8081
FUNCP ptask; /* Task entry address */
8182
} *P_TCB;
8283
#define TCB_STACKF 37 /* 'stack_frame' offset */
83-
#define TCB_TSTACK 40 /* 'tsk_stack' offset */
84+
#define TCB_TSTACK 44 /* 'tsk_stack' offset */
8485

8586
typedef struct OS_PSFE { /* Post Service Fifo Entry */
8687
void *id; /* Object Identification */

0 commit comments

Comments
 (0)