Skip to content

Commit 665dc99

Browse files
committed
Support default tz_module for event loop & lwip
1 parent db73ed0 commit 665dc99

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
@@ -502,7 +502,11 @@ static sys_thread_data_t thread_pool[SYS_THREAD_POOL_N];
502502
* Outputs:
503503
* sys_thread_t -- Pointer to thread handle.
504504
*---------------------------------------------------------------------------*/
505-
sys_thread_t sys_thread_new(const char *pcName,
505+
#ifndef MBED_TZ_DEFAULT_ACCESS
506+
#define MBED_TZ_DEFAULT_ACCESS 0
507+
#endif
508+
509+
sys_thread_t sys_thread_new(const char *pcName,
506510
void (*thread)(void *arg),
507511
void *arg, int stacksize, int priority) {
508512
LWIP_DEBUGF(SYS_DEBUG, ("New Thread: %s\n", pcName));
@@ -519,6 +523,7 @@ sys_thread_t sys_thread_new(const char *pcName,
519523
t->attr.cb_mem = &t->data;
520524
t->attr.stack_size = stacksize;
521525
t->attr.stack_mem = malloc(stacksize);
526+
t->attr.tz_module = MBED_TZ_DEFAULT_ACCESS;
522527
if (t->attr.stack_mem == NULL) {
523528
error("Error allocating the stack memory");
524529
}

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)