TFM: Change NS lock functions to weak

Default NS lock functions use mutex to guarantee serialization into secure world.
But this mechanism doesn't support pre-rtos and interrupt-disabled.
This commit changes these functions to weak so that platform can override them to provide another mechanism.
This approach is just what TF-M repository is adopting.

https://review.trustedfirmware.org/c/trusted-firmware-m/+/1460
pull/10959/head
Chun-Chieh Li 2020-01-06 15:46:09 +08:00
parent 7fd637b66b
commit 85dfc1a971
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,7 @@ static const osMutexAttr_t ns_lock_attrib = {
/**
* \brief NS world, NS lock based dispatcher
*/
__attribute__((weak))
uint32_t tfm_ns_lock_dispatch(veneer_fn fn,
uint32_t arg0, uint32_t arg1,
uint32_t arg2, uint32_t arg3)
@ -70,6 +71,7 @@ uint32_t tfm_ns_lock_dispatch(veneer_fn fn,
/**
* \brief NS world, Init NS lock
*/
__attribute__((weak))
enum tfm_status_e tfm_ns_lock_init()
{
if (ns_lock.init == false) {