@@ -72,16 +72,16 @@ namespace rtos {
72
72
* Memory considerations: The thread control structures will be created on current thread's stack, both for the mbed OS
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
+ *
76
+ * @note
77
+ * MBED_TZ_DEFAULT_ACCESS (default:0) flag can be used to change the default access of all user threads in non-secure mode.
78
+ * MBED_TZ_DEFAULT_ACCESS set to 1, means all non-secure user threads have access to call secure functions.
79
+ * MBED_TZ_DEFAULT_ACCESS set to 0, means none of the non-secure user thread have access to call secure functions,
80
+ * to give access to particular thread used overloaded constructor with `tz_module` as argument during thread creation.
81
+ *
82
+ * MBED_TZ_DEFAULT_ACCESS is target specific define, should be set in targets.json file for Cortex-M23/M33 devices.
75
83
*/
76
84
77
- /* This flag can be used to change the default access of all threads in non-secure mode.
78
- MBED_TZ_DEFAULT_ACCESS set to 1, means all non-secure threads have access to call secure functions.
79
- MBED_TZ_DEFAULT_ACCESS is target specific define, should be set in targets.json file for Cortex-M23/M33 devices.
80
- */
81
- #ifndef MBED_TZ_DEFAULT_ACCESS
82
- #define MBED_TZ_DEFAULT_ACCESS 0
83
- #endif
84
-
85
85
class Thread : private mbed ::NonCopyable<Thread> {
86
86
public:
87
87
/* * Allocate a new thread without starting execution
@@ -102,6 +102,9 @@ class Thread : private mbed::NonCopyable<Thread> {
102
102
103
103
/* * Allocate a new thread without starting execution
104
104
@param tz_module trustzone thread identifier (osThreadAttr_t::tz_module)
105
+ Context of RTOS threads in non-secure state must be saved when calling secure functions.
106
+ tz_module ID is used to allocate context memory for threads, and it can be safely set to zero for
107
+ threads not using secure calls at all. See "TrustZone RTOS Context Management" for more details.
105
108
@param priority initial priority of the thread function. (default: osPriorityNormal).
106
109
@param stack_size stack size (in bytes) requirements for the thread function. (default: OS_STACK_SIZE).
107
110
@param stack_mem pointer to the stack area to be used by this thread (default: NULL).
0 commit comments