Add header for PLACE_IN_ITCM

This commit is contained in:
Jeff Epler 2023-09-20 11:19:57 -05:00
parent e05f79a9c0
commit 0c64275cc6
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
10 changed files with 27 additions and 7 deletions

View File

@ -24,3 +24,5 @@ numer
arithmetics arithmetics
ftbfs ftbfs
straightaway straightaway
ftbs
ftb

View File

@ -27,6 +27,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include "supervisor/linker.h" // PLACE_IN_ITCM
#include "py/runtime.h" #include "py/runtime.h"
void PLACE_IN_ITCM(mp_arg_check_num_sig)(size_t n_args, size_t n_kw, uint32_t sig) { void PLACE_IN_ITCM(mp_arg_check_num_sig)(size_t n_args, size_t n_kw, uint32_t sig) {

16
py/gc.c
View File

@ -29,6 +29,8 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "supervisor/linker.h" // CIRCUITPY: PLACE_IN_ITCM
#include "py/gc.h" #include "py/gc.h"
#include "py/runtime.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. // 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 // CIRCUITPY: We don't instrument these functions because they occur a lot during GC and
#if MICROPY_GC_SPLIT_HEAP #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 #else
STATIC void MP_NO_INSTRUMENT PLACE_IN_ITCM(gc_mark_subtree)(size_t block) STATIC void MP_NO_INSTRUMENT PLACE_IN_ITCM(gc_mark_subtree)(size_t block)
#endif #endif
@ -615,11 +617,11 @@ void gc_info(gc_info_t *info) {
} }
bool gc_alloc_possible(void) { bool gc_alloc_possible(void) {
#if MICROPY_GC_SPLIT_HEAP #if MICROPY_GC_SPLIT_HEAP
return MP_STATE_MEM(gc_last_free_area) != 0; return MP_STATE_MEM(gc_last_free_area) != 0;
#else #else
area = &MP_STATE_MEM(area) != 0; return MP_STATE_MEM(area).gc_pool_start != 0;
#endif #endif
} }
void *gc_alloc(size_t n_bytes, unsigned int alloc_flags) { void *gc_alloc(size_t n_bytes, unsigned int alloc_flags) {
@ -774,7 +776,7 @@ found:
#if CIRCUITPY_MEMORYMONITOR #if CIRCUITPY_MEMORYMONITOR
memorymonitor_track_allocation(end_block - start_block + 1); memorymonitor_track_allocation(end_block - start_block + 1);
#endif #endif
return ret_ptr; return ret_ptr;
} }

View File

@ -29,6 +29,8 @@
#include <stdarg.h> #include <stdarg.h>
#include <assert.h> #include <assert.h>
#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_TCM
#include "shared/runtime/interrupt_char.h" #include "shared/runtime/interrupt_char.h"
#include "py/obj.h" #include "py/obj.h"
#include "py/objtype.h" #include "py/objtype.h"

View File

@ -28,6 +28,8 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_ITCM
#include "py/runtime.h" #include "py/runtime.h"
#include "py/builtin.h" #include "py/builtin.h"
#include "py/objtype.h" #include "py/objtype.h"

View File

@ -28,6 +28,8 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_ITCM
#include "py/objtuple.h" #include "py/objtuple.h"
#include "py/objfun.h" #include "py/objfun.h"
#include "py/runtime.h" #include "py/runtime.h"

View File

@ -27,6 +27,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include "supervisor/linker.h" // CIRUCITPY: PLACE_IN_ITCM
#include "py/nlr.h" #include "py/nlr.h"
#include "py/objproperty.h" #include "py/objproperty.h"
#include "py/runtime.h" #include "py/runtime.h"

View File

@ -28,6 +28,8 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include "supervisor/linker.h" // CIRCUITPY: PLACE_IN_ITCM
#include "py/mpstate.h" #include "py/mpstate.h"
#include "py/qstr.h" #include "py/qstr.h"
#include "py/gc.h" #include "py/gc.h"

View File

@ -31,6 +31,8 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "supervisor/linker.h" // PLACE_IN_ITCM
#include "py/parsenum.h" #include "py/parsenum.h"
#include "py/compile.h" #include "py/compile.h"
#include "py/objstr.h" #include "py/objstr.h"

View File

@ -24,6 +24,8 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "supervisor/linker.h" // PLACE_IN_ITCM
#include "py/runtime.h" #include "py/runtime.h"
#include "py/stackctrl.h" #include "py/stackctrl.h"