diff options
author | Qing Zhang <zhangqing@loongson.cn> | 2022-08-06 10:10:03 +0200 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2022-08-12 07:10:11 +0200 |
commit | 49aef111e2dae176a7708b532118f33f24289248 (patch) | |
tree | 394ff32e5dba1e22ebac5015fe3164e7ed2e8a77 /arch/loongarch/include/asm/unwind.h | |
parent | LoongArch: Add guess unwinder support (diff) | |
download | linux-49aef111e2dae176a7708b532118f33f24289248.tar.xz linux-49aef111e2dae176a7708b532118f33f24289248.zip |
LoongArch: Add prologue unwinder support
It unwind the stack frame based on prologue code analyze.
CONFIG_KALLSYMS is needed, at least the address and length
of each function.
Three stages when we do unwind,
1) unwind_start(), the prapare of unwinding, fill unwind_state.
2) unwind_done(), judge whether the unwind process is finished or not.
3) unwind_next_frame(), unwind the next frame.
Dividing unwinder helps to add new unwinders in the future, e.g.:
unwinder_frame, unwinder_orc, .etc.
Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include/asm/unwind.h')
-rw-r--r-- | arch/loongarch/include/asm/unwind.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/loongarch/include/asm/unwind.h b/arch/loongarch/include/asm/unwind.h index 206fcbe24c0a..6af4718bdf01 100644 --- a/arch/loongarch/include/asm/unwind.h +++ b/arch/loongarch/include/asm/unwind.h @@ -11,11 +11,17 @@ #include <asm/stacktrace.h> +enum unwinder_type { + UNWINDER_GUESS, + UNWINDER_PROLOGUE, +}; + struct unwind_state { + char type; /* UNWINDER_XXX */ struct stack_info stack_info; struct task_struct *task; bool first, error; - unsigned long sp, pc; + unsigned long sp, pc, ra; }; void unwind_start(struct unwind_state *state, |