Skip to content

Revert "Merge pull request #9092 from mprse/stack_unification_sec_try" #9349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
76 changes: 0 additions & 76 deletions TESTS/mbed_hal/stack_size_unification/main.cpp

This file was deleted.

51 changes: 0 additions & 51 deletions TESTS/mbed_hal/stack_size_unification/stack_size_unification.h

This file was deleted.

4 changes: 0 additions & 4 deletions rtos/TARGET_CORTEX/TOOLCHAIN_ARM_MICRO/mbed_boot_arm_micro.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ extern uint32_t __initial_sp[];
extern uint32_t __heap_base[];
extern uint32_t __heap_limit[];

#if !defined(ISR_STACK_SIZE)
#define ISR_STACK_SIZE ((uint32_t)1024)
#endif

/*
* mbed entry point for the MICROLIB toolchain
*
Expand Down
11 changes: 1 addition & 10 deletions rtos/TARGET_CORTEX/TOOLCHAIN_ARM_STD/mbed_boot_arm_std.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,11 @@
__value_in_regs struct __argc_argv __rt_lib_init(unsigned heapbase, unsigned heaptop);
void _platform_post_stackheap_init(void);

#if !defined(ISR_STACK_SIZE)
#if (defined(__CC_ARM))
extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Base[];
extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Length[];
#define ISR_STACK_START ((unsigned char*)Image$$ARM_LIB_STACK$$ZI$$Base)
#define ISR_STACK_SIZE ((uint32_t)Image$$ARM_LIB_STACK$$ZI$$Length)
#endif
#endif

#if !defined(HEAP_START)
/* Defined by linker script */
extern uint32_t Image$$RW_IRAM1$$ZI$$Limit[];
#define HEAP_START ((unsigned char*)Image$$RW_IRAM1$$ZI$$Limit)
#define HEAP_SIZE ((uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START))
#define HEAP_SIZE ((uint32_t)((uint32_t)INITIAL_SP - (uint32_t)HEAP_START))
#endif

/*
Expand Down
11 changes: 1 addition & 10 deletions rtos/TARGET_CORTEX/TOOLCHAIN_GCC_ARM/mbed_boot_gcc_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,11 @@ static osMutexId_t env_mutex_id;
static mbed_rtos_storage_mutex_t env_mutex_obj;
static osMutexAttr_t env_mutex_attr;

#if !defined(ISR_STACK_SIZE)
#if (defined(__GNUC__) && !defined(__CC_ARM) && !defined(__ARMCC_VERSION))
extern uint32_t __StackLimit;
extern uint32_t __StackTop;
#define ISR_STACK_START ((unsigned char*)&__StackLimit)
#define ISR_STACK_SIZE ((uint32_t)((uint32_t)&__StackTop - (uint32_t)&__StackLimit))
#endif
#endif

#if !defined(HEAP_START)
/* Defined by linker script */
extern uint32_t __end__[];
#define HEAP_START ((unsigned char*)__end__)
#define HEAP_SIZE ((uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START))
#define HEAP_SIZE ((uint32_t)((uint32_t)INITIAL_SP - (uint32_t)HEAP_START))
#endif

extern void __libc_init_array(void);
Expand Down
5 changes: 5 additions & 0 deletions rtos/TARGET_CORTEX/mbed_boot.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ extern "C" {
* @{
*/

/* Define stack sizes if they haven't been set already */
#if !defined(ISR_STACK_SIZE)
#define ISR_STACK_SIZE ((uint32_t)1024)
#endif

/* Heap limits - only used if set */
extern unsigned char *mbed_heap_start;
extern uint32_t mbed_heap_size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
#include "../memory_zones.h"
#include "../cmsis_nvic.h"

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

MEMORY
{
VECTORS (rx) : ORIGIN = MAPPABLE_START, LENGTH = MAPPABLE_SIZE
Expand Down Expand Up @@ -70,7 +66,7 @@ MEMORY
*/
ENTRY(Reset_Handler)

STACK_SIZE = MBED_BOOT_STACK_SIZE;
STACK_SIZE = 0x400;

/* Size of the vector table in SRAM */
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE

/*-Sizes-*/
/* Heap and Stack size */
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
define symbol MBED_BOOT_STACK_SIZE = 0x400;
}
define symbol __ICFEDIT_size_heap__ = 0x200000;
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
define symbol __ICFEDIT_size_cstack__ = 0x400;
/**** End of ICF editor section. ###ICF###*/

define memory mem with size = 4G;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@
#include "../memory_zones.h"
#include "../cmsis_nvic.h"

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

#if (defined(__stack_size__))
#define STACK_SIZE __stack_size__
#else
#define STACK_SIZE MBED_BOOT_STACK_SIZE
#define STACK_SIZE 0x0400
#endif

; The vector table is loaded at address 0x00000000 in Flash memory region.
Expand All @@ -60,7 +56,7 @@ LR_IROM2 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
.ANY (+RO)
}
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE) { ; RW data
.ANY (+RW +ZI)
}
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ MEMORY
*/
ENTRY(Reset_Handler)

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

