Skip to content

Support default tz_module in event loop thread for M23/M33 #6978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,11 @@ static sys_thread_data_t thread_pool[SYS_THREAD_POOL_N];
* Outputs:
* sys_thread_t -- Pointer to thread handle.
*---------------------------------------------------------------------------*/
sys_thread_t sys_thread_new(const char *pcName,
#ifndef MBED_TZ_DEFAULT_ACCESS
#define MBED_TZ_DEFAULT_ACCESS 0
#endif

sys_thread_t sys_thread_new(const char *pcName,
void (*thread)(void *arg),
void *arg, int stacksize, int priority) {
LWIP_DEBUGF(SYS_DEBUG, ("New Thread: %s\n", pcName));
Expand All @@ -519,6 +523,7 @@ sys_thread_t sys_thread_new(const char *pcName,
t->attr.cb_mem = &t->data;
t->attr.stack_size = stacksize;
t->attr.stack_mem = malloc(stacksize);
t->attr.tz_module = MBED_TZ_DEFAULT_ACCESS;
if (t->attr.stack_mem == NULL) {
error("Error allocating the stack memory");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ static osEventFlagsId_t event_flag_id;

#else

#ifndef MBED_TZ_DEFAULT_ACCESS
#define MBED_TZ_DEFAULT_ACCESS 0
#endif

static void event_loop_thread(void *arg);

static uint64_t event_thread_stk[MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_THREAD_STACK_SIZE/8];
Expand All @@ -38,6 +42,7 @@ static const osThreadAttr_t event_thread_attr = {
.stack_size = sizeof event_thread_stk,
.cb_mem = &event_thread_tcb,
.cb_size = sizeof event_thread_tcb,
.tz_module = MBED_TZ_DEFAULT_ACCESS,
};
#endif

Expand Down