Enable NSID management from NS side
Enable the new implementation on NS client identification from NS side.
Replace TFM_NS_CLIENT_IDENTIFICATION with TFM_NS_MANAGE_NSID.
TFM_NS_MANAGE_NSID is used to enable new NSID management from NS side.
TFM_NS_CLIENT_IDENTIFICATION for old NSID implementation needs to be deprecated.
Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: I29700f1beeaba32e0167b90e9876c334992474d5
diff --git a/app/os_wrapper_cmsis_rtos_v2.c b/app/os_wrapper_cmsis_rtos_v2.c
old mode 100644
new mode 100755
index 810a244..ec785f2
--- a/app/os_wrapper_cmsis_rtos_v2.c
+++ b/app/os_wrapper_cmsis_rtos_v2.c
@@ -9,16 +9,22 @@
#include "os_wrapper/mutex.h"
#include "os_wrapper/semaphore.h"
-#include <string.h>
#include "cmsis_os2.h"
+#include "tfm_nsid_manager.h"
+#ifdef TFM_NS_MANAGE_NSID
+#include "tfm_nsid_map_table.h"
+#endif
+
/* This is an example OS abstraction layer for CMSIS-RTOSv2 */
void *os_wrapper_thread_new(const char *name, int32_t stack_size,
os_wrapper_thread_func func, void *arg,
uint32_t priority)
{
- osThreadAttr_t task_attribs = {.tz_module = 1};
+ osThreadAttr_t task_attribs = {
+ .tz_module = ((TZ_ModuleId_t)TFM_DEFAULT_NSID)
+ };
/* By default, the thread starts as osThreadDetached */
if (stack_size != OS_WRAPPER_DEFAULT_STACK_SIZE) {
@@ -27,6 +33,10 @@
task_attribs.name = name;
task_attribs.priority = (osPriority_t) priority;
+#ifdef TFM_NS_MANAGE_NSID
+ task_attribs.tz_module = (TZ_ModuleId_t)nsid_mgr_get_thread_nsid(name);
+#endif
+
return (void *)osThreadNew(func, arg, &task_attribs);
}