Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
Macros for declaring thread stacks. More...
Go to the source code of this file.
Macros | |
#define | K_KERNEL_STACK_RESERVED ((size_t)0) |
#define | K_KERNEL_STACK_LEN(size) |
#define | K_KERNEL_STACK_DECLARE(sym, size) |
Declare a reference to a thread stack. | |
#define | K_KERNEL_STACK_ARRAY_DECLARE(sym, nmemb, size) |
Declare a reference to a thread stack array. | |
#define | K_KERNEL_PINNED_STACK_ARRAY_DECLARE(sym, nmemb, size) |
Declare a reference to a pinned thread stack array. | |
#define | K_KERNEL_STACK_DEFINE(sym, size) |
Define a toplevel kernel stack memory region. | |
#define | K_KERNEL_PINNED_STACK_DEFINE(sym, size) |
Define a toplevel kernel stack memory region in pinned section. | |
#define | K_KERNEL_STACK_ARRAY_DEFINE(sym, nmemb, size) |
Define a toplevel array of kernel stack memory regions. | |
#define | K_KERNEL_PINNED_STACK_ARRAY_DEFINE(sym, nmemb, size) |
Define a toplevel array of kernel stack memory regions in pinned section. | |
#define | K_KERNEL_STACK_MEMBER(sym, size) |
Define an embedded stack memory region. | |
#define | K_KERNEL_STACK_SIZEOF(sym) |
#define | K_THREAD_STACK_RESERVED ((size_t)0U) |
Indicate how much additional memory is reserved for stack objects. | |
#define | K_THREAD_STACK_DECLARE(sym, size) |
Declare a reference to a thread stack. | |
#define | K_THREAD_STACK_ARRAY_DECLARE(sym, nmemb, size) |
Declare a reference to a thread stack array. | |
#define | K_THREAD_STACK_SIZEOF(sym) |
Return the size in bytes of a stack memory region. | |
#define | K_THREAD_STACK_DEFINE(sym, size) |
Define a toplevel thread stack memory region. | |
#define | K_THREAD_PINNED_STACK_DEFINE(sym, size) |
Define a toplevel thread stack memory region in pinned section. | |
#define | K_THREAD_STACK_LEN(size) |
Calculate size of stacks to be allocated in a stack array. | |
#define | K_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) |
Define a toplevel array of thread stack memory regions. | |
#define | K_THREAD_PINNED_STACK_ARRAY_DEFINE(sym, nmemb, size) |
Define a toplevel array of thread stack memory regions in pinned section. | |
Functions | |
static char * | K_KERNEL_STACK_BUFFER (k_thread_stack_t *sym) |
static char * | K_THREAD_STACK_BUFFER (k_thread_stack_t *sym) |
Get a pointer to the physical stack buffer. | |
Macros for declaring thread stacks.
#define K_KERNEL_STACK_LEN | ( | size | ) |
#define K_KERNEL_STACK_RESERVED ((size_t)0) |
#define K_THREAD_STACK_RESERVED ((size_t)0U) |
Indicate how much additional memory is reserved for stack objects.
Any given stack declaration may have additional memory in it for guard areas, supervisor mode stacks, or platform-specific data. This macro indicates how much space is reserved for this.
This value only indicates memory that is permanently reserved in the stack object. Memory that is "borrowed" from the thread's stack buffer is never accounted for here.
Reserved memory is at the beginning of the stack object. The reserved area must be appropriately sized such that the stack buffer immediately following it is correctly aligned.
|
inlinestatic |
|
inlinestatic |
Get a pointer to the physical stack buffer.
Obtain a pointer to the non-reserved area of a stack object. This is not guaranteed to be the beginning of the thread-writable region; this does not account for any memory carved-out for MPU stack overflow guards.
Use with care. The true bounds of the stack buffer are available in the stack_info member of its associated thread.
sym | defined stack symbol name |