feat(core): implement wrapper for svc_shutdown

pull/1672/head
Ondřej Vejpustek 3 years ago
parent 311288407e
commit 40b4f679f9

@ -354,6 +354,8 @@ SOURCE_TREZORHAL = [
'embed/trezorhal/vectortable.s',
]
CPPDEFINES_MOD += ['USE_SVC_SHUTDOWN']
if FEATURE_FLAGS["RDI"]:
CPPDEFINES_MOD += ['RDI']

@ -25,6 +25,7 @@
#include "display.h"
#include "flash.h"
#include "rand.h"
#include "supervise.h"
#include "stm32f4xx_ll_utils.h"
@ -33,6 +34,18 @@ extern void shutdown_privileged(void);
#define COLOR_FATAL_ERROR RGB16(0x7F, 0x00, 0x00)
// from util.s
extern void shutdown_privileged(void);
void shutdown(void) {
#ifdef USE_SVC_SHUTDOWN
svc_shutdown();
#else
// It won't work properly unless called from the privileged mode
shutdown_privileged();
#endif
}
void __attribute__((noreturn))
__fatal_error(const char *expr, const char *msg, const char *file, int line,
const char *func) {

@ -49,6 +49,8 @@
})
#endif
void shutdown(void);
void __attribute__((noreturn))
__fatal_error(const char *expr, const char *msg, const char *file, int line,
const char *func);

Loading…
Cancel
Save