From 0c64275cc6d7a7a951ba9f4a83b2067f3d2174f8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 20 Sep 2023 11:19:57 -0500 Subject: [PATCH] Add header for PLACE_IN_ITCM --- .codespell/ignore-words.txt | 2 ++ py/argcheck.c | 2 ++ py/gc.c | 16 +++++++++------- py/obj.c | 2 ++ py/objdict.c | 2 ++ py/objfun.c | 2 ++ py/objproperty.c | 2 ++ py/qstr.c | 2 ++ py/runtime.c | 2 ++ py/stackctrl.c | 2 ++ 10 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.codespell/ignore-words.txt b/.codespell/ignore-words.txt index 87abbcf8e3..fc8feaca97 100644 --- a/.codespell/ignore-words.txt +++ b/.codespell/ignore-words.txt @@ -24,3 +24,5 @@ numer arithmetics ftbfs straightaway +ftbs +ftb diff --git a/py/argcheck.c b/py/argcheck.c index db22545f64..5607cef39e 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -27,6 +27,8 @@ #include #include +#include "supervisor/linker.h" // PLACE_IN_ITCM + #include "py/runtime.h" void PLACE_IN_ITCM(mp_arg_check_num_sig)(size_t n_args, size_t n_kw, uint32_t sig) { diff --git a/py/gc.c b/py/gc.c index 603aceb5a0..5f8060d6e6 100644 --- a/py/gc.c +++ b/py/gc.c @@ -29,6 +29,8 @@ #include #include +#include "supervisor/linker.h" // CIRCUITPY: PLACE_IN_ITCM + #include "py/gc.h" #include "py/runtime.h" @@ -304,7 +306,7 @@ STATIC inline mp_state_mem_area_t *gc_get_ptr_area(const void *ptr) { // topmost block on the stack and repeat with that one. // CIRCUITPY: We don't instrument these functions because they occur a lot during GC and #if MICROPY_GC_SPLIT_HEAP -STATIC void MP_NO_INSTRUMENT PLACE_IN_ITCM(gc_mark_subtree)(mp_state_mem_area_t *area, size_t block) +STATIC void MP_NO_INSTRUMENT PLACE_IN_ITCM(gc_mark_subtree)(mp_state_mem_area_t * area, size_t block) #else STATIC void MP_NO_INSTRUMENT PLACE_IN_ITCM(gc_mark_subtree)(size_t block) #endif @@ -615,11 +617,11 @@ void gc_info(gc_info_t *info) { } bool gc_alloc_possible(void) { - #if MICROPY_GC_SPLIT_HEAP - return MP_STATE_MEM(gc_last_free_area) != 0; - #else - area = &MP_STATE_MEM(area) != 0; - #endif + #if MICROPY_GC_SPLIT_HEAP + return MP_STATE_MEM(gc_last_free_area) != 0; + #else + return MP_STATE_MEM(area).gc_pool_start != 0; + #endif } void *gc_alloc(size_t n_bytes, unsigned int alloc_flags) { @@ -774,7 +776,7 @@ found: #if CIRCUITPY_MEMORYMONITOR memorymonitor_track_allocation(end_block - start_block + 1); - #endif + #endif return ret_ptr; } diff --git a/py/obj.c b/py/obj.c index 9c1cffc728..aa109044a2 100644 --- a/py/obj.c +++ b/py/obj.c @@ -29,6 +29,8 @@ #include #include +#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_TCM + #include "shared/runtime/interrupt_char.h" #include "py/obj.h" #include "py/objtype.h" diff --git a/py/objdict.c b/py/objdict.c index 05248494ce..fa52793c92 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -28,6 +28,8 @@ #include #include +#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_ITCM + #include "py/runtime.h" #include "py/builtin.h" #include "py/objtype.h" diff --git a/py/objfun.c b/py/objfun.c index e10b79d089..52c3bd307e 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -28,6 +28,8 @@ #include #include +#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_ITCM + #include "py/objtuple.h" #include "py/objfun.h" #include "py/runtime.h" diff --git a/py/objproperty.c b/py/objproperty.c index 98011f2782..1903986603 100644 --- a/py/objproperty.c +++ b/py/objproperty.c @@ -27,6 +27,8 @@ #include #include +#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_ITCM + #include "py/nlr.h" #include "py/objproperty.h" #include "py/runtime.h" diff --git a/py/qstr.c b/py/qstr.c index 7a30892906..dbc630a0d9 100644 --- a/py/qstr.c +++ b/py/qstr.c @@ -28,6 +28,8 @@ #include #include +#include "supervisor/linker.h" // CIRCUITPY: PLACE_IN_ITCM + #include "py/mpstate.h" #include "py/qstr.h" #include "py/gc.h" diff --git a/py/runtime.c b/py/runtime.c index 1d945c4f27..1dd9ac43eb 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -31,6 +31,8 @@ #include #include +#include "supervisor/linker.h" // PLACE_IN_ITCM + #include "py/parsenum.h" #include "py/compile.h" #include "py/objstr.h" diff --git a/py/stackctrl.c b/py/stackctrl.c index fa5f16d662..475373fd24 100644 --- a/py/stackctrl.c +++ b/py/stackctrl.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#include "supervisor/linker.h" // PLACE_IN_ITCM + #include "py/runtime.h" #include "py/stackctrl.h"