STACK_SIZE = MBED_BOOT_STACK_SIZE;
STACK_SIZE = 0x400;

/* Size of the vector table in SRAM */
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE

/*-Sizes-*/
/* Heap and Stack size */
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
define symbol MBED_BOOT_STACK_SIZE = 0x400;
}
define symbol __ICFEDIT_size_heap__ = 0x200000;
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
define symbol __ICFEDIT_size_cstack__ = 0x400;
/**** End of ICF editor section. ###ICF###*/

define memory mem with size = 4G;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@
#include "../memory_zones.h"
#include "../cmsis_nvic.h"

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

#if (defined(__stack_size__))
#define STACK_SIZE __stack_size__
#else
#define STACK_SIZE MBED_BOOT_STACK_SIZE
#define STACK_SIZE 0x0400
#endif

; The vector table is loaded at address 0x00000000 in Flash memory region.
Expand All @@ -60,7 +56,7 @@ LR_IROM2 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
.ANY (+RO)
}
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE) { ; RW data
.ANY (+RW +ZI)
}
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ MEMORY
*/
ENTRY(Reset_Handler)

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

STACK_SIZE = MBED_BOOT_STACK_SIZE;
STACK_SIZE = 0x400;

/* Size of the vector table in SRAM */
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE

/*-Sizes-*/
/* Heap and Stack size */
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
define symbol MBED_BOOT_STACK_SIZE = 0x400;
}
define symbol __ICFEDIT_size_heap__ = 0x200000;
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
define symbol __ICFEDIT_size_cstack__ = 0x400;
/**** End of ICF editor section. ###ICF###*/

define memory mem with size = 4G;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@
#include "../memory_zones.h"
#include "../cmsis_nvic.h"

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

#if (defined(__stack_size__))
#define STACK_SIZE __stack_size__
#else
#define STACK_SIZE MBED_BOOT_STACK_SIZE
#define STACK_SIZE 0x0400
#endif

; The vector table is loaded at address 0x00000000 in Flash memory region.
Expand All @@ -60,7 +56,7 @@ LR_IROM2 ZBT_SRAM1_START ZBT_SRAM1_SIZE { ; load region size_region
.ANY (+RO)
}
; NVIC_VECTORS_SIZE Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE - STACK_SIZE) { ; RW data
RW_IRAM1 (ZBT_SRAM2_START + NVIC_VECTORS_SIZE) (ZBT_SRAM2_SIZE - NVIC_VECTORS_SIZE) { ; RW data
.ANY (+RW +ZI)
}
ARM_LIB_STACK (ZBT_SRAM2_START + ZBT_SRAM2_SIZE) EMPTY - STACK_SIZE { ; Stack region growing down
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
#include "../memory_zones.h"
#include "../cmsis_nvic.h"

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

MEMORY
{
VECTORS (rx) : ORIGIN = MAPPABLE_START, LENGTH = MAPPABLE_SIZE
Expand Down Expand Up @@ -70,7 +66,7 @@ MEMORY
*/
ENTRY(Reset_Handler)

STACK_SIZE = MBED_BOOT_STACK_SIZE;
STACK_SIZE = 0x400;

/* Size of the vector table in SRAM */
M_VECTOR_RAM_SIZE = NVIC_VECTORS_SIZE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ define symbol __ICFEDIT_region_RAM_end__ = ZBT_SRAM2_START + ZBT_SRAM2_SIZE

/*-Sizes-*/
/* Heap and Stack size */
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
define symbol MBED_BOOT_STACK_SIZE = 0x400;
}
define symbol __ICFEDIT_size_heap__ = 0x200000;
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
define symbol __ICFEDIT_size_cstack__ = 0x400;
/**** End of ICF editor section. ###ICF###*/

define memory mem with size = 4G;
Expand Down
Loading