From e89c1a68ce8f690ce0d6029cd9196b03906060de Mon Sep 17 00:00:00 2001 From: Michael Schwarcz Date: Thu, 7 Feb 2019 12:05:25 +0200 Subject: [PATCH] TF-M patch: Fix tfm_ns_lock_init issue (TF-M issue #239) - Link to bug tracking: https://developer.trustedfirmware.org/T239 (cherry picked from commit 5f2e4b3911ca3a776fab55a6d12054904614cced) --- .../COMPONENT_NSPE/interface/src/tfm_ns_lock_rtx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 59ef1495a5..feece0be33 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 @@ -6,9 +6,9 @@ */ #include #include - +#include "cmsis.h" +#include "rtx_os.h" #include "cmsis_os2.h" - #include "tfm_api.h" #include "tfm_ns_lock.h" @@ -29,9 +29,14 @@ static struct ns_lock_state ns_lock = {.init=false, .id=NULL}; /** * \brief Mutex properties, NS lock */ + +static osRtxMutex_t ns_lock_cb = { 0 }; + static const osMutexAttr_t ns_lock_attrib = { .name = "ns_lock", - .attr_bits = osMutexPrioInherit + .attr_bits = osMutexPrioInherit, + .cb_mem = &ns_lock_cb, + .cb_size = sizeof(ns_lock_cb) }; /**