From a247b4e87aca785e975cb044ba3689701d0a5f2d Mon Sep 17 00:00:00 2001 From: cepetr Date: Wed, 2 Oct 2024 13:38:45 +0200 Subject: [PATCH] refactor(core): rename reboot to reboot_device [no changelog] --- core/embed/bootloader/main.c | 2 +- core/embed/extmod/modtrezorutils/modtrezorutils.c | 2 +- core/embed/prodtest/main.c | 2 +- core/embed/trezorhal/bootutils.h | 2 +- core/embed/trezorhal/stm32f4/bootutils.c | 2 +- core/embed/trezorhal/stm32f4/syscall_dispatch.c | 4 ++-- core/embed/trezorhal/stm32f4/syscall_numbers.h | 2 +- core/embed/trezorhal/stm32f4/syscall_stubs.c | 4 ++-- core/embed/trezorhal/stm32u5/secret.c | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/embed/bootloader/main.c b/core/embed/bootloader/main.c index d076a54ba2..3409fdf630 100644 --- a/core/embed/bootloader/main.c +++ b/core/embed/bootloader/main.c @@ -346,7 +346,7 @@ void real_jump_to_firmware(void) { __attribute__((noreturn)) void jump_to_fw_through_reset(void) { display_fade(display_backlight(-1), 0, 200); - reboot(); + reboot_device(); } #endif diff --git a/core/embed/extmod/modtrezorutils/modtrezorutils.c b/core/embed/extmod/modtrezorutils/modtrezorutils.c index c77ed28373..21444bc5a7 100644 --- a/core/embed/extmod/modtrezorutils/modtrezorutils.c +++ b/core/embed/extmod/modtrezorutils/modtrezorutils.c @@ -277,7 +277,7 @@ STATIC mp_obj_t mod_trezorutils_reboot_to_bootloader(size_t n_args, } } else { // Just reboot and go through the normal boot sequence - reboot(); + reboot_device(); } #endif diff --git a/core/embed/prodtest/main.c b/core/embed/prodtest/main.c index 395aa2d1a8..365bc65ff6 100644 --- a/core/embed/prodtest/main.c +++ b/core/embed/prodtest/main.c @@ -769,7 +769,7 @@ static void test_otp_write_device_variant(const char *args) { vcp_println("OK"); } -static void test_reboot(void) { reboot(); } +static void test_reboot(void) { reboot_device(); } void cpuid_read(void) { uint32_t cpuid[3]; diff --git a/core/embed/trezorhal/bootutils.h b/core/embed/trezorhal/bootutils.h index cd1e84dbaa..62b3458227 100644 --- a/core/embed/trezorhal/bootutils.h +++ b/core/embed/trezorhal/bootutils.h @@ -24,7 +24,7 @@ #include // Immediately resets the device and initiates the normal boot sequence. -void __attribute__((noreturn)) reboot(void); +void __attribute__((noreturn)) reboot_device(void); // Resets the device and enters the bootloader, // halting there and waiting for further user instructions. diff --git a/core/embed/trezorhal/stm32f4/bootutils.c b/core/embed/trezorhal/stm32f4/bootutils.c index cfb4d1a81f..4f323928d0 100644 --- a/core/embed/trezorhal/stm32f4/bootutils.c +++ b/core/embed/trezorhal/stm32f4/bootutils.c @@ -173,7 +173,7 @@ void reboot_and_upgrade(const uint8_t hash[32]) { reboot_with_args(BOOT_COMMAND_INSTALL_UPGRADE, hash, 32); } -void reboot(void) { +void reboot_device(void) { bootargs_set(BOOT_COMMAND_NONE, NULL, 0); #ifdef STM32U5 diff --git a/core/embed/trezorhal/stm32f4/syscall_dispatch.c b/core/embed/trezorhal/stm32f4/syscall_dispatch.c index 6993c2ce41..49707a3fab 100644 --- a/core/embed/trezorhal/stm32f4/syscall_dispatch.c +++ b/core/embed/trezorhal/stm32f4/syscall_dispatch.c @@ -108,8 +108,8 @@ __attribute((no_stack_protector)) void syscall_handler(uint32_t *args, case SYSCALL_SECURE_SHUTDOWN: secure_shutdown(); break; - case SYSCALL_REBOOT: - reboot(); + case SYSCALL_REBOOT_DEVICE: + reboot_device(); break; case SYSCALL_REBOOT_TO_BOOTLOADER: reboot_to_bootloader(); diff --git a/core/embed/trezorhal/stm32f4/syscall_numbers.h b/core/embed/trezorhal/stm32f4/syscall_numbers.h index 2341d02ed7..f5789014f9 100644 --- a/core/embed/trezorhal/stm32f4/syscall_numbers.h +++ b/core/embed/trezorhal/stm32f4/syscall_numbers.h @@ -33,7 +33,7 @@ typedef enum { SYSCALL_SYSTICK_US_TO_CYCLES, SYSCALL_SECURE_SHUTDOWN, - SYSCALL_REBOOT, + SYSCALL_REBOOT_DEVICE, SYSCALL_REBOOT_TO_BOOTLOADER, SYSCALL_REBOOT_AND_UPGRADE, diff --git a/core/embed/trezorhal/stm32f4/syscall_stubs.c b/core/embed/trezorhal/stm32f4/syscall_stubs.c index 70487d39bf..1fffa7f526 100644 --- a/core/embed/trezorhal/stm32f4/syscall_stubs.c +++ b/core/embed/trezorhal/stm32f4/syscall_stubs.c @@ -92,8 +92,8 @@ void reboot_and_upgrade(const uint8_t hash[32]) { ; } -void reboot(void) { - syscall_invoke0(SYSCALL_REBOOT); +void reboot_device(void) { + syscall_invoke0(SYSCALL_REBOOT_DEVICE); while (1) ; } diff --git a/core/embed/trezorhal/stm32u5/secret.c b/core/embed/trezorhal/stm32u5/secret.c index 69a060c7cc..933f9ca7d9 100644 --- a/core/embed/trezorhal/stm32u5/secret.c +++ b/core/embed/trezorhal/stm32u5/secret.c @@ -141,7 +141,7 @@ static secbool secret_present(uint32_t offset, uint32_t len) { // read access to it. static void secret_bhk_load(void) { if (sectrue == secret_bhk_locked()) { - reboot(); + reboot_device(); } uint32_t secret[SECRET_BHK_LEN / sizeof(uint32_t)] = {0}; @@ -355,7 +355,7 @@ void secret_prepare_fw(secbool allow_run_with_secret, secbool trust_all) { void secret_init(void) { if (secret_bhk_locked() == sectrue) { - reboot(); + reboot_device(); } secret_ensure_initialized();