unofficial-rtos-docs

Chapter 3 ThreadX APIs for ARMv8-M

This chapter contains a description of the ARMv8-M-specific ThreadX services in alphabetic order. Their names are designed so all similar services are grouped together. In the “Return Values” section in the following descriptions, values in BOLD are not affected by the TX_DISABLE_ERROR_CHECKING define used to disable API error checking; while values shown in non-bold are completely disabled.

tx_thread_secure_stack_allocate

Allocate a thread stack in secure memory.

Prototype

UINT tx_thread_secure_stack_allocate(
    TX_THREAD *thread_ptr, 
    ULONG stack_size);

Description

This service allocates a stack of size stack_size bytes in secure memory. This function should be called for every thread that calls secure functions.

Input Parameters

Return Values

Allowed From

Initialization, threads

Example

/* Create thread.  */
tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0, pointer, DEMO_STACK_SIZE, 1, 1, TX_NO_TIME_SLICE, TX_AUTO_START);

/* Allocate secure stack so this thread can call secure functions.  */
status = tx_thread_secure_stack_allocate(&thread_0, 256);

/* If status is TX_SUCCESS the request was successful.  */

See Also

tx_thread_secure_stack_free

tx_thread_secure_stack_free

Free a thread stack in secure memory.

Prototype

UINT tx_thread_secure_stack_free(TX_THREAD *thread_ptr);

Description

This service frees a thread’s secure stack in secure memory. This function should be called if a thread has a secure stack and when the thread no longer needs to call secure functions or the thread is deleted.

Input Parameters

Return Values

Allowed From

Initialization, threads

Example

/* Free thread's secure stack.  */
status = tx_thread_secure_stack_free(&thread_0);

/* If status is TX_SUCCESS the request was successful.  */

/* Delete thread.  */
tx_thread_delete(&thread_0);

See Also

tx_thread_secure_stack_allocate