/Zephyr-Core-3.7.0/kernel/ |
D | stack.c | 8 * @brief fixed-size stack object 27 void k_stack_init(struct k_stack *stack, stack_data_t *buffer, in k_stack_init() argument 30 z_waitq_init(&stack->wait_q); in k_stack_init() 31 stack->lock = (struct k_spinlock) {}; in k_stack_init() 32 stack->next = buffer; in k_stack_init() 33 stack->base = buffer; in k_stack_init() 34 stack->top = stack->base + num_entries; in k_stack_init() 36 SYS_PORT_TRACING_OBJ_INIT(k_stack, stack); in k_stack_init() 37 k_object_init(stack); in k_stack_init() 40 k_obj_core_init_and_link(K_OBJ_CORE(stack), &obj_type_stack); in k_stack_init() [all …]
|
D | dynamic.c | 27 k_thread_stack_t *stack; member 43 k_thread_stack_t *stack; in z_thread_stack_alloc_pool() local 46 LOG_DBG("stack size %zu is > pool stack size %d", size, in z_thread_stack_alloc_pool() 53 LOG_DBG("unable to allocate stack from pool"); in z_thread_stack_alloc_pool() 59 stack = (k_thread_stack_t *)&dynamic_stack[offset]; in z_thread_stack_alloc_pool() 61 return stack; in z_thread_stack_alloc_pool() 70 /* Dynamic user stack needs a kobject, so if this option is not in stack_alloc_dyn() 83 k_thread_stack_t *stack = NULL; in z_impl_k_thread_stack_alloc() local 86 stack = stack_alloc_dyn(size, flags); in z_impl_k_thread_stack_alloc() 87 if (stack == NULL && CONFIG_DYNAMIC_THREAD_POOL_SIZE > 0) { in z_impl_k_thread_stack_alloc() [all …]
|
/Zephyr-Core-3.7.0/include/zephyr/kernel/ |
D | thread_stack.h | 14 * @brief Thread Stack APIs 16 * @defgroup thread_stack_api Thread Stack APIs 36 * declared symbol for a stack (of type k_thread_stack_t) and the underlying 37 * buffer which composes the stack data actually used by the underlying 39 * stack buffer region with guard areas that trigger a MPU or MMU fault 60 * @brief Properly align a CPU stack pointer value 66 * @param ptr Proposed stack pointer address 67 * @return Properly aligned stack pointer address 76 * @brief Helper macro for getting a stack frame struct 81 * Given a type and an initial stack pointer, return a properly cast [all …]
|
/Zephyr-Core-3.7.0/modules/canopennode/ |
D | CMakeLists.txt | 11 ${CANOPENNODE_DIR}/stack 17 ${CANOPENNODE_DIR}/stack/CO_Emergency.c 18 ${CANOPENNODE_DIR}/stack/CO_HBconsumer.c 19 ${CANOPENNODE_DIR}/stack/CO_LSSmaster.c 20 ${CANOPENNODE_DIR}/stack/CO_LSSslave.c 21 ${CANOPENNODE_DIR}/stack/CO_NMT_Heartbeat.c 22 ${CANOPENNODE_DIR}/stack/CO_PDO.c 23 ${CANOPENNODE_DIR}/stack/CO_SDO.c 24 ${CANOPENNODE_DIR}/stack/CO_SDOmaster.c 25 ${CANOPENNODE_DIR}/stack/CO_SYNC.c [all …]
|
/Zephyr-Core-3.7.0/arch/arm/core/ |
D | userspace.S | 50 /* prepare to set stack to privileged stack */ 57 ldr r0, [r0, r1] /* priv stack ptr */ 63 ldr r0, [r0, #_thread_offset_to_priv_stack_start] /* priv stack ptr */ 67 ldr r0, [r0, #_thread_offset_to_priv_stack_start] /* priv stack ptr */ 73 str r0, [ip, #_thread_offset_to_priv_stack_end] /* priv stack end */ 76 /* store current stack pointer to ip 77 * the current stack pointer is needed to retrieve 85 /* set stack to privileged stack 88 * modifying PSP via MSR instruction is not subject to stack limit 90 * The operation is safe since, by design, the privileged stack is [all …]
|
/Zephyr-Core-3.7.0/tests/kernel/stack/stack/src/ |
D | test_stack_fail.c | 16 extern struct k_stack stack; 24 /**TESTPOINT: stack pop returns -EBUSY*/ in stack_pop_fail() 26 /**TESTPOINT: stack pop returns -EAGAIN*/ in stack_pop_fail() 38 zassert_true(k_stack_pop(p1, p2, K_FOREVER), "stack pop failed\n"); in tStack_pop_entry() 42 * @brief Verifies stack pop functionality 47 k_stack_init(&stack, data, STACK_LEN); in ZTEST() 49 stack_pop_fail(&stack); in ZTEST() 53 * @brief Verifies cleanup a stack that still be needed by another 61 k_stack_init(&stack, data, STACK_LEN); in ZTEST() 64 tStack_pop_entry, &stack, in ZTEST() [all …]
|
D | test_stack_contexts.c | 18 struct k_stack stack; variable 32 /**TESTPOINT: stack push*/ in tstack_push() 42 /**TESTPOINT: stack pop*/ in tstack_pop() 70 /**TESTPOINT: thread-thread data passing via stack*/ in tstack_thread_thread() 88 /**TESTPOINT: thread-isr data passing via stack*/ in tstack_thread_isr() 102 * @brief Test to verify data passing between threads via stack 106 * Current thread push or pop data item into the stack. 107 * Create a new thread pop or push data item into the stack. 109 * Verify data passing between threads via stack 110 * And verify stack can be define at compile time. [all …]
|
/Zephyr-Core-3.7.0/doc/kernel/services/data_passing/ |
D | stacks.rst | 6 A :dfn:`stack` is a kernel object that implements a traditional 17 Any number of stacks can be defined (limited only by available RAM). Each stack 20 A stack has the following key properties: 30 A stack must be initialized before it can be used. This sets its queue to empty. 32 A data value can be **added** to a stack by a thread or an ISR. 38 and prevent attempts to add a data value to a stack that has already reached 39 its maximum quantity of queued values. Adding a data value to a stack that is 42 A data value may be **removed** from a stack by a thread. 43 If the stack's queue is empty a thread may choose to wait for it to be given. 44 Any number of threads may wait on an empty stack simultaneously. [all …]
|
/Zephyr-Core-3.7.0/tests/kernel/threads/thread_stack/src/ |
D | main.c | 15 * Stack testing 28 K_KERNEL_STACK_MEMBER(stack, STEST_STACKSIZE); 67 k_thread_stack_t *stack; member 78 /* Stack size stored in kernel object metadata if a user stack */ 81 /* Return value of sizeof(stack) */ 84 /* Return value of K_{THREAD|KERNEL}_STACK_SIZEOF(stack) */ 90 /* Whether this stack is part of an array of thread stacks */ 111 stack_obj = scenario_data.stack; in stack_buffer_scenarios() 146 /* Assert that the created stack object, with the reserved data in stack_buffer_scenarios() 150 "bad stack size in object"); in stack_buffer_scenarios() [all …]
|
/Zephyr-Core-3.7.0/arch/xtensa/core/ |
D | window_vectors.S | 49 * a5 is call[j+1]'s stack pointer. 56 s32e a0, a5, -16 /* save a0 to call[j+1]'s stack frame */ 57 s32e a1, a5, -12 /* save a1 to call[j+1]'s stack frame */ 58 s32e a2, a5, -8 /* save a2 to call[j+1]'s stack frame */ 59 s32e a3, a5, -4 /* save a3 to call[j+1]'s stack frame */ 71 * a5 is call[i+1]'s stack pointer. 78 l32e a0, a5, -16 /* restore a0 from call[i+1]'s stack frame */ 79 l32e a1, a5, -12 /* restore a1 from call[i+1]'s stack frame */ 80 l32e a2, a5, -8 /* restore a2 from call[i+1]'s stack frame */ 81 l32e a3, a5, -4 /* restore a3 from call[i+1]'s stack frame */ [all …]
|
/Zephyr-Core-3.7.0/subsys/net/ip/ |
D | Kconfig.stack | 1 # Stack usage related options 6 menu "Stack usage" 9 int "TX thread stack size" 12 Set the TX thread stack size in bytes. The TX thread is waiting 15 This value is a baseline and the actual TX stack size might 19 int "RX thread stack size" 22 Set the RX thread stack size in bytes. The RX thread is waiting 24 This value is a baseline and the actual RX stack size might
|
/Zephyr-Core-3.7.0/lib/utils/ |
D | rb.c | 74 * should be, leaving all nodes found in the resulting stack. Note 75 * that tree must not be empty and that stack should be allocated to 77 * entries pushed onto the stack. 80 struct rbnode **stack) in find_and_stack() argument 84 stack[sz] = tree->root; in find_and_stack() 87 while (stack[sz - 1] != node) { in find_and_stack() 88 uint8_t side = tree->lessthan_fn(node, stack[sz - 1]) ? 0U : 1U; in find_and_stack() 89 struct rbnode *ch = get_child(stack[sz - 1], side); in find_and_stack() 92 stack[sz] = ch; in find_and_stack() 121 * stack, modifying the stack accordingly. Does not change the color [all …]
|
/Zephyr-Core-3.7.0/doc/kernel/usermode/ |
D | mpu_stack_objects.rst | 3 MPU Stack Objects 6 Thread Stack Creation 14 implementation of other features such as stack protection and userspace. The 19 Stack Guards 22 Stack protection mechanisms require hardware support that can restrict access 28 Stack guards are implemented by using a single MPU region and setting the 30 occur, a fault ensues. The stack guard is defined at the bottom (the lowest 31 address) of the stack. 36 During stack creation, a set of constraints are enforced on the allocation of 37 memory. These constraints include determining the alignment of the stack and [all …]
|
D | mpu_userspace.rst | 7 set of stacks. These stacks exist in a 1:1 relationship with each thread stack 12 ELF file and finds all of the thread stack objects. A set of privileged 16 During the process of dropping a thread to user mode, the privileged stack 18 infrastructure to configure the MPU regions properly for the thread stack and 23 to privileged mode, the stack is switched to use the privileged stack, and the 25 thread is set back to user mode and the stack is restored to the user stack.
|
/Zephyr-Core-3.7.0/tests/subsys/logging/log_stack/ |
D | testcase.yaml | 11 logging.stack.deferred: 14 logging.stack.deferred_no_opt: 21 logging.stack.immediate: 24 logging.stack.immediate_no_opt: 31 logging.stack.deferred_cpp: 35 logging.stack.deferred_cpp_no_opt: 42 logging.stack.immediate_cpp: 46 logging.stack.immediate_cpp_no_opt:
|
/Zephyr-Core-3.7.0/include/zephyr/arch/arm/ |
D | arch.h | 119 * Denotes the required alignment of the stack pointer on public API 130 * @brief Declare the minimum alignment for a thread stack 132 * Denotes the minimum required alignment of a thread stack. 150 * will be used to denote the guard section of the stack, if it exists. 153 * the stack. APIs which give the stack ptr and stack size will take this 156 * Stack is allocated, but initial stack pointer is at the end 157 * (highest address). Stack grows down to the actual allocation 158 * address (lowest address). Stack guard, if present, will comprise 159 * the lowest MPU_GUARD_ALIGN_AND_SIZE bytes of the stack. 162 * below the trapping region as a stack fault will end up storing [all …]
|
/Zephyr-Core-3.7.0/tests/bsim/bluetooth/mesh/tests_scripts/persistence/ |
D | cfg.sh | 13 -- -argstest stack-cfg=0 17 -- -argstest stack-cfg=0 21 -- -argstest stack-cfg=1 25 -- -argstest stack-cfg=1 29 -- -argstest stack-cfg=0 33 -- -argstest stack-cfg=0 37 -- -argstest stack-cfg=1 41 -- -argstest stack-cfg=1
|
/Zephyr-Core-3.7.0/arch/xtensa/include/ |
D | xtensa_stack.h | 17 * @defgroup xtensa_stack_internal_apis Xtensa Stack related Internal APIs 23 * @brief Check if memory region is within correct stack boundaries. 26 * correct stack boundaries: 27 * - Interrupt stack if servicing interrupts. 28 * - Privileged stack if in kernel mode doing syscalls. 29 * - Thread stack otherwise. 31 * @note When @ps == UINT32_MAX, it checks the whole range of stack 39 * @return True if memory region is outside stack bounds, false otherwise. 44 * @brief Check if frame pointer is within correct stack boundaries. 47 * within correct stack boundaries. Use @ref xtensa_is_outside_stack_bounds
|
D | xtensa_backtrace.h | 27 * This structure stores the backtrace information of a particular stack frame 30 * within a single stack. The next_pc represents the PC of the current 32 * is the last frame on the stack. 44 * Get the first frame of the current stack's backtrace 49 * - Flush CPU registers and window frames onto the current stack 50 * - Return PC and SP of function A (i.e. start of the stack's backtrace) 58 * @param[in] interrupted_stack Pointer to interrupted stack 66 * @brief Get the next frame on a stack for backtracing 68 * Given a stack frame(i), this function will obtain the next 69 * stack frame(i-1) on the same call stack (i.e. the caller of frame(i)). [all …]
|
/Zephyr-Core-3.7.0/arch/arm/core/cortex_a_r/ |
D | Kconfig | 31 int "Undefined Instruction and Abort stack size (in bytes)" 34 This option specifies the size of the stack used by the undefined 38 int "FIQ stack size (in bytes)" 41 This option specifies the size of the stack used by the FIQ handler. 44 int "SVC stack size (in bytes)" 47 This option specifies the size of the stack used by the SVC handler. 50 int "SYS stack size (in bytes)" 53 This option specifies the size of the stack used by the system mode. 146 int "Undefined Instruction and Abort stack size (in bytes)" 149 This option specifies the size of the stack used by the undefined [all …]
|
/Zephyr-Core-3.7.0/tests/kernel/threads/dynamic_thread_stack/src/ |
D | main.c | 43 k_thread_stack_t *stack; in ZTEST_USER() local 57 stack = k_thread_stack_alloc(CONFIG_DYNAMIC_THREAD_STACK_SIZE, K_USER); in ZTEST_USER() 58 zassert_not_null(stack); in ZTEST_USER() 63 tid = k_thread_create(th, stack, CONFIG_DYNAMIC_THREAD_STACK_SIZE, func, in ZTEST_USER() 71 zassert_ok(k_thread_stack_free(stack)); in ZTEST_USER() 74 /** @brief Exercise the pool-based thread stack allocator */ 79 static k_thread_stack_t *stack[CONFIG_DYNAMIC_THREAD_POOL_SIZE]; in ZTEST() local 87 stack[i] = k_thread_stack_alloc(CONFIG_DYNAMIC_THREAD_STACK_SIZE, in ZTEST() 90 zassert_not_null(stack[i]); in ZTEST() 107 tid[i] = k_thread_create(&th[i], stack[i], in ZTEST() [all …]
|
/Zephyr-Core-3.7.0/subsys/usb/device_next/ |
D | Kconfig | 6 bool "New USB device stack [EXPERIMENTAL]" 11 New experimental USB device stack. 32 int "USB device stack thread stack size" 35 USB device stack thread stack size in bytes. 55 Message work may need to be delayed because the device stack is not
|
/Zephyr-Core-3.7.0/subsys/usb/host/ |
D | Kconfig | 6 bool "USB host stack [EXPERIMENTAL]" 10 New experimental USB host stack. 31 int "USB host stack thread stack size" 34 USB host stack thread stack size in bytes.
|
/Zephyr-Core-3.7.0/tests/kernel/mem_protect/stackprot/src/ |
D | main.c | 44 check_input(name, "Stack ok"); in print_loop() 57 * When stack protection feature is enabled (see prj.conf file), the 58 * system error handler is invoked and reports a "Stack Check Fail" error. 59 * When stack protection feature is not enabled, the system crashes with 66 /* Stack will overflow when input is more than 16 characters */ in check_input() 76 * to stack overflow and reports "Stack Check Fail" when stack protection 89 "Input string is too long and stack overflowed!\n"); in alternate_thread() 91 * Expect this thread to terminate due to stack check fail and will not in alternate_thread() 105 * @brief test Stack Protector feature using canary 107 * @details This is the test program to test stack protection using canary. [all …]
|
/Zephyr-Core-3.7.0/arch/arm64/core/ |
D | thread.c | 19 * Note about stack usage: 23 * - kernel threads are running in EL1 using SP_EL1 as stack pointer during 25 * running in a privileged stack that is their own. 27 * - user threads are running in EL0 using SP_EL0 as stack pointer during 29 * stack pointer switches to SP_EL1 and the execution starts using the 30 * privileged portion of the user stack without touching SP_EL0. This portion 33 * - a stack guard region will be added bellow the kernel stack when 35 * to the safe exception stack in the kernel space. For the kernel thread, 36 * SP_EL0 will not change always pointing to safe exception stack. For the 37 * userspace thread, SP_EL0 will switch from the user stack to the safe [all …]
|