Skip to content

Commit 1a60059

Browse files
Cruz Monrreal IICruz Monrreal II
authored andcommitted
Revert "Merge pull request ARMmbed#9092 from mprse/stack_unification_sec_try"
This reverts commit 2454b25, reversing changes made to 12980f4.
1 parent 28d5477 commit 1a60059

File tree

445 files changed

+596
-3177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

445 files changed

+596
-3177
lines changed

TESTS/mbed_hal/stack_size_unification/main.cpp

Lines changed: 0 additions & 76 deletions
This file was deleted.

TESTS/mbed_hal/stack_size_unification/stack_size_unification.h

Lines changed: 0 additions & 51 deletions
This file was deleted.

rtos/TARGET_CORTEX/TOOLCHAIN_ARM_MICRO/mbed_boot_arm_micro.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ extern uint32_t __initial_sp[];
2525
extern uint32_t __heap_base[];
2626
extern uint32_t __heap_limit[];
2727

28-
#if !defined(ISR_STACK_SIZE)
29-
#define ISR_STACK_SIZE ((uint32_t)1024)
30-
#endif
31-
3228
/*
3329
* mbed entry point for the MICROLIB toolchain
3430
*

rtos/TARGET_CORTEX/TOOLCHAIN_ARM_STD/mbed_boot_arm_std.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,11 @@
2727
__value_in_regs struct __argc_argv __rt_lib_init(unsigned heapbase, unsigned heaptop);
2828
void _platform_post_stackheap_init(void);
2929

30-
#if !defined(ISR_STACK_SIZE)
31-
#if (defined(__CC_ARM))
32-
extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Base[];
33-
extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Length[];
34-
#define ISR_STACK_START ((unsigned char*)Image$$ARM_LIB_STACK$$ZI$$Base)
35-
#define ISR_STACK_SIZE ((uint32_t)Image$$ARM_LIB_STACK$$ZI$$Length)
36-
#endif
37-
#endif
38-
3930
#if !defined(HEAP_START)
4031
/* Defined by linker script */
4132
extern uint32_t Image$$RW_IRAM1$$ZI$$Limit[];
4233
#define HEAP_START ((unsigned char*)Image$$RW_IRAM1$$ZI$$Limit)
43-
#define HEAP_SIZE ((uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START))
34+
#define HEAP_SIZE ((uint32_t)((uint32_t)INITIAL_SP - (uint32_t)HEAP_START))
4435
#endif
4536

4637
/*

rtos/TARGET_CORTEX/TOOLCHAIN_GCC_ARM/mbed_boot_gcc_arm.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,11 @@ static osMutexId_t env_mutex_id;
2929
static mbed_rtos_storage_mutex_t env_mutex_obj;
3030
static osMutexAttr_t env_mutex_attr;
3131

32-
#if !defined(ISR_STACK_SIZE)
33-
#if (defined(__GNUC__) && !defined(__CC_ARM) && !defined(__ARMCC_VERSION))
34-
extern uint32_t __StackLimit;
35-
extern uint32_t __StackTop;
36-
#define ISR_STACK_START ((unsigned char*)&__StackLimit)
37-
#define ISR_STACK_SIZE ((uint32_t)((uint32_t)&__StackTop - (uint32_t)&__StackLimit))
38-
#endif
39-
#endif
40-
4132
#if !defined(HEAP_START)
4233
/* Defined by linker script */
4334
extern uint32_t __end__[];
4435
#define HEAP_START ((unsigned char*)__end__)
45-
#define HEAP_SIZE ((uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START))
36+
#define HEAP_SIZE ((uint32_t)((uint32_t)INITIAL_SP - (uint32_t)HEAP_START))
4637
#endif
4738

4839
extern void __libc_init_array(void);

rtos/TARGET_CORTEX/mbed_boot.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ extern "C" {
5050
* @{
5151
*/
5252

53+
/* Define stack sizes if they haven't been set already */
54+
#if !defined(ISR_STACK_SIZE)
55+
#define ISR_STACK_SIZE ((uint32_t)1024)
56+
#endif
57+
5358
/* Heap limits - only used if set */
5459
extern unsigned char *mbed_heap_start;
5560
extern uint32_t mbed_heap_size;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0/device/TOOLCHAIN_GCC_ARM/MPS2.ld

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
#include "../memory_zones.h"
3232
#include "../cmsis_nvic.h"
3333

34-
#if !defined(MBED_BOOT_STACK_SIZE)
35-
#define MBED_BOOT_STACK_SIZE 0x400
36-
#endif
37-
3834
MEMORY
3935
{
4036
VECTORS (rx) : ORIGIN = MAPPABLE_START, LENGTH = MAPPABLE_SIZE
@@ -70,7 +66,7 @@ MEMORY
7066
*/
7167
ENTRY(Reset_Handler)
7268

73-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
69+
STACK_SIZE = 0x400;
7470

7571
/* Size of the vector table in SRAM */
7672
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,8 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4848

4949
/*-Sizes-*/
5050
/* Heap and Stack size */
51-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
52-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
53-
}
5451
define symbol __ICFEDIT_size_heap__ = 0x200000;
55-
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
52+
define symbol __ICFEDIT_size_cstack__ = 0x400;
5653
/**** End of ICF editor section. ###ICF###*/
5754

5855
define memory mem with size = 4G;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0P/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@
3737
#include "../memory_zones.h"
3838
#include "../cmsis_nvic.h"
3939

40-
#if !defined(MBED_BOOT_STACK_SIZE)
41-
#define MBED_BOOT_STACK_SIZE 0x400
42-
#endif
43-
4440
#if (defined(__stack_size__))
4541
#define STACK_SIZE __stack_size__
4642
#else
47-
#define STACK_SIZE MBED_BOOT_STACK_SIZE
43+
#define STACK_SIZE 0x0400
4844
#endif
4945

5046
; The vector table is loaded at address 0x00000000 in Flash memory region.
@@ -60,7 +56,7 @@ LR_IROM2 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
6056
.ANY (+RO)
6157
}
6258
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
63-
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
59+
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE) { ; RW data
6460
.ANY (+RW +ZI)
6561
}
6662
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0P/device/TOOLCHAIN_GCC_ARM/MPS2.ld

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ MEMORY
6666
*/
6767
ENTRY(Reset_Handler)
6868

