From bdaeaf185de6c26df18429e780439ab2d94a95ba Mon Sep 17 00:00:00 2001 From: sra Date: Fri, 13 Dec 2024 12:58:33 +0100 Subject: [PATCH] Add a syscall to set OS values --- include/os_ux.h | 1 + include/syscalls.h | 1 + src/syscalls.c | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/include/os_ux.h b/include/os_ux.h index f05112ad8..b9aaf6711 100644 --- a/include/os_ux.h +++ b/include/os_ux.h @@ -112,3 +112,4 @@ SYSCALL unsigned int os_ux_get_status(unsigned int ux_id); #endif // HAVE_BLE SYSCALL PERMISSION(APPLICATION_FLAG_BOLOS_UX) void os_dashboard_mbx(uint32_t cmd, uint32_t param); +SYSCALL PERMISSION(APPLICATION_FLAG_BOLOS_UX) void os_ux_set_global(uint8_t param_type, uint8_t *param, size_t param_len); diff --git a/include/syscalls.h b/include/syscalls.h index bab67e650..4e2e05063 100644 --- a/include/syscalls.h +++ b/include/syscalls.h @@ -199,6 +199,7 @@ #endif // HAVE_LEDGER_PKI #define SYSCALL_os_dashboard_mbx_ID 0x02000150 +#define SYSCALL_os_ux_set_global_ID 0x03000151 #ifdef HAVE_CUSTOM_CA_DETAILS_IN_SETTINGS #define SYSCALL_CERT_get_ID 0x01000CA0 diff --git a/src/syscalls.c b/src/syscalls.c index 25d07f044..842cdcaed 100644 --- a/src/syscalls.c +++ b/src/syscalls.c @@ -1578,6 +1578,15 @@ void os_dashboard_mbx(uint32_t cmd, uint32_t param) SVC_Call(SYSCALL_os_dashboard_mbx_ID, parameters); } +void os_ux_set_global(uint8_t param_type, uint8_t *param, size_t param_len) +{ + unsigned int parameters[3]; + parameters[0] = (unsigned int) param_type; + parameters[1] = (unsigned int) param; + parameters[2] = (unsigned int) param_len; + SVC_Call(SYSCALL_os_ux_set_global_ID, parameters); +} + void os_lib_call(unsigned int *call_parameters) { unsigned int parameters[2];