summaryrefslogtreecommitdiff
path: root/scripts/checkstack.pl
diff options
context:
space:
mode:
authorYouling Tang <tangyouling@kylinos.cn>2023-12-16 09:40:54 +0300
committerAndrew Morton <akpm@linux-foundation.org>2023-12-29 23:22:25 +0300
commitd089622b32c389d6d6a1fa6bbd9e3f121b9bcd5b (patch)
treea1ab34663849d23ffae57f7b85693be50b1fca3b /scripts/checkstack.pl
parentd738bced865a1473ea9a5e54734def2d40052e0c (diff)
downloadlinux-d089622b32c389d6d6a1fa6bbd9e3f121b9bcd5b.tar.xz
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>
Diffstat (limited to 'scripts/checkstack.pl')
-rwxr-xr-xscripts/checkstack.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 13408714ba0f..7d3de232cb35 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -16,6 +16,7 @@
# sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
# ppc64le port by Breno Leitao <leitao@debian.org>
# riscv port by Wadim Mueller <wafgo01@gmail.com>
+# loongarch port by Youling Tang <tangyouling@kylinos.cn>
#
# Usage:
# objdump -d vmlinux | scripts/checkstack.pl [arch]
@@ -104,6 +105,9 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack);
} elsif ($arch =~ /^riscv(64)?$/) {
#ffffffff8036e868: c2010113 addi sp,sp,-992
$re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
+ } elsif ($arch =~ /^loongarch(32|64)?$/) {
+ #9000000000224708: 02ff4063 addi.d $sp, $sp, -48(0xfd0)
+ $re = qr/.*addi\..*sp, .*sp, -([0-9]{1,8}).*/o;
} else {
print("wrong or unknown architecture \"$arch\"\n");
exit