Skip to content

Commit 85dfc1a

Browse files
committed
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
1 parent 7fd637b commit 85dfc1a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

components/TARGET_PSA/TARGET_TFM/COMPONENT_NSPE/interface/src/tfm_ns_lock_rtx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ static const osMutexAttr_t ns_lock_attrib = {
4242
/**
4343
* \brief NS world, NS lock based dispatcher
4444
*/
45+
__attribute__((weak))
4546
uint32_t tfm_ns_lock_dispatch(veneer_fn fn,
4647
uint32_t arg0, uint32_t arg1,
4748
uint32_t arg2, uint32_t arg3)
@@ -70,6 +71,7 @@ uint32_t tfm_ns_lock_dispatch(veneer_fn fn,
7071
/**
7172
* \brief NS world, Init NS lock
7273
*/
74+
__attribute__((weak))
7375
enum tfm_status_e tfm_ns_lock_init()
7476
{
7577
if (ns_lock.init == false) {

0 commit comments

Comments
 (0)