Commit e0770d45 authored by Yong Cong Sin's avatar Yong Cong Sin Committed by Anas Nashif
Browse files

arch: document `arch_stack_walk()`



Add `arch_stack_walk()` under the `arch-interface` group and
add documentation on how to add support for it.

Signed-off-by: default avatarYong Cong Sin <ycsin@meta.com>
Signed-off-by: default avatarYong Cong Sin <yongcong.sin@gmail.com>
parent 3968753b
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1251,6 +1251,17 @@ bool arch_pcie_msi_vector_connect(msi_vector_t *vector,
 */
void arch_spin_relax(void);

/**
 * @defgroup arch-stackwalk Architecture-specific Stack Walk APIs
 * @ingroup arch-interface
 *
 * To add API support to an architecture, `arch_stack_walk()` should be implemented and a non-user
 * configurable Kconfig `ARCH_HAS_STACKWALK` that is default to `y` should be created in the
 * architecture's top level Kconfig, with all the relevant dependencies.
 *
 * @{
 */

/**
 * stack_trace_callback_fn - Callback for @ref arch_stack_walk
 * @param cookie Caller supplied pointer handed back by @ref arch_stack_walk
@@ -1278,6 +1289,11 @@ typedef bool (*stack_trace_callback_fn)(void *cookie, unsigned long addr);
void arch_stack_walk(stack_trace_callback_fn callback_fn, void *cookie,
		     const struct k_thread *thread, const struct arch_esf *esf);

/**
 * arch-stackwalk
 * @}
 */

#ifdef __cplusplus
}
#endif /* __cplusplus */