Skip to content

Commit 3206b81

Browse files
author
Cruz Monrreal
authored
Merge pull request #6978 from OpenNuvoton/nuvoton_m23_tz_module
Support default tz_module in event loop thread for M23/M33
2 parents 8c6a664 + 665dc99 commit 3206b81

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

features/FEATURE_LWIP/lwip-interface/lwip-sys/arch/lwip_sys_arch.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,11 @@ static sys_thread_data_t thread_pool[SYS_THREAD_POOL_N];
514514
* Outputs:
515515
* sys_thread_t -- Pointer to thread handle.
516516
*---------------------------------------------------------------------------*/
517-
sys_thread_t sys_thread_new(const char *pcName,
517+
#ifndef MBED_TZ_DEFAULT_ACCESS
518+
#define MBED_TZ_DEFAULT_ACCESS 0
519+
#endif
520+
521+
sys_thread_t sys_thread_new(const char *pcName,
518522
void (*thread)(void *arg),
519523
void *arg, int stacksize, int priority) {
520524
LWIP_DEBUGF(SYS_DEBUG, ("New Thread: %s\n", pcName));
@@ -531,6 +535,7 @@ sys_thread_t sys_thread_new(const char *pcName,
531535
t->attr.cb_mem = &t->data;
532536
t->attr.stack_size = stacksize;
533537
t->attr.stack_mem = malloc(stacksize);
538+
t->attr.tz_module = MBED_TZ_DEFAULT_ACCESS;
534539
if (t->attr.stack_mem == NULL) {
535540
error("Error allocating the stack memory");
536541
}

features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ static osEventFlagsId_t event_flag_id;
2727

2828
#else
2929

30+
#ifndef MBED_TZ_DEFAULT_ACCESS
31+
#define MBED_TZ_DEFAULT_ACCESS 0
32+
#endif
33+
3034
static void event_loop_thread(void *arg);
3135

3236
static uint64_t event_thread_stk[MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_THREAD_STACK_SIZE/8];
@@ -38,6 +42,7 @@ static const osThreadAttr_t event_thread_attr = {
3842
.stack_size = sizeof event_thread_stk,
3943
.cb_mem = &event_thread_tcb,
4044
.cb_size = sizeof event_thread_tcb,
45+
.tz_module = MBED_TZ_DEFAULT_ACCESS,
4146
};
4247
#endif
4348

0 commit comments

Comments
 (0)