Skip to content

Commit b50454d

Browse files
committed
[cortex-m] Remove unused process stack size
1 parent fa44651 commit b50454d

File tree

4 files changed

+4
-19
lines changed

4 files changed

+4
-19
lines changed

src/modm/platform/core/cortex/linker.macros

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%% macro copyright()
33
/*
44
* Copyright (c) 2011-2012, 2019, Fabian Greif
5-
* Copyright (c) 2012, 2015-2021, Niklas Hauser
5+
* Copyright (c) 2012, 2015-2022, Niklas Hauser
66
* Copyright (c) 2013, Sascha Schade
77
* Copyright (c) 2013, 2015, Kevin Läufer
88
*
@@ -40,10 +40,7 @@ __{{memory.name}}_end = ORIGIN({{memory.name|upper}}) + LENGTH({{memory.name|upp
4040
%% endfor
4141
%#
4242

43-
/* The handler stack is used for main program as well as interrupts */
44-
MAIN_STACK_SIZE = {{ options[":platform:cortex-m:main_stack_size"] }};
45-
PROCESS_STACK_SIZE = {{ process_stack_size }};
46-
TOTAL_STACK_SIZE = MAIN_STACK_SIZE + PROCESS_STACK_SIZE;
43+
MAIN_STACK_SIZE = {{ options[":platform:cortex-m:main_stack_size"] }};
4744
%% endmacro
4845

4946

@@ -85,10 +82,6 @@ TOTAL_STACK_SIZE = MAIN_STACK_SIZE + PROCESS_STACK_SIZE;
8582
. = ALIGN(8);
8683
__main_stack_top = .;
8784

88-
. += PROCESS_STACK_SIZE;
89-
. = ALIGN(8);
90-
__process_stack_top = .;
91-
9285
__stack_end = .;
9386
} >{{memory}}
9487
%% endmacro

src/modm/platform/core/cortex/module.lb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def common_linkerscript(env):
123123
Computes linkerscript properties
124124
(\\* *post-build only*):
125125
126-
- `process_stack_size`: largest requested process stack size by any module
127126
- `vector_table_location`: ram or rom
128127
129128
Stripped and newline-joined collector values of:
@@ -146,8 +145,6 @@ def common_linkerscript(env):
146145
:returns: dictionary of linkerscript properties
147146
"""
148147
properties = {
149-
"process_stack_size":
150-
max(env.collector_values(":platform:cortex-m:linkerscript.process_stack_size", 0)),
151148
"vector_table_location":
152149
common_vector_table_location(env),
153150

@@ -254,11 +251,6 @@ def prepare(module, options):
254251
StringCollector(
255252
name="linkerscript.table_extern.heap",
256253
description="Additions to the linkerscript's '.table.heap' section"))
257-
module.add_collector(
258-
NumericCollector(
259-
name="linkerscript.process_stack_size",
260-
description="Maximum required size of the process stack",
261-
minimum=0))
262254

263255
module.add_query(
264256
EnvironmentQuery(name="vector_table", factory=common_vector_table))

src/modm/platform/core/cortex/ram.ld.in

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

99
%% if vector_table_location == "ram"
1010
/* Computes stack offset so that vector table is aligned */
11-
__stack_offset = ALIGN(TOTAL_STACK_SIZE, (1 << LOG2CEIL({{ highest_irq + 16 }})) * 8) - TOTAL_STACK_SIZE;
11+
__stack_offset = ALIGN(MAIN_STACK_SIZE, (1 << LOG2CEIL({{ highest_irq + 16 }})) * 8) - MAIN_STACK_SIZE;
1212
%#
1313
%% endif
1414

src/modm/platform/core/stm32/dccm.ld.in

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

99
%% if vector_table_location == "ram"
1010
/* Computes stack offset so that vector table is aligned */
11-
__stack_offset = ALIGN(TOTAL_STACK_SIZE, (1 << LOG2CEIL({{ highest_irq + 16 }})) * 8) - TOTAL_STACK_SIZE;
11+
__stack_offset = ALIGN(MAIN_STACK_SIZE, (1 << LOG2CEIL({{ highest_irq + 16 }})) * 8) - MAIN_STACK_SIZE;
1212
%#
1313
%% endif
1414

0 commit comments

Comments
 (0)