Skip to content

Commit

Permalink
Add header for PLACE_IN_ITCM
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Sep 20, 2023
1 parent e05f79a commit 0c64275
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .codespell/ignore-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ numer
arithmetics
ftbfs
straightaway
ftbs
ftb
2 changes: 2 additions & 0 deletions py/argcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <stdlib.h>
#include <assert.h>

#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) {
Expand Down
16 changes: 9 additions & 7 deletions py/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <stdio.h>
#include <string.h>

#include "supervisor/linker.h" // CIRCUITPY: PLACE_IN_ITCM

#include "py/gc.h"
#include "py/runtime.h"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -774,7 +776,7 @@ void *gc_alloc(size_t n_bytes, unsigned int alloc_flags) {

#if CIRCUITPY_MEMORYMONITOR
memorymonitor_track_allocation(end_block - start_block + 1);
#endif
#endif

return ret_ptr;
}
Expand Down
2 changes: 2 additions & 0 deletions py/obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <stdarg.h>
#include <assert.h>

#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_TCM

#include "shared/runtime/interrupt_char.h"
#include "py/obj.h"
#include "py/objtype.h"
Expand Down
2 changes: 2 additions & 0 deletions py/objdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <string.h>
#include <assert.h>

#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_ITCM

#include "py/runtime.h"
#include "py/builtin.h"
#include "py/objtype.h"
Expand Down
2 changes: 2 additions & 0 deletions py/objfun.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <string.h>
#include <assert.h>

#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_ITCM

#include "py/objtuple.h"
#include "py/objfun.h"
#include "py/runtime.h"
Expand Down
2 changes: 2 additions & 0 deletions py/objproperty.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <stdlib.h>
#include <assert.h>

#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_ITCM

#include "py/nlr.h"
#include "py/objproperty.h"
#include "py/runtime.h"
Expand Down
2 changes: 2 additions & 0 deletions py/qstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <string.h>
#include <stdio.h>

#include "supervisor/linker.h" // CIRCUITPY: PLACE_IN_ITCM

#include "py/mpstate.h"
#include "py/qstr.h"
#include "py/gc.h"
Expand Down
2 changes: 2 additions & 0 deletions py/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <string.h>
#include <unistd.h>

#include "supervisor/linker.h" // PLACE_IN_ITCM

#include "py/parsenum.h"
#include "py/compile.h"
#include "py/objstr.h"
Expand Down
2 changes: 2 additions & 0 deletions py/stackctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* THE SOFTWARE.
*/

#include "supervisor/linker.h" // PLACE_IN_ITCM

#include "py/runtime.h"
#include "py/stackctrl.h"

Expand Down

0 comments on commit 0c64275

Please sign in to comment.