Skip to content

Commit d089622

Browse files
tangyoulingakpm00
authored andcommitted
checkstack: add loongarch support for scripts/checkstack.pl
scripts/checkstack.pl lacks support for the loongarch architecture. Add support to detect "addi.{w,d} $sp, $sp, -FRAME_SIZE" stack frame generation instruction. Link: https://lkml.kernel.org/r/MW4PR84MB314514273F0B7DBCC5E35A978192A@MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Acked-by: Huacai Chen <chenhuacai@loongson.cn> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent d738bce commit d089622

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/checkstack.pl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
1717
# ppc64le port by Breno Leitao <leitao@debian.org>
1818
# riscv port by Wadim Mueller <wafgo01@gmail.com>
19+
# loongarch port by Youling Tang <tangyouling@kylinos.cn>
1920
#
2021
# Usage:
2122
# objdump -d vmlinux | scripts/checkstack.pl [arch]
@@ -104,6 +105,9 @@
104105
} elsif ($arch =~ /^riscv(64)?$/) {
105106
#ffffffff8036e868: c2010113 addi sp,sp,-992
106107
$re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
108+
} elsif ($arch =~ /^loongarch(32|64)?$/) {
109+
#9000000000224708: 02ff4063 addi.d $sp, $sp, -48(0xfd0)
110+
$re = qr/.*addi\..*sp, .*sp, -([0-9]{1,8}).*/o;
107111
} else {
108112
print("wrong or unknown architecture \"$arch\"\n");
109113
exit

0 commit comments

Comments
 (0)