69-
#if !defined(MBED_BOOT_STACK_SIZE)
70-
#define MBED_BOOT_STACK_SIZE 0x400
71-
#endif
72-
73-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
69+
STACK_SIZE = 0x400;
7470

7571
/* Size of the vector table in SRAM */
7672
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0P/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,8 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4848

4949
/*-Sizes-*/
5050
/* Heap and Stack size */
51-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
52-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
53-
}
5451
define symbol __ICFEDIT_size_heap__ = 0x200000;
55-
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
52+
define symbol __ICFEDIT_size_cstack__ = 0x400;
5653
/**** End of ICF editor section. ###ICF###*/
5754

5855
define memory mem with size = 4G;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M3/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@
3737
#include "../memory_zones.h"
3838
#include "../cmsis_nvic.h"
3939

40-
#if !defined(MBED_BOOT_STACK_SIZE)
41-
#define MBED_BOOT_STACK_SIZE 0x400
42-
#endif
43-
4440
#if (defined(__stack_size__))
4541
#define STACK_SIZE __stack_size__
4642
#else
47-
#define STACK_SIZE MBED_BOOT_STACK_SIZE
43+
#define STACK_SIZE 0x0400
4844
#endif
4945

5046
; The vector table is loaded at address 0x00000000 in Flash memory region.
@@ -60,7 +56,7 @@ LR_IROM2 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
6056
.ANY (+RO)
6157
}
6258
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
63-
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
59+
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE) { ; RW data
6460
.ANY (+RW +ZI)
6561
}
6662
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M3/device/TOOLCHAIN_GCC_ARM/MPS2.ld

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ MEMORY
6666
*/
6767
ENTRY(Reset_Handler)
6868

69-
#if !defined(MBED_BOOT_STACK_SIZE)
70-
#define MBED_BOOT_STACK_SIZE 0x400
71-
#endif
72-
73-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
69+
STACK_SIZE = 0x400;
7470

7571
/* Size of the vector table in SRAM */
7672
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M3/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,8 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4848

4949
/*-Sizes-*/
5050
/* Heap and Stack size */
51-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
52-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
53-
}
5451
define symbol __ICFEDIT_size_heap__ = 0x200000;
55-
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
52+
define symbol __ICFEDIT_size_cstack__ = 0x400;
5653
/**** End of ICF editor section. ###ICF###*/
5754

5855
define memory mem with size = 4G;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M4/device/TOOLCHAIN_ARM_STD/MPS2.sct

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@
3737
#include "../memory_zones.h"
3838
#include "../cmsis_nvic.h"
3939

40-
#if !defined(MBED_BOOT_STACK_SIZE)
41-
#define MBED_BOOT_STACK_SIZE 0x400
42-
#endif
43-
4440
#if (defined(__stack_size__))
4541
#define STACK_SIZE __stack_size__
4642
#else
47-
#define STACK_SIZE MBED_BOOT_STACK_SIZE
43+
#define STACK_SIZE 0x0400
4844
#endif
4945

5046
; The vector table is loaded at address 0x00000000 in Flash memory region.
@@ -60,7 +56,7 @@ LR_IROM2 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
6056
.ANY (+RO)
6157
}
6258
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
63-
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
59+
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE) { ; RW data
6460
.ANY (+RW +ZI)
6561
}
6662
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M4/device/TOOLCHAIN_GCC_ARM/MPS2.ld

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
#include "../memory_zones.h"
3232
#include "../cmsis_nvic.h"
3333

34-
#if !defined(MBED_BOOT_STACK_SIZE)
35-
#define MBED_BOOT_STACK_SIZE 0x400
36-
#endif
37-
3834
MEMORY
3935
{
4036
VECTORS (rx) : ORIGIN = MAPPABLE_START, LENGTH = MAPPABLE_SIZE
@@ -70,7 +66,7 @@ MEMORY
7066
*/
7167
ENTRY(Reset_Handler)
7268

73-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
69+
STACK_SIZE = 0x400;
7470

7571
/* Size of the vector table in SRAM */
7672
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M4/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,8 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE
4848

4949
/*-Sizes-*/
5050
/* Heap and Stack size */
51-
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
52-
define symbol MBED_BOOT_STACK_SIZE = 0x400;
53-
}
5451
define symbol __ICFEDIT_size_heap__ = 0x200000;
55-
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
52+
define symbol __ICFEDIT_size_cstack__ = 0x400;
5653
/**** End of ICF editor section. ###ICF###*/
5754

5855
define memory mem with size = 4G;

0 commit comments

Comments
 (0)