diff options
| author | Kamil Tomaszewski <kamil.tomaszewski@sony.com> | 2019-10-18 11:05:08 +0200 |
|---|---|---|
| committer | Kamil Tomaszewski <kamil.tomaszewski@sony.com> | 2019-10-18 11:05:08 +0200 |
| commit | f3151bb6c4adac5ed9cf03d3977ab6d9662c0e05 (patch) | |
| tree | 29817229b386ff0e018369becac89438727a1cb5 /supervisor/shared/stack.c | |
| parent | 96756b3945ec3388986c7ebda8b924aeb42cd7fb (diff) | |
Use get top and limit stack functions
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) { |
