Merge pull request #6978 from OpenNuvoton/nuvoton_m23_tz_module

Support default tz_module in event loop thread for M23/M33
pull/7151/head
Cruz Monrreal 2018-06-11 08:44:21 -05:00 committed by GitHub
commit 3206b81437
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -514,7 +514,11 @@ static sys_thread_data_t thread_pool[SYS_THREAD_POOL_N];
* Outputs: * Outputs:
* sys_thread_t -- Pointer to thread handle. * 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 (*thread)(void *arg),
void *arg, int stacksize, int priority) { void *arg, int stacksize, int priority) {
LWIP_DEBUGF(SYS_DEBUG, ("New Thread: %s\n", pcName)); LWIP_DEBUGF(SYS_DEBUG, ("New Thread: %s\n", pcName));
@ -531,6 +535,7 @@ sys_thread_t sys_thread_new(const char *pcName,
t->attr.cb_mem = &t->data; t->attr.cb_mem = &t->data;
t->attr.stack_size = stacksize; t->attr.stack_size = stacksize;
t->attr.stack_mem = malloc(stacksize); t->attr.stack_mem = malloc(stacksize);
t->attr.tz_module = MBED_TZ_DEFAULT_ACCESS;
if (t->attr.stack_mem == NULL) { if (t->attr.stack_mem == NULL) {
error("Error allocating the stack memory"); error("Error allocating the stack memory");
} }

View File

@ -27,6 +27,10 @@ static osEventFlagsId_t event_flag_id;
#else #else
#ifndef MBED_TZ_DEFAULT_ACCESS
#define MBED_TZ_DEFAULT_ACCESS 0
#endif
static void event_loop_thread(void *arg); static void event_loop_thread(void *arg);
static uint64_t event_thread_stk[MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_THREAD_STACK_SIZE/8]; 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 = {
.stack_size = sizeof event_thread_stk, .stack_size = sizeof event_thread_stk,
.cb_mem = &event_thread_tcb, .cb_mem = &event_thread_tcb,
.cb_size = sizeof event_thread_tcb, .cb_size = sizeof event_thread_tcb,
.tz_module = MBED_TZ_DEFAULT_ACCESS,
}; };
#endif #endif