diff options
author | WANG Xuerui <git@xen0n.name> | 2022-07-26 23:57:16 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2022-07-29 18:22:32 +0800 |
commit | d8e7f201a4cf148c3801cdc9603963061d28d64f (patch) | |
tree | 5bbe5881044a3dcb4ad37fc59a49f9c9e815c3db /arch/loongarch/include/asm/stacktrace.h | |
parent | e0dccc3b76fb35bb257b4118367a883073d7390e (diff) | |
download | lwn-d8e7f201a4cf148c3801cdc9603963061d28d64f.tar.gz lwn-d8e7f201a4cf148c3801cdc9603963061d28d64f.zip |
LoongArch: Use ABI names of registers where appropriate
Some of the assembly in the LoongArch port seem to come from a
prehistoric time, when the assembler didn't even have support for the
ABI names we all come to know and love, thus used raw register numbers
which hampered readability.
The usages are found with a regex match inside arch/loongarch, then
manually adjusted for those non-definitions.
Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include/asm/stacktrace.h')
-rw-r--r-- | arch/loongarch/include/asm/stacktrace.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/loongarch/include/asm/stacktrace.h b/arch/loongarch/include/asm/stacktrace.h index 26483e396ad1..6b5c2a7aa706 100644 --- a/arch/loongarch/include/asm/stacktrace.h +++ b/arch/loongarch/include/asm/stacktrace.h @@ -23,13 +23,13 @@ static __always_inline void prepare_frametrace(struct pt_regs *regs) { __asm__ __volatile__( - /* Save $r1 */ + /* Save $ra */ STORE_ONE_REG(1) - /* Use $r1 to save PC */ - "pcaddi $r1, 0\n\t" - STR_LONG_S " $r1, %0\n\t" - /* Restore $r1 */ - STR_LONG_L " $r1, %1, "STR_LONGSIZE"\n\t" + /* Use $ra to save PC */ + "pcaddi $ra, 0\n\t" + STR_LONG_S " $ra, %0\n\t" + /* Restore $ra */ + STR_LONG_L " $ra, %1, "STR_LONGSIZE"\n\t" STORE_ONE_REG(2) STORE_ONE_REG(3) STORE_ONE_REG(4) |