Skip to content

Commit badfa18

Browse files
Charley ChuRaymond Ngun
authored andcommitted
Move current TFM to TFM_V1_1
Named TFM V1.1 as TFM_V1_1 instead of TFM_V1.1 as TFM_V1.1 is invalid as macro name Signed-off-by: Charley Chu <[email protected]>
1 parent 8b663cf commit badfa18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+14
-22
lines changed

features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_DUALCPU/src/platform_ns_mailbox.c renamed to features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/src/platform_ns_mailbox.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ int32_t tfm_ns_mailbox_hal_notify_peer(void)
5454

5555
static int32_t mailbox_sema_init(void)
5656
{
57-
#if defined(CY_IPC_DEFAULT_CFG_DISABLE)
5857
/* semaphore data */
5958
static uint32_t tfm_sema __attribute__((section("TFM_SHARED_DATA")));
6059

@@ -63,7 +62,6 @@ static int32_t mailbox_sema_init(void)
6362
&tfm_sema) != CY_IPC_SEMA_SUCCESS) {
6463
return PLATFORM_MAILBOX_INIT_ERROR;
6564
}
66-
#endif
6765
return PLATFORM_MAILBOX_SUCCESS;
6866
}
6967

@@ -120,7 +118,11 @@ int32_t tfm_ns_mailbox_hal_init(struct ns_mailbox_queue_t *queue)
120118

121119
const void *tfm_ns_mailbox_get_task_handle(void)
122120
{
123-
return osThreadGetId();;
121+
#ifdef TFM_MULTI_CORE_MULTI_CLIENT_CALL
122+
return osThreadGetId();
123+
#else
124+
return NULL;
125+
#endif
124126
}
125127

126128
void tfm_ns_mailbox_hal_wait_reply(mailbox_msg_handle_t handle)
@@ -277,7 +279,7 @@ static bool mailbox_clear_intr(void)
277279
return true;
278280
}
279281

280-
void cpuss_interrupts_ipc_8_IRQHandler(void)
282+
void cpuss_interrupts_ipc_5_IRQHandler(void)
281283
{
282284
uint32_t magic;
283285
mailbox_msg_handle_t handle;
@@ -297,6 +299,9 @@ void cpuss_interrupts_ipc_8_IRQHandler(void)
297299

298300
task_handle = (osThreadId_t)tfm_ns_mailbox_get_msg_owner(handle);
299301
if (task_handle) {
302+
/* According to the description of CMSIS-RTOS v2 Thread Flags,
303+
* osThreadFlagsSet() can be called inside Interrupt Service
304+
* Routine. */
300305
osThreadFlagsSet(task_handle, handle);
301306
}
302307
}

features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_DUALCPU/src/tfm_multi_core_api.c renamed to features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/src/tfm_multi_core_api.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,15 @@
99
#include "tfm_mailbox.h"
1010
#include "tfm_multi_core_api.h"
1111
#include "cmsis_os2.h"
12-
#include "mbed_rtos_storage.h"
1312

1413
#define MAX_SEMAPHORE_COUNT NUM_MAILBOX_QUEUE_SLOT
1514

16-
static void *ns_lock_handle = NULL;
17-
static mbed_rtos_storage_semaphore_t tfm_ns_sema_obj;
15+
static osSemaphoreId_t ns_lock_handle = NULL;
1816

1917
__attribute__((weak))
2018
enum tfm_status_e tfm_ns_interface_init(void)
2119
{
22-
osSemaphoreAttr_t sema_attrib = {
23-
.name = "tfm_ns_lock",
24-
.attr_bits = 0,
25-
.cb_size = sizeof(tfm_ns_sema_obj),
26-
.cb_mem = &tfm_ns_sema_obj
27-
};
20+
osSemaphoreAttr_t sema_attrib = {0};
2821

2922
ns_lock_handle = osSemaphoreNew(MAX_SEMAPHORE_COUNT,
3023
MAX_SEMAPHORE_COUNT,

0 commit comments

Comments
 (0)