1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-06-25 09:22:33 +00:00

refactor(core): rename shutdown to shutdown_privileged

This commit is contained in:
Ondřej Vejpustek 2021-06-14 16:28:13 +02:00
parent 7686eb355a
commit cca9d4b1c4
11 changed files with 18 additions and 18 deletions

View File

@ -55,6 +55,6 @@ reset_handler:
// enter the application code // enter the application code
bl main bl main
b shutdown b shutdown_privileged
.end .end

View File

@ -36,6 +36,6 @@ reset_handler:
// enter the application code // enter the application code
bl main bl main
b shutdown b shutdown_privileged
.end .end

View File

@ -36,6 +36,6 @@ reset_handler:
// enter the application code // enter the application code
bl main bl main
b shutdown b shutdown_privileged
.end .end

View File

@ -52,6 +52,6 @@ reset_handler:
// enter the application code // enter the application code
bl main bl main
b shutdown b shutdown_privileged
.end .end

View File

@ -36,6 +36,6 @@ reset_handler:
// enter the application code // enter the application code
bl main bl main
b shutdown b shutdown_privileged
.end .end

View File

@ -36,6 +36,6 @@ reset_handler:
// enter the application code // enter the application code
bl main bl main
b shutdown b shutdown_privileged
.end .end

View File

@ -29,7 +29,7 @@
#include "stm32f4xx_ll_utils.h" #include "stm32f4xx_ll_utils.h"
// from util.s // from util.s
extern void shutdown(void); extern void shutdown_privileged(void);
#define COLOR_FATAL_ERROR RGB16(0x7F, 0x00, 0x00) #define COLOR_FATAL_ERROR RGB16(0x7F, 0x00, 0x00)
@ -58,7 +58,7 @@ __fatal_error(const char *expr, const char *msg, const char *file, int line,
rev[4]); rev[4]);
#endif #endif
display_printf("\nPlease contact Trezor support.\n"); display_printf("\nPlease contact Trezor support.\n");
shutdown(); shutdown_privileged();
for (;;) for (;;)
; ;
} }
@ -107,7 +107,7 @@ error_shutdown(const char *line1, const char *line2, const char *line3,
display_printf("\nPlease unplug the device.\n"); display_printf("\nPlease unplug the device.\n");
#endif #endif
display_backlight(255); display_backlight(255);
shutdown(); shutdown_privileged();
for (;;) for (;;)
; ;
} }

View File

@ -45,7 +45,7 @@ https://link.springer.com/content/pdf/10.1007%2F978-3-540-72354-7_3.pdf
#include "rand.h" #include "rand.h"
// from util.s // from util.s
extern void shutdown(void); extern void shutdown_privileged(void);
#define DRBG_RESEED_INTERVAL_CALLS 1000 #define DRBG_RESEED_INTERVAL_CALLS 1000
#define DRBG_TRNG_ENTROPY_LENGTH 50 #define DRBG_TRNG_ENTROPY_LENGTH 50
@ -197,13 +197,13 @@ void wait_random(void) {
volatile int j = wait; volatile int j = wait;
while (i < wait) { while (i < wait) {
if (i + j != wait) { if (i + j != wait) {
shutdown(); shutdown_privileged();
} }
++i; ++i;
--j; --j;
} }
// Double-check loop completion. // Double-check loop completion.
if (i != wait || j != 0) { if (i != wait || j != 0) {
shutdown(); shutdown_privileged();
} }
} }

View File

@ -87,9 +87,9 @@ void SystemInit(void) {
} }
// from util.s // from util.s
extern void shutdown(void); extern void shutdown_privileged(void);
void PVD_IRQHandler(void) { void PVD_IRQHandler(void) {
TIM1->CCR1 = 0; // turn off display backlight TIM1->CCR1 = 0; // turn off display backlight
shutdown(); shutdown_privileged();
} }

View File

@ -121,9 +121,9 @@ jump_to_unprivileged:
// jump // jump
bx lr bx lr
.global shutdown .global shutdown_privileged
.type shutdown, STT_FUNC .type shutdown_privileged, STT_FUNC
shutdown: shutdown_privileged:
cpsid f cpsid f
ldr r0, =0 ldr r0, =0
mov r1, r0 mov r1, r0

View File

@ -5,7 +5,7 @@
.global default_handler .global default_handler
.type default_handler, STT_FUNC .type default_handler, STT_FUNC
default_handler: default_handler:
b shutdown b shutdown_privileged
.macro add_handler symbol_name:req .macro add_handler symbol_name:req
.word \symbol_name .word \symbol_name