mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
feat(core/emulator): build emulator with -DSTATIC=
This is perhaps a cleaner way to expose all relevant structures for memory analysis.
This commit is contained in:
parent
f67544d27a
commit
fe6c131b14
@ -325,7 +325,12 @@ SOURCE_UNIX = [
|
|||||||
|
|
||||||
SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_UNIX
|
SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_UNIX
|
||||||
|
|
||||||
env = Environment(ENV=os.environ, CFLAGS='%s -DPYOPT=%s -DBITCOIN_ONLY=%s' % (ARGUMENTS.get('CFLAGS', ''), PYOPT, BITCOIN_ONLY))
|
if PYOPT == '0' or not FROZEN:
|
||||||
|
STATIC="-DSTATIC="
|
||||||
|
else:
|
||||||
|
STATIC=""
|
||||||
|
|
||||||
|
env = Environment(ENV=os.environ, CFLAGS='%s -DPYOPT=%s -DBITCOIN_ONLY=%s %s' % (ARGUMENTS.get('CFLAGS', ''), PYOPT, BITCOIN_ONLY, STATIC))
|
||||||
|
|
||||||
env.Tool('micropython')
|
env.Tool('micropython')
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "memzero.h"
|
#include "memzero.h"
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
|
|
||||||
STATIC secbool wrapped_ui_wait_callback(uint32_t wait, uint32_t progress,
|
static secbool wrapped_ui_wait_callback(uint32_t wait, uint32_t progress,
|
||||||
const char *message) {
|
const char *message) {
|
||||||
if (mp_obj_is_callable(MP_STATE_VM(trezorconfig_ui_wait_callback))) {
|
if (mp_obj_is_callable(MP_STATE_VM(trezorconfig_ui_wait_callback))) {
|
||||||
mp_obj_t args[3] = {0};
|
mp_obj_t args[3] = {0};
|
||||||
|
@ -113,9 +113,9 @@ STATIC mp_obj_t mod_trezorcrypto_bip39_check(mp_obj_t mnemonic) {
|
|||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_trezorcrypto_bip39_check_obj,
|
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_trezorcrypto_bip39_check_obj,
|
||||||
mod_trezorcrypto_bip39_check);
|
mod_trezorcrypto_bip39_check);
|
||||||
|
|
||||||
STATIC mp_obj_t ui_wait_callback = mp_const_none;
|
static mp_obj_t ui_wait_callback = mp_const_none;
|
||||||
|
|
||||||
STATIC void wrapped_ui_wait_callback(uint32_t current, uint32_t total) {
|
static void wrapped_ui_wait_callback(uint32_t current, uint32_t total) {
|
||||||
if (mp_obj_is_callable(ui_wait_callback)) {
|
if (mp_obj_is_callable(ui_wait_callback)) {
|
||||||
mp_call_function_2_protected(ui_wait_callback, mp_obj_new_int(current),
|
mp_call_function_2_protected(ui_wait_callback, mp_obj_new_int(current),
|
||||||
mp_obj_new_int(total));
|
mp_obj_new_int(total));
|
||||||
|
@ -63,13 +63,13 @@ STATIC const mp_obj_type_t mod_trezorcrypto_monero_hasher_type;
|
|||||||
#define MP_OBJ_C_SCALAR(o) (MP_OBJ_PTR_MPC_SCALAR(o)->p)
|
#define MP_OBJ_C_SCALAR(o) (MP_OBJ_PTR_MPC_SCALAR(o)->p)
|
||||||
#define MP_OBJ_SCALAR(o) (MP_OBJ_PTR_MP_SCALAR(o)->p)
|
#define MP_OBJ_SCALAR(o) (MP_OBJ_PTR_MP_SCALAR(o)->p)
|
||||||
|
|
||||||
STATIC inline void assert_ge25519(const mp_obj_t o) {
|
static inline void assert_ge25519(const mp_obj_t o) {
|
||||||
if (!MP_OBJ_IS_GE25519(o)) {
|
if (!MP_OBJ_IS_GE25519(o)) {
|
||||||
mp_raise_ValueError("ge25519 expected");
|
mp_raise_ValueError("ge25519 expected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC inline void assert_scalar(const mp_obj_t o) {
|
static inline void assert_scalar(const mp_obj_t o) {
|
||||||
if (!MP_OBJ_IS_SCALAR(o)) {
|
if (!MP_OBJ_IS_SCALAR(o)) {
|
||||||
mp_raise_ValueError("scalar expected");
|
mp_raise_ValueError("scalar expected");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user