mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-17 05:03:07 +00:00
fix(legacy): better stack setup for debug devices
This commit is contained in:
parent
71e0b8c1c3
commit
8ea3ca4c5e
@ -80,7 +80,11 @@ jump_to_firmware(const vector_table_t *ivt, int trust) {
|
||||
} else { // untrusted firmware
|
||||
timer_init();
|
||||
mpu_config_firmware(); // * configure MPU for the firmware
|
||||
__asm__ volatile("msr msp, %0" ::"r"(_stack));
|
||||
|
||||
// Setup stack in unprivileged mode (MSR works only for privileged)
|
||||
// This syntax will use _stack as immediate value to put into SP
|
||||
// instead of dereferencing it
|
||||
__asm__ volatile("mov sp, %[input]" ::[input] "r"(&_stack));
|
||||
}
|
||||
|
||||
// Jump to address
|
||||
|
Loading…
Reference in New Issue
Block a user