File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -477,7 +477,7 @@ void gc_collect(void) {
477
477
478
478
// This naively collects all object references from an approximate stack
479
479
// range.
480
- gc_collect_root ((void * * )sp , ((uint32_t )& _estack - sp ) / sizeof (uint32_t ));
480
+ gc_collect_root ((void * * )sp , ((uint32_t )port_stack_get_top () - sp ) / sizeof (uint32_t ));
481
481
gc_collect_end ();
482
482
}
483
483
Original file line number Diff line number Diff line change 25
25
*/
26
26
27
27
#include "supervisor/memory.h"
28
+ #include "supervisor/port.h"
28
29
29
30
#include <stddef.h>
30
31
@@ -36,12 +37,10 @@ static supervisor_allocation allocations[CIRCUITPY_SUPERVISOR_ALLOC_COUNT];
36
37
// We use uint32_t* to ensure word (4 byte) alignment.
37
38
uint32_t * low_address ;
38
39
uint32_t * high_address ;
39
- extern uint32_t _ebss ;
40
- extern uint32_t _estack ;
41
40
42
41
void memory_init (void ) {
43
- low_address = & _ebss ;
44
- high_address = & _estack ;
42
+ low_address = port_stack_get_limit () ;
43
+ high_address = port_stack_get_top () ;
45
44
}
46
45
47
46
void free_memory (supervisor_allocation * allocation ) {
Original file line number Diff line number Diff line change 29
29
#include "py/mpconfig.h"
30
30
#include "py/runtime.h"
31
31
#include "supervisor/cpu.h"
32
+ #include "supervisor/port.h"
32
33
#include "supervisor/shared/safe_mode.h"
33
34
34
35
extern uint32_t _estack ;
@@ -43,7 +44,7 @@ void allocate_stack(void) {
43
44
mp_uint_t regs [10 ];
44
45
mp_uint_t sp = cpu_get_regs_and_sp (regs );
45
46
46
- mp_uint_t c_size = (uint32_t ) & _estack - sp ;
47
+ mp_uint_t c_size = (uint32_t ) port_stack_get_top () - sp ;
47
48
48
49
stack_alloc = allocate_memory (c_size + next_stack_size + EXCEPTION_STACK_SIZE , true);
49
50
if (stack_alloc == NULL ) {
You can’t perform that action at this time.
0 commit comments