1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-21 23:18:13 +00:00

chore(vendor): bump micropython to 1.17

Relevant micropython commits:
  d1bfb271d7686708fe8711a177629c8bf6e7f6a6 lib/uzlib: Move uzlib code from extmod to lib.
  4d546713ec8858cbf908de45de11cbfc46a20971 shared: Introduce new top-level dir and move 1st party lib code there.
  ca920f72184c50f61002aa9d5cd01555b1e28b7b py/mpstate: Make exceptions thread-local.
This commit is contained in:
Martin Milata 2021-09-09 20:26:10 +02:00 committed by matejcik
parent 7111702f00
commit aace875fef
12 changed files with 43 additions and 42 deletions

View File

@ -0,0 +1 @@
Updated micropython to version 1.17.

View File

@ -34,7 +34,7 @@ SOURCE_MOD += [
# modtrezorui # modtrezorui
CPPPATH_MOD += [ CPPPATH_MOD += [
'vendor/micropython/extmod/uzlib', 'vendor/micropython/lib/uzlib',
] ]
SOURCE_MOD += [ SOURCE_MOD += [
'embed/extmod/modtrezorui/display.c', 'embed/extmod/modtrezorui/display.c',

View File

@ -37,7 +37,7 @@ SOURCE_MOD += [
# modtrezorui # modtrezorui
CPPPATH_MOD += [ CPPPATH_MOD += [
'vendor/micropython/extmod/uzlib', 'vendor/micropython/lib/uzlib',
] ]
CPPDEFINES_MOD += [ CPPDEFINES_MOD += [
'TREZOR_FONT_NORMAL_ENABLE', 'TREZOR_FONT_NORMAL_ENABLE',
@ -48,9 +48,9 @@ SOURCE_MOD += [
'embed/extmod/modtrezorui/font_bitmap.c', 'embed/extmod/modtrezorui/font_bitmap.c',
'embed/extmod/modtrezorui/font_roboto_regular_20.c', 'embed/extmod/modtrezorui/font_roboto_regular_20.c',
'embed/extmod/modtrezorui/font_robotomono_regular_20.c', 'embed/extmod/modtrezorui/font_robotomono_regular_20.c',
'vendor/micropython/extmod/uzlib/adler32.c', 'vendor/micropython/lib/uzlib/adler32.c',
'vendor/micropython/extmod/uzlib/crc32.c', 'vendor/micropython/lib/uzlib/crc32.c',
'vendor/micropython/extmod/uzlib/tinflate.c', 'vendor/micropython/lib/uzlib/tinflate.c',
] ]
SOURCE_STMHAL = [ SOURCE_STMHAL = [

View File

@ -37,7 +37,7 @@ SOURCE_MOD += [
# modtrezorui # modtrezorui
CPPPATH_MOD += [ CPPPATH_MOD += [
'vendor/micropython/extmod/uzlib', 'vendor/micropython/lib/uzlib',
] ]
CPPDEFINES_MOD += [ CPPDEFINES_MOD += [
'TREZOR_FONT_NORMAL_ENABLE', 'TREZOR_FONT_NORMAL_ENABLE',
@ -48,9 +48,9 @@ SOURCE_MOD += [
'embed/extmod/modtrezorui/font_bitmap.c', 'embed/extmod/modtrezorui/font_bitmap.c',
'embed/extmod/modtrezorui/font_roboto_regular_20.c', 'embed/extmod/modtrezorui/font_roboto_regular_20.c',
'embed/extmod/modtrezorui/font_robotomono_regular_20.c', 'embed/extmod/modtrezorui/font_robotomono_regular_20.c',
'vendor/micropython/extmod/uzlib/adler32.c', 'vendor/micropython/lib/uzlib/adler32.c',
'vendor/micropython/extmod/uzlib/crc32.c', 'vendor/micropython/lib/uzlib/crc32.c',
'vendor/micropython/extmod/uzlib/tinflate.c', 'vendor/micropython/lib/uzlib/tinflate.c',
] ]
SOURCE_STMHAL = [ SOURCE_STMHAL = [

View File

@ -149,7 +149,7 @@ if TREZOR_MODEL == "T":
# modtrezorui # modtrezorui
CPPPATH_MOD += [ CPPPATH_MOD += [
'vendor/micropython/extmod/uzlib', 'vendor/micropython/lib/uzlib',
] ]
CPPDEFINES_MOD += [ CPPDEFINES_MOD += [
'TREZOR_FONT_BOLD_ENABLE', 'TREZOR_FONT_BOLD_ENABLE',
@ -167,9 +167,9 @@ SOURCE_MOD += [
'embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c', 'embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c',
'embed/extmod/modtrezorui/modtrezorui.c', 'embed/extmod/modtrezorui/modtrezorui.c',
'embed/extmod/modtrezorui/qr-code-generator/qrcodegen.c', 'embed/extmod/modtrezorui/qr-code-generator/qrcodegen.c',
'vendor/micropython/extmod/uzlib/adler32.c', 'vendor/micropython/lib/uzlib/adler32.c',
'vendor/micropython/extmod/uzlib/crc32.c', 'vendor/micropython/lib/uzlib/crc32.c',
'vendor/micropython/extmod/uzlib/tinflate.c', 'vendor/micropython/lib/uzlib/tinflate.c',
] ]
# modtrezorutils # modtrezorutils
@ -193,14 +193,14 @@ SOURCE_MICROPYTHON = [
'vendor/micropython/extmod/moduheapq.c', 'vendor/micropython/extmod/moduheapq.c',
'vendor/micropython/extmod/modutimeq.c', 'vendor/micropython/extmod/modutimeq.c',
'vendor/micropython/extmod/utime_mphal.c', 'vendor/micropython/extmod/utime_mphal.c',
'vendor/micropython/lib/embed/abort_.c', 'vendor/micropython/shared/libc/abort_.c',
#'vendor/micropython/lib/mp-readline/readline.c', 'vendor/micropython/shared/libc/printf.c',
'vendor/micropython/lib/utils/gchelper_m3.s', #'vendor/micropython/shared/readline/readline.c',
'vendor/micropython/lib/utils/gchelper_native.c', 'vendor/micropython/shared/runtime/gchelper_m3.s',
'vendor/micropython/lib/utils/interrupt_char.c', 'vendor/micropython/shared/runtime/gchelper_native.c',
'vendor/micropython/lib/utils/printf.c', 'vendor/micropython/shared/runtime/interrupt_char.c',
'vendor/micropython/lib/utils/pyexec.c', 'vendor/micropython/shared/runtime/pyexec.c',
'vendor/micropython/lib/utils/stdout_helpers.c', 'vendor/micropython/shared/runtime/stdout_helpers.c',
'vendor/micropython/ports/stm32/gccollect.c', 'vendor/micropython/ports/stm32/gccollect.c',
'vendor/micropython/ports/stm32/pendsv.c', 'vendor/micropython/ports/stm32/pendsv.c',
'vendor/micropython/ports/stm32/softtimer.c', 'vendor/micropython/ports/stm32/softtimer.c',

View File

@ -23,7 +23,7 @@ SOURCE_MOD += [
# modtrezorui # modtrezorui
CPPPATH_MOD += [ CPPPATH_MOD += [
'vendor/micropython/extmod/uzlib', 'vendor/micropython/lib/uzlib',
] ]
CPPDEFINES_MOD += [ CPPDEFINES_MOD += [
'TREZOR_FONT_BOLD_ENABLE', 'TREZOR_FONT_BOLD_ENABLE',
@ -33,9 +33,9 @@ SOURCE_MOD += [
'embed/extmod/modtrezorui/font_bitmap.c', 'embed/extmod/modtrezorui/font_bitmap.c',
'embed/extmod/modtrezorui/font_roboto_bold_20.c', 'embed/extmod/modtrezorui/font_roboto_bold_20.c',
'embed/extmod/modtrezorui/qr-code-generator/qrcodegen.c', 'embed/extmod/modtrezorui/qr-code-generator/qrcodegen.c',
'vendor/micropython/extmod/uzlib/adler32.c', 'vendor/micropython/lib/uzlib/adler32.c',
'vendor/micropython/extmod/uzlib/crc32.c', 'vendor/micropython/lib/uzlib/crc32.c',
'vendor/micropython/extmod/uzlib/tinflate.c', 'vendor/micropython/lib/uzlib/tinflate.c',
] ]
SOURCE_STMHAL = [ SOURCE_STMHAL = [

View File

@ -19,7 +19,7 @@ SOURCE_MOD += [
# modtrezorui # modtrezorui
CPPPATH_MOD += [ CPPPATH_MOD += [
'vendor/micropython/extmod/uzlib', 'vendor/micropython/lib/uzlib',
] ]
CPPDEFINES_MOD += [ CPPDEFINES_MOD += [
'TREZOR_FONT_BOLD_ENABLE', 'TREZOR_FONT_BOLD_ENABLE',
@ -28,9 +28,9 @@ SOURCE_MOD += [
'embed/extmod/modtrezorui/display.c', 'embed/extmod/modtrezorui/display.c',
'embed/extmod/modtrezorui/font_bitmap.c', 'embed/extmod/modtrezorui/font_bitmap.c',
'embed/extmod/modtrezorui/font_roboto_bold_20.c', 'embed/extmod/modtrezorui/font_roboto_bold_20.c',
'vendor/micropython/extmod/uzlib/adler32.c', 'vendor/micropython/lib/uzlib/adler32.c',
'vendor/micropython/extmod/uzlib/crc32.c', 'vendor/micropython/lib/uzlib/crc32.c',
'vendor/micropython/extmod/uzlib/tinflate.c', 'vendor/micropython/lib/uzlib/tinflate.c',
] ]
SOURCE_STMHAL = [ SOURCE_STMHAL = [

View File

@ -144,7 +144,7 @@ if TREZOR_MODEL == "T":
# modtrezorui # modtrezorui
CPPPATH_MOD += [ CPPPATH_MOD += [
'vendor/micropython/extmod/uzlib', 'vendor/micropython/lib/uzlib',
] ]
CPPDEFINES_MOD += [ CPPDEFINES_MOD += [
'TREZOR_FONT_BOLD_ENABLE', 'TREZOR_FONT_BOLD_ENABLE',
@ -162,9 +162,9 @@ SOURCE_MOD += [
'embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c', 'embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c',
'embed/extmod/modtrezorui/modtrezorui.c', 'embed/extmod/modtrezorui/modtrezorui.c',
'embed/extmod/modtrezorui/qr-code-generator/qrcodegen.c', 'embed/extmod/modtrezorui/qr-code-generator/qrcodegen.c',
'vendor/micropython/extmod/uzlib/adler32.c', 'vendor/micropython/lib/uzlib/adler32.c',
'vendor/micropython/extmod/uzlib/crc32.c', 'vendor/micropython/lib/uzlib/crc32.c',
'vendor/micropython/extmod/uzlib/tinflate.c', 'vendor/micropython/lib/uzlib/tinflate.c',
] ]
if FROZEN: if FROZEN:
CPPDEFINES_MOD += ['TREZOR_EMULATOR_FROZEN'] CPPDEFINES_MOD += ['TREZOR_EMULATOR_FROZEN']
@ -190,7 +190,7 @@ SOURCE_MICROPYTHON = [
'vendor/micropython/extmod/moduheapq.c', 'vendor/micropython/extmod/moduheapq.c',
'vendor/micropython/extmod/modutimeq.c', 'vendor/micropython/extmod/modutimeq.c',
'vendor/micropython/extmod/utime_mphal.c', 'vendor/micropython/extmod/utime_mphal.c',
'vendor/micropython/lib/mp-readline/readline.c', 'vendor/micropython/shared/readline/readline.c',
'vendor/micropython/ports/unix/modos.c', 'vendor/micropython/ports/unix/modos.c',
'vendor/micropython/py/argcheck.c', 'vendor/micropython/py/argcheck.c',
'vendor/micropython/py/asmarm.c', 'vendor/micropython/py/asmarm.c',
@ -317,7 +317,7 @@ SOURCE_UNIX = [
'embed/unix/rng.c', 'embed/unix/rng.c',
'embed/unix/touch.c', 'embed/unix/touch.c',
'embed/unix/usb.c', 'embed/unix/usb.c',
'vendor/micropython/lib/utils/gchelper_generic.c', 'vendor/micropython/shared/runtime/gchelper_generic.c',
'vendor/micropython/ports/unix/alloc.c', 'vendor/micropython/ports/unix/alloc.c',
'vendor/micropython/ports/unix/gccollect.c', 'vendor/micropython/ports/unix/gccollect.c',
'vendor/micropython/ports/unix/input.c', 'vendor/micropython/ports/unix/input.c',

View File

@ -23,7 +23,6 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "lib/utils/pyexec.h"
#include "py/compile.h" #include "py/compile.h"
#include "py/gc.h" #include "py/gc.h"
#include "py/mperrno.h" #include "py/mperrno.h"
@ -31,6 +30,7 @@
#include "py/repl.h" #include "py/repl.h"
#include "py/runtime.h" #include "py/runtime.h"
#include "py/stackctrl.h" #include "py/stackctrl.h"
#include "shared/runtime/pyexec.h"
#include "ports/stm32/gccollect.h" #include "ports/stm32/gccollect.h"
#include "ports/stm32/pendsv.h" #include "ports/stm32/pendsv.h"

View File

@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "lib/utils/interrupt_char.h" #include "shared/runtime/interrupt_char.h"
static inline mp_uint_t mp_hal_ticks_cpu(void) { return 0; } static inline mp_uint_t mp_hal_ticks_cpu(void) { return 0; }

View File

@ -140,9 +140,9 @@ STATIC int execute_from_lexer(int source_kind, const void *source,
// execute it // execute it
mp_call_function_0(module_fun); mp_call_function_0(module_fun);
// check for pending exception // check for pending exception
if (MP_STATE_VM(mp_pending_exception) != MP_OBJ_NULL) { if (MP_STATE_MAIN_THREAD(mp_pending_exception) != MP_OBJ_NULL) {
mp_obj_t obj = MP_STATE_VM(mp_pending_exception); mp_obj_t obj = MP_STATE_MAIN_THREAD(mp_pending_exception);
MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; MP_STATE_MAIN_THREAD(mp_pending_exception) = MP_OBJ_NULL;
nlr_raise(obj); nlr_raise(obj);
} }
} }
@ -159,7 +159,7 @@ STATIC int execute_from_lexer(int source_kind, const void *source,
} }
#if MICROPY_USE_READLINE == 1 #if MICROPY_USE_READLINE == 1
#include "lib/mp-readline/readline.h" #include "shared/readline/readline.h"
#else #else
STATIC char *strjoin(const char *s1, int sep_char, const char *s2) { STATIC char *strjoin(const char *s1, int sep_char, const char *s2) {
int l1 = strlen(s1); int l1 = strlen(s1);

2
vendor/micropython vendored

@ -1 +1 @@
Subproject commit c0013200d9a951276b6706616cfeb910ac9afb34 Subproject commit fce614cbe213e3f6c9e1a2a9634d2c1edae7c57b