From 85dfc1a971ec7956b19cf6f5e20069e623a1218e Mon Sep 17 00:00:00 2001 From: Chun-Chieh Li Date: Mon, 6 Jan 2020 15:46:09 +0800 Subject: [PATCH] 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 --- .../TARGET_TFM/COMPONENT_NSPE/interface/src/tfm_ns_lock_rtx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_NSPE/interface/src/tfm_ns_lock_rtx.c b/components/TARGET_PSA/TARGET_TFM/COMPONENT_NSPE/interface/src/tfm_ns_lock_rtx.c index 0c677623aa..d12d3487fe 100644 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_NSPE/interface/src/tfm_ns_lock_rtx.c +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_NSPE/interface/src/tfm_ns_lock_rtx.c @@ -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) {