Lines Matching +full:stack +full:- +full:size

2  * Copyright (c) 2013-2014 Wind River Systems, Inc.
4 * SPDX-License-Identifier: Apache-2.0
12 * included by the kernel interface architecture-abstraction header
60 /* Cortex-M MEMFAULT exceptions */
68 /* Cortex-M BUSFAULT exceptions */
77 /* Cortex-M USAGEFAULT exceptions */
87 /* Cortex-M SECURE exceptions */
97 /* Cortex-A/R exceptions*/
116 * Denotes the required alignment of the stack pointer on public API
127 * @brief Declare the minimum alignment for a thread stack
129 * Denotes the minimum required alignment of a thread stack.
144 * @brief Declare a minimum MPU guard alignment and size
146 * This specifies the minimum MPU guard alignment/size for the MPU. This
147 * will be used to denote the guard section of the stack, if it exists.
150 * the stack. APIs which give the stack ptr and stack size will take this
151 * guard size into account.
153 * Stack is allocated, but initial stack pointer is at the end
154 * (highest address). Stack grows down to the actual allocation
155 * address (lowest address). Stack guard, if present, will comprise
156 * the lowest MPU_GUARD_ALIGN_AND_SIZE bytes of the stack.
159 * below the trapping region as a stack fault will end up storing
160 * the exception data (0x20 bytes) onto the stack below wherever
161 * the stack pointer refers, even if that is within the guard region,
162 * so we make sure the region is strictly larger than this size by
163 * setting it to 0x40 (to respect any power-of-two requirements).
165 * As the stack grows down, it will reach the end of the stack when it
166 * encounters either the stack guard region, or the stack allocation
169 * ----------------------- <---- Stack allocation address + stack size +
171 * | Some thread data | <---- Defined when thread is created
173 * |---------------------| <---- Actual initial stack ptr
174 * | Initial Stack Ptr | aligned to ARCH_STACK_PTR_ALIGN
183 * | Stack Ends |
184 * |---------------------- <---- Stack Buffer Ptr from API
187 * ----------------------- <---- Stack Allocation address
202 * @brief Declare the MPU guard alignment and size for a thread stack
206 * Registers (CONFIG_FPU_SHARING=y) mode, the exception stack frame may
207 * contain both the basic stack frame and the FP caller-saved context,
209 * guarantee that stack-overflow detection will always be successful.
226 * whether the MPU architecture enforces a size (and power-of-two) alignment
239 * their own size. Since an MPU region must be able to cover the entire
240 * user-accessible stack buffer, we size/align to match. The privilege
241 * mode stack is generated elsewhere in memory.
243 #define ARCH_THREAD_STACK_OBJ_ALIGN(size) Z_POW2_CEIL(size) argument
244 #define ARCH_THREAD_STACK_SIZE_ADJUST(size) Z_POW2_CEIL(size) argument
246 #define ARCH_THREAD_STACK_OBJ_ALIGN(size) MAX(Z_THREAD_MIN_STACK_ALIGN, \ argument
249 #define ARCH_THREAD_STACK_SIZE_ADJUST(size) \ argument
250 ROUND_UP(size, CONFIG_ARM_MPU_REGION_MIN_ALIGN_AND_SIZE)
255 /* Kernel-only stacks need an MPU guard region programmed at the beginning of
256 * the stack object, so align the object appropriately.
262 /* On arm, all MPU guards are carve-outs. */