Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions arch/riscv/core/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,19 @@ static inline bool in_irq_stack_bound(uintptr_t addr, uint8_t cpu_id)

static inline bool in_kernel_thread_stack_bound(uintptr_t addr, const struct k_thread *const thread)
{
#ifdef CONFIG_THREAD_STACK_INFO
uintptr_t start, end;

start = thread->stack_info.start;
end = Z_STACK_PTR_ALIGN(thread->stack_info.start + thread->stack_info.size);

return (addr >= start) && (addr < end);
#else
ARG_UNUSED(addr);
ARG_UNUSED(thread);
/* Return false as we can't check if the addr is in the thread stack without stack info */
return false;
#endif
}

#ifdef CONFIG_USERSPACE
Expand Down