mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
util: use shutdown from trezor-core instead of system_halt
This commit is contained in:
parent
9588e8f273
commit
95dd254094
@ -46,7 +46,7 @@ void layoutFirmwareHash(const uint8_t *hash)
|
|||||||
void show_halt(void)
|
void show_halt(void)
|
||||||
{
|
{
|
||||||
layoutDialog(&bmp_icon_error, NULL, NULL, NULL, "Unofficial firmware", "aborted.", NULL, "Unplug your TREZOR", "contact our support.", NULL);
|
layoutDialog(&bmp_icon_error, NULL, NULL, NULL, "Unofficial firmware", "aborted.", NULL, "Unplug your TREZOR", "contact our support.", NULL);
|
||||||
system_halt();
|
shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_unofficial_warning(const uint8_t *hash)
|
void show_unofficial_warning(const uint8_t *hash)
|
||||||
|
@ -130,7 +130,7 @@ static char CONFIDENTIAL sessionPassphrase[51];
|
|||||||
void storage_show_error(void)
|
void storage_show_error(void)
|
||||||
{
|
{
|
||||||
layoutDialog(&bmp_icon_error, NULL, NULL, NULL, _("Storage failure"), _("detected."), NULL, _("Please unplug"), _("the device."), NULL);
|
layoutDialog(&bmp_icon_error, NULL, NULL, NULL, _("Storage failure"), _("detected."), NULL, _("Please unplug"), _("the device."), NULL);
|
||||||
system_halt();
|
shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void storage_check_flash_errors(void)
|
void storage_check_flash_errors(void)
|
||||||
|
24
startup.s
24
startup.s
@ -36,4 +36,28 @@ reset_handler:
|
|||||||
// loop forever if the application code returns
|
// loop forever if the application code returns
|
||||||
b .
|
b .
|
||||||
|
|
||||||
|
.global shutdown
|
||||||
|
.type shutdown, STT_FUNC
|
||||||
|
shutdown:
|
||||||
|
cpsid f
|
||||||
|
ldr r0, =0
|
||||||
|
mov r1, r0
|
||||||
|
mov r2, r0
|
||||||
|
mov r3, r0
|
||||||
|
mov r4, r0
|
||||||
|
mov r5, r0
|
||||||
|
mov r6, r0
|
||||||
|
mov r7, r0
|
||||||
|
mov r8, r0
|
||||||
|
mov r9, r0
|
||||||
|
mov r10, r0
|
||||||
|
mov r11, r0
|
||||||
|
mov r12, r0
|
||||||
|
ldr lr, =0xffffffff
|
||||||
|
ldr r0, =_ram_start
|
||||||
|
ldr r1, =_ram_end
|
||||||
|
// set to value in r2
|
||||||
|
bl memset_reg
|
||||||
|
b . // loop forever
|
||||||
|
|
||||||
.end
|
.end
|
||||||
|
5
util.c
5
util.c
@ -66,8 +66,3 @@ uint32_t readprotobufint(uint8_t **ptr)
|
|||||||
(*ptr)++;
|
(*ptr)++;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__((noreturn)) system_halt(void)
|
|
||||||
{
|
|
||||||
for (;;) {} // loop forever
|
|
||||||
}
|
|
||||||
|
4
util.h
4
util.h
@ -43,15 +43,13 @@ void data2hex(const void *data, uint32_t len, char *str);
|
|||||||
// read protobuf integer and advance pointer
|
// read protobuf integer and advance pointer
|
||||||
uint32_t readprotobufint(uint8_t **ptr);
|
uint32_t readprotobufint(uint8_t **ptr);
|
||||||
|
|
||||||
// halt execution (or do an endless loop)
|
|
||||||
void __attribute__((noreturn)) system_halt(void);
|
|
||||||
|
|
||||||
#if !EMULATOR
|
#if !EMULATOR
|
||||||
// defined in memory.ld
|
// defined in memory.ld
|
||||||
extern uint8_t _ram_start[], _ram_end[];
|
extern uint8_t _ram_start[], _ram_end[];
|
||||||
|
|
||||||
// defined in startup.s
|
// defined in startup.s
|
||||||
extern void memset_reg(void *start, void *stop, uint32_t val);
|
extern void memset_reg(void *start, void *stop, uint32_t val);
|
||||||
|
extern void __attribute__((noreturn)) shutdown(void);
|
||||||
|
|
||||||
#define FW_SIGNED 0x5A3CA5C3
|
#define FW_SIGNED 0x5A3CA5C3
|
||||||
#define FW_UNTRUSTED 0x00000000
|
#define FW_UNTRUSTED 0x00000000
|
||||||
|
Loading…
Reference in New Issue
Block a user