@@ -73,20 +73,29 @@ namespace rtos {
73
73
* and underlying RTOS objects (static or dynamic RTOS memory pools are not being used).
74
74
* Additionally the stack memory for this thread will be allocated on the heap, if it wasn't supplied to the constructor.
75
75
*/
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
+
76
83
class Thread : private mbed ::NonCopyable<Thread> {
77
84
public:
78
85
/* * Allocate a new thread without starting execution
79
86
@param priority initial priority of the thread function. (default: osPriorityNormal).
80
87
@param stack_size stack size (in bytes) requirements for the thread function. (default: OS_STACK_SIZE).
81
88
@param stack_mem pointer to the stack area to be used by this thread (default: NULL).
82
89
@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)
83
91
84
92
@note You cannot call this function from ISR context.
85
93
*/
94
+
86
95
Thread (osPriority priority=osPriorityNormal,
87
96
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 );
90
99
}
91
100
92
101
/* * Create a new thread, and start it executing the specified function.
@@ -427,12 +436,12 @@ class Thread : private mbed::NonCopyable<Thread> {
427
436
void constructor (osPriority priority=osPriorityNormal,
428
437
uint32_t stack_size=OS_STACK_SIZE,
429
438
unsigned char *stack_mem=NULL ,
430
- const char *name=NULL );
439
+ const char *name=NULL , uint32_t tz_module=TZ_DEFAULT_ACCESS );
431
440
void constructor (mbed::Callback<void ()> task,
432
441
osPriority priority=osPriorityNormal,
433
442
uint32_t stack_size=OS_STACK_SIZE,
434
443
unsigned char *stack_mem=NULL,
435
- const char *name=NULL);
444
+ const char *name=NULL, uint32_t tz_module=TZ_DEFAULT_ACCESS );
436
445
static void _thunk (void * thread_ptr);
437
446
438
447
mbed::Callback<void ()> _task;
0 commit comments