@@ -73,20 +73,29 @@ namespace rtos {
7373 * and underlying RTOS objects (static or dynamic RTOS memory pools are not being used).
7474 * Additionally the stack memory for this thread will be allocated on the heap, if it wasn't supplied to the constructor.
7575 */
76+
77+ /* This flag can be used to change the default access of all threads in non-secure mode.
78+ TZ_DEFAULT_ACCESS set to 1, means all non-secure threads have access to call secure functions. */
79+ #ifndef TZ_DEFAULT_ACCESS
80+ #define TZ_DEFAULT_ACCESS 0
81+ #endif
82+
7683class Thread : private mbed ::NonCopyable<Thread> {
7784public:
7885 /* * Allocate a new thread without starting execution
7986 @param priority initial priority of the thread function. (default: osPriorityNormal).
8087 @param stack_size stack size (in bytes) requirements for the thread function. (default: OS_STACK_SIZE).
8188 @param stack_mem pointer to the stack area to be used by this thread (default: NULL).
8289 @param name name to be used for this thread. It has to stay allocated for the lifetime of the thread (default: NULL)
90+ @param tz_module trustzone thread identifier (osThreadAttr_t::tz_module) (default: TZ_DEFAULT_ACCESS)
8391
8492 @note You cannot call this function from ISR context.
8593 */
94+
8695 Thread (osPriority priority=osPriorityNormal,
8796 uint32_t stack_size=OS_STACK_SIZE,
88- unsigned char *stack_mem=NULL , const char *name=NULL ) {
89- constructor (priority, stack_size, stack_mem, name);
97+ unsigned char *stack_mem=NULL , const char *name=NULL , uint32_t tz_module=TZ_DEFAULT_ACCESS ) {
98+ constructor (priority, stack_size, stack_mem, name, tz_module );
9099 }
91100
92101 /* * Create a new thread, and start it executing the specified function.
@@ -427,12 +436,12 @@ class Thread : private mbed::NonCopyable<Thread> {
427436 void constructor (osPriority priority=osPriorityNormal,
428437 uint32_t stack_size=OS_STACK_SIZE,
429438 unsigned char *stack_mem=NULL ,
430- const char *name=NULL );
439+ const char *name=NULL , uint32_t tz_module=TZ_DEFAULT_ACCESS );
431440 void constructor (mbed::Callback<void ()> task,
432441 osPriority priority=osPriorityNormal,
433442 uint32_t stack_size=OS_STACK_SIZE,
434443 unsigned char *stack_mem=NULL,
435- const char *name=NULL);
444+ const char *name=NULL, uint32_t tz_module=TZ_DEFAULT_ACCESS );
436445 static void _thunk (void * thread_ptr);
437446
438447 mbed::Callback<void ()> _task;
0 commit comments