From 8fa9bfa1fbaef4e8aca04acaa0c30fabfd794bf3 Mon Sep 17 00:00:00 2001 From: Arthur Bonnaudet Date: Thu, 19 Oct 2023 10:20:18 +0200 Subject: [PATCH] Add UX specific syscall to share time with OS --- include/os_time.h | 6 ++++++ include/syscalls.h | 1 + src/syscalls.c | 8 ++++++++ 3 files changed, 15 insertions(+) create mode 100644 include/os_time.h diff --git a/include/os_time.h b/include/os_time.h new file mode 100644 index 000000000..9a6967785 --- /dev/null +++ b/include/os_time.h @@ -0,0 +1,6 @@ +#pragma once + +#include "decorators.h" + +// UX specific syscall to share time with dashboard task +SYSCALL void os_set_ux_time_ms(unsigned int ux_ms); diff --git a/include/syscalls.h b/include/syscalls.h index 8ad6c67a3..37b7d611f 100644 --- a/include/syscalls.h +++ b/include/syscalls.h @@ -189,6 +189,7 @@ #define SYSCALL_os_deny_protected_flash_ID 0x00000091 #define SYSCALL_os_allow_protected_ram_ID 0x00000092 #define SYSCALL_os_deny_protected_ram_ID 0x00000093 +#define SYSCALL_os_set_ux_time_ms_ID 0x010000a2 #ifdef HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS #define SYSCALL_os_bolos_custom_ca_get_info_ID 0x01000CA0 diff --git a/src/syscalls.c b/src/syscalls.c index 5762b7ba8..8a664b655 100644 --- a/src/syscalls.c +++ b/src/syscalls.c @@ -1281,6 +1281,14 @@ void os_perso_set_onboarding_status(unsigned int state, unsigned int count, unsi return; } +void os_set_ux_time_ms(unsigned int ux_ms) +{ + unsigned int parameters[1]; + parameters[0] = (unsigned int) ux_ms; + SVC_Call(SYSCALL_os_set_ux_time_ms_ID, parameters); + return; +} + void os_perso_derive_node_bip32(cx_curve_t curve, const unsigned int *path, unsigned int pathLength,