summaryrefslogtreecommitdiff
path: root/arch/loongarch/include/asm/stackframe.h
diff options
context:
space:
mode:
authorQing Zhang <zhangqing@loongson.cn>2023-09-06 22:53:55 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2023-09-06 22:53:55 +0800
commite14dd076964ef11e9d6e3b06a2f1c6bb7d034133 (patch)
tree18cf9ddd3cc4b36b0e4d8b57a1ac7a281001af4a /arch/loongarch/include/asm/stackframe.h
parentbd3c5798484aa9a08302a844d7a75a2ee3b53d05 (diff)
downloadlwn-e14dd076964ef11e9d6e3b06a2f1c6bb7d034133.tar.gz
lwn-e14dd076964ef11e9d6e3b06a2f1c6bb7d034133.zip
LoongArch: Add basic KGDB & KDB support
KGDB is intended to be used as a source level debugger for the Linux kernel. It is used along with gdb to debug a Linux kernel. GDB can be used to "break in" to the kernel to inspect memory, variables and regs similar to the way an application developer would use GDB to debug an application. KDB is a frontend of KGDB which is similar to GDB. By now, in addition to the generic KGDB features, the LoongArch KGDB implements the following features: - Hardware breakpoints/watchpoints; - Software single-step support for KDB. Signed-off-by: Qing Zhang <zhangqing@loongson.cn> # Framework & CoreFeature Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> # BreakPoint & SingleStep Signed-off-by: Hui Li <lihui@loongson.cn> # Some Minor Improvements Signed-off-by: Randy Dunlap <rdunlap@infradead.org> # Some Build Error Fixes Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include/asm/stackframe.h')
-rw-r--r--arch/loongarch/include/asm/stackframe.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/loongarch/include/asm/stackframe.h b/arch/loongarch/include/asm/stackframe.h
index 7df80e6ae9d2..4fb1e6408b98 100644
--- a/arch/loongarch/include/asm/stackframe.h
+++ b/arch/loongarch/include/asm/stackframe.h
@@ -158,6 +158,10 @@
cfi_st u0, PT_R21, \docfi
csrrd u0, PERCPU_BASE_KS
9:
+#ifdef CONFIG_KGDB
+ li.w t0, CSR_CRMD_WE
+ csrxchg t0, t0, LOONGARCH_CSR_CRMD
+#endif
.endm
.macro SAVE_ALL docfi=0