mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 11:40:18 +01:00
all: Factor gchelper code to one place and use it for unix & ARM ports.
No functionality change is intended with this commit, it just consolidates the separate implementations of GC helper code to the lib/utils/ directory as a general set of helper functions useful for any port. This reduces duplication of code, and makes it easier for future ports or embedders to get the GC implementation correct. Ports should now link against gchelper_native.c and either gchelper_m0.s or gchelper_m3.s (currently only Cortex-M is supported but other architectures can follow), or use the fallback gchelper_generic.c which will work on x86/x64/ARM. The gc_helper_get_sp function from gchelper_m3.s is not really GC related and was only used by cc3200, so it has been moved to that port and renamed to cortex_m3_get_sp.
This commit is contained in:
committed by
Damien George
parent
2e3c42775a
commit
710426024a
@@ -97,14 +97,9 @@ extern const struct _mp_obj_module_t mp_module_os;
|
||||
// Do not change anything beyond this line
|
||||
//////////////////////////////////////////
|
||||
|
||||
// Define to 1 to use undertested inefficient GC helper implementation
|
||||
// (if more efficient arch-specific one is not available).
|
||||
#ifndef MICROPY_GCREGS_SETJMP
|
||||
#ifdef __mips__
|
||||
#define MICROPY_GCREGS_SETJMP (1)
|
||||
#else
|
||||
#define MICROPY_GCREGS_SETJMP (0)
|
||||
#endif
|
||||
#if !defined(__x86_64__) || !defined(__i386__) || !defined(__thumb2__) || !defined(__thumb__) || !defined(__arm__)
|
||||
// Fall back to setjmp() implementation for discovery of GC pointers in registers.
|
||||
#define MICROPY_GCREGS_SETJMP (1)
|
||||
#endif
|
||||
|
||||
// type definitions for the specific machine
|
||||
|
||||
Reference in New Issue
Block a user