diff --git a/include/os_nvm.h b/include/os_nvm.h index 3f1811bda..8fd5e370f 100644 --- a/include/os_nvm.h +++ b/include/os_nvm.h @@ -23,7 +23,7 @@ SYSCALL void nvm_erase(void *dst_adr PLENGTH(len), unsigned int len); SUDOCALL void nvm_write_page(unsigned int page_adr, bool force); // erase a nvm page at given address, only callable by the privileged APIs -SUDOCALL void nvm_erase_page(unsigned int page_adr); +SUDOCALL unsigned int nvm_erase_page(unsigned int page_adr); // any application can wipe the global pin, global seed, user's keys // disabled for security reasons // SYSCALL void diff --git a/src/syscalls.c b/src/syscalls.c index 9eb3256aa..34c91dc18 100644 --- a/src/syscalls.c +++ b/src/syscalls.c @@ -1843,13 +1843,12 @@ void nvm_write_page(unsigned int page_adr, bool force) return; } -void nvm_erase_page(unsigned int page_adr) +unsigned int nvm_erase_page(unsigned int page_adr) { unsigned int parameters[2]; parameters[0] = (unsigned int) page_adr; parameters[1] = 0; - SVC_Call(SYSCALL_nvm_erase_page_ID, parameters); - return; + return (unsigned int) SVC_Call(SYSCALL_nvm_erase_page_ID, parameters); } try_context_t *try_context_get(void)