diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2019-10-18 10:41:00 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-18 10:41:00 -0700 |
| commit | 98e7579dee646b340c20613342b3472690a38c73 (patch) | |
| tree | d2e2345ce0e223fb478f221c0de0367d948dec33 /supervisor/shared/stack.c | |
| parent | bd6c7c5546a16bed74c19ef615728b5e9032a4ad (diff) | |
| parent | e2cb29f2a0ca07c8b8b089675969e11d62cd13ac (diff) | |
Merge pull request #2230 from kamtom480/circuitpython-stack
Top and limit stack addresses
Diffstat (limited to 'supervisor/shared/stack.c')
| -rwxr-xr-x | supervisor/shared/stack.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/supervisor/shared/stack.c b/supervisor/shared/stack.c index 311fa31b2..dcecf2067 100755 --- a/supervisor/shared/stack.c +++ b/supervisor/shared/stack.c @@ -29,6 +29,7 @@ #include "py/mpconfig.h" #include "py/runtime.h" #include "supervisor/cpu.h" +#include "supervisor/port.h" #include "supervisor/shared/safe_mode.h" extern uint32_t _estack; @@ -43,7 +44,7 @@ void allocate_stack(void) { mp_uint_t regs[10]; mp_uint_t sp = cpu_get_regs_and_sp(regs); - mp_uint_t c_size = (uint32_t) &_estack - sp; + mp_uint_t c_size = (uint32_t) port_stack_get_top() - sp; stack_alloc = allocate_memory(c_size + next_stack_size + EXCEPTION_STACK_SIZE, true); if (stack_alloc == NULL) { |
