diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2020-01-08 20:32:45 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2020-01-17 17:36:08 -0800 |
| commit | 7d8dac9211dab92d750a0351335b4ad3fffc05e2 (patch) | |
| tree | 819d63e5495931042b433e2b67eee9848bf47ec1 /supervisor/shared/stack.c | |
| parent | 85c731734a0388c28c8e3895ec1cecd1d9491e0c (diff) | |
Refine iMX RT memory layout and add three boards
Introduces a way to place CircuitPython code and data into
tightly coupled memory (TCM) which is accessible by the CPU in a
single cycle. It also frees up room in the corresponding cache for
intermittent data. Loading from external flash is slow!
The data cache is also now enabled.
Adds support for the iMX RT 1021 chip. Adds three new boards:
* iMX RT 1020 EVK
* iMX RT 1060 EVK
* Teensy 4.0
Related to #2492, #2472 and #2477. Fixes #2475.
Diffstat (limited to 'supervisor/shared/stack.c')
| -rwxr-xr-x | supervisor/shared/stack.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/supervisor/shared/stack.c b/supervisor/shared/stack.c index dcecf2067..2b7b1c03a 100755 --- a/supervisor/shared/stack.c +++ b/supervisor/shared/stack.c @@ -46,6 +46,10 @@ void allocate_stack(void) { mp_uint_t c_size = (uint32_t) port_stack_get_top() - sp; + if (port_stack_get_top() != port_heap_get_top()) { + return; + } + stack_alloc = allocate_memory(c_size + next_stack_size + EXCEPTION_STACK_SIZE, true); if (stack_alloc == NULL) { stack_alloc = allocate_memory(c_size + CIRCUITPY_DEFAULT_STACK_SIZE + EXCEPTION_STACK_SIZE, true); @@ -71,6 +75,9 @@ void stack_init(void) { } void stack_resize(void) { + if (stack_alloc == NULL) { + return; + } if (next_stack_size == current_stack_size) { *stack_alloc->ptr = STACK_CANARY_VALUE; return; |
