Lines Matching refs:thread
38 static inline bool in_kernel_thread_stack_bound(uintptr_t addr, const struct k_thread *const thread) in in_kernel_thread_stack_bound() argument
43 start = thread->stack_info.start; in in_kernel_thread_stack_bound()
44 end = Z_STACK_PTR_ALIGN(thread->stack_info.start + thread->stack_info.size); in in_kernel_thread_stack_bound()
49 ARG_UNUSED(thread); in in_kernel_thread_stack_bound()
56 static inline bool in_user_thread_stack_bound(uintptr_t addr, const struct k_thread *const thread) in in_user_thread_stack_bound() argument
62 start = thread->arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE; in in_user_thread_stack_bound()
64 start = thread->stack_info.start - CONFIG_PRIVILEGED_STACK_SIZE; in in_user_thread_stack_bound()
66 end = Z_STACK_PTR_ALIGN(thread->arch.priv_stack_start + K_KERNEL_STACK_RESERVED + in in_user_thread_stack_bound()
73 static bool in_stack_bound(uintptr_t addr, const struct k_thread *const thread, in in_stack_bound() argument
83 if ((thread->base.user_options & K_USER) != 0) { in in_stack_bound()
84 return in_user_thread_stack_bound(addr, thread); in in_stack_bound()
88 return in_kernel_thread_stack_bound(addr, thread); in in_stack_bound()
99 static void walk_stackframe(riscv_stacktrace_cb cb, void *cookie, const struct k_thread *thread, in walk_stackframe() argument
121 for (int i = 0; (i < MAX_STACK_FRAMES) && vrfy(fp, thread, esf) && (fp > last_fp); i++) { in walk_stackframe()
160 if (vrfy(frame->ra, thread, esf)) { in walk_stackframe()
172 static void walk_stackframe(riscv_stacktrace_cb cb, void *cookie, const struct k_thread *thread, in walk_stackframe() argument
195 for (int i = 0; (i < MAX_STACK_FRAMES) && vrfy((uintptr_t)ksp, thread, esf) && in walk_stackframe()
215 const struct k_thread *thread, const struct arch_esf *esf) in arch_stack_walk() argument
217 if (thread == NULL) { in arch_stack_walk()
219 thread = _current; in arch_stack_walk()
222 walk_stackframe((riscv_stacktrace_cb)callback_fn, cookie, thread, esf, in_stack_bound, in arch_stack_walk()
223 &thread->callee_saved); in arch_stack_walk()
227 static bool in_fatal_stack_bound(uintptr_t addr, const struct k_thread *const thread, in in_fatal_stack_bound() argument
234 if ((thread == NULL) || arch_is_in_isr()) { in in_fatal_stack_bound()
241 return in_stack_bound(addr, thread, esf); in in_fatal_stack_bound()