mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
py/persistentcode: Add ability to relocate loaded native code.
Implements text, rodata and bss generalised relocations, as well as generic qstr-object linking. This allows importing dynamic native modules on all supported architectures in a unified way.
This commit is contained in:
@@ -28,13 +28,17 @@
|
||||
|
||||
// The first four must fit in 8 bits, see emitbc.c
|
||||
// The remaining must fit in 16 bits, see scope.h
|
||||
#define MP_SCOPE_FLAG_ALL_SIG (0x0f)
|
||||
#define MP_SCOPE_FLAG_GENERATOR (0x01)
|
||||
#define MP_SCOPE_FLAG_VARKEYWORDS (0x02)
|
||||
#define MP_SCOPE_FLAG_VARARGS (0x04)
|
||||
#define MP_SCOPE_FLAG_DEFKWARGS (0x08)
|
||||
#define MP_SCOPE_FLAG_REFGLOBALS (0x10) // used only if native emitter enabled
|
||||
#define MP_SCOPE_FLAG_HASCONSTS (0x20) // used only if native emitter enabled
|
||||
#define MP_SCOPE_FLAG_VIPERRET_POS (6) // 3 bits used for viper return type
|
||||
#define MP_SCOPE_FLAG_VIPERRET_POS (6) // 3 bits used for viper return type, to pass from compiler to native emitter
|
||||
#define MP_SCOPE_FLAG_VIPERRELOC (0x10) // used only when loading viper from .mpy
|
||||
#define MP_SCOPE_FLAG_VIPERRODATA (0x20) // used only when loading viper from .mpy
|
||||
#define MP_SCOPE_FLAG_VIPERBSS (0x40) // used only when loading viper from .mpy
|
||||
|
||||
// types for native (viper) function signature
|
||||
#define MP_NATIVE_TYPE_OBJ (0x00)
|
||||
|
||||
Reference in New Issue
Block a user