mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-07 05:02:38 +00:00
refactor(core): stop using shutdown_privileged directly
[no changelog]
This commit is contained in:
parent
d8e7dc8cd9
commit
c30233b832
@ -29,9 +29,6 @@
|
||||
|
||||
#ifdef KERNEL_MODE
|
||||
|
||||
// from util.s
|
||||
extern void shutdown_privileged(void);
|
||||
|
||||
#define DRBG_RESEED_INTERVAL_CALLS 1000
|
||||
#define DRBG_TRNG_ENTROPY_LENGTH 50
|
||||
_Static_assert(CHACHA_DRBG_OPTIMAL_RESEED_LENGTH(1) == DRBG_TRNG_ENTROPY_LENGTH,
|
||||
@ -192,14 +189,14 @@ void wait_random(void) {
|
||||
volatile int j = wait;
|
||||
while (i < wait) {
|
||||
if (i + j != wait) {
|
||||
shutdown_privileged();
|
||||
error_shutdown("(glitch)");
|
||||
}
|
||||
++i;
|
||||
--j;
|
||||
}
|
||||
// Double-check loop completion.
|
||||
if (i != wait || j != 0) {
|
||||
shutdown_privileged();
|
||||
error_shutdown("(glitch)");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -56,9 +56,7 @@ void PVD_IRQHandler(void) {
|
||||
// Turn off display backlight
|
||||
BACKLIGHT_PWM_TIM->BACKLIGHT_PWM_TIM_CCR = 0;
|
||||
#endif
|
||||
// from util.s
|
||||
extern void shutdown_privileged(void);
|
||||
shutdown_privileged();
|
||||
error_shutdown("PVD IRQ");
|
||||
}
|
||||
|
||||
#endif // defined(KERNEL_MODE) && defined(USE_PVD)
|
||||
|
@ -56,6 +56,6 @@ reset_handler:
|
||||
// enter the application code
|
||||
bl main
|
||||
|
||||
b shutdown_privileged
|
||||
b system_exit
|
||||
|
||||
.end
|
||||
|
@ -39,7 +39,7 @@ reset_handler:
|
||||
// enter the application code
|
||||
bl main
|
||||
|
||||
b shutdown_privileged
|
||||
b system_exit
|
||||
|
||||
.end
|
||||
|
||||
|
@ -34,6 +34,6 @@ reset_handler:
|
||||
// enter the application code
|
||||
bl main
|
||||
|
||||
b shutdown_privileged
|
||||
b system_exit
|
||||
|
||||
.end
|
||||
|
@ -7,7 +7,7 @@
|
||||
.global default_handler
|
||||
.type default_handler, STT_FUNC
|
||||
default_handler:
|
||||
b shutdown_privileged
|
||||
b Default_IRQHandler
|
||||
|
||||
.macro add_handler symbol_name:req
|
||||
.word \symbol_name
|
||||
|
@ -74,6 +74,6 @@ clear_ram:
|
||||
// enter the application code
|
||||
bl main
|
||||
|
||||
b shutdown_privileged
|
||||
b system_exit
|
||||
|
||||
.end
|
||||
|
@ -57,6 +57,6 @@ reset_handler:
|
||||
// enter the application code
|
||||
bl main
|
||||
|
||||
b shutdown_privileged
|
||||
b system_exit
|
||||
|
||||
.end
|
||||
|
@ -48,6 +48,6 @@ reset_handler:
|
||||
// enter the application code
|
||||
bl main
|
||||
|
||||
b shutdown_privileged
|
||||
b system_exit
|
||||
|
||||
.end
|
||||
|
@ -7,7 +7,7 @@
|
||||
.global default_handler
|
||||
.type default_handler, STT_FUNC
|
||||
default_handler:
|
||||
b shutdown_privileged
|
||||
b Default_IRQHandler
|
||||
|
||||
.macro add_handler symbol_name:req
|
||||
.word \symbol_name
|
||||
|
@ -635,4 +635,6 @@ void NMI_Handler(void) {
|
||||
mpu_restore(mpu_mode);
|
||||
}
|
||||
|
||||
void Default_IRQHandler(void) { error_shutdown("Unhandled IRQ"); }
|
||||
|
||||
#endif // KERNEL_MODE
|
||||
|
Loading…
Reference in New Issue
Block a user