summaryrefslogtreecommitdiff
path: root/supervisor/shared/stack.c
diff options
context:
space:
mode:
authorJoe Bakalor <jmbakalor@gmail.com>2019-11-05 11:06:18 -0500
committerGitHub <noreply@github.com>2019-11-05 11:06:18 -0500
commitba83a4a2ac815e76cd752db05e3269450021954e (patch)
tree611864e312d825c2abb85df4d3a9cb88aa382faa /supervisor/shared/stack.c
parent8ab3ef44dddbb82d623dd557461b2b77cf607283 (diff)
parent01bf9321692d00da8628b7b230be3b03665eff82 (diff)
Merge pull request #1 from adafruit/master
Update base
Diffstat (limited to 'supervisor/shared/stack.c')
-rwxr-xr-xsupervisor/shared/stack.c3
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) {