]> git.baikalelectronics.ru Git - kernel.git/commit
LoongArch: Add prologue unwinder support
authorQing Zhang <zhangqing@loongson.cn>
Sat, 6 Aug 2022 08:10:03 +0000 (16:10 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Fri, 12 Aug 2022 05:10:11 +0000 (13:10 +0800)
commitbbd889cdc66a2d4a9a62382accaece1f6f135707
tree394ff32e5dba1e22ebac5015fe3164e7ed2e8a77
parentd18b369721a82871ec5066b300660ebb76736a99
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>
arch/loongarch/Kconfig.debug
arch/loongarch/include/asm/inst.h
arch/loongarch/include/asm/unwind.h
arch/loongarch/kernel/Makefile
arch/loongarch/kernel/traps.c
arch/loongarch/kernel/unwind_prologue.c [new file with mode: 0644]