summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWadim Mueller <wafgo01@gmail.com>2022-07-13 21:41:10 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2022-07-27 21:18:00 +0900
commit1fd49a0b5c4330ceefef4de498cec271e240aaf1 (patch)
tree6628e48f7b93692a901007987352f7b81769d679 /scripts
parent10269fd37fc60bda700dd2554ff382446d45771d (diff)
checkstack: add riscv support for scripts/checkstack.pl
scripts/checkstack.pl lacks support for the riscv architecture. Add support to detect "addi sp,sp,-FRAME_SIZE" stack frame generation instruction Signed-off-by: Wadim Mueller <wafgo01@gmail.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkstack.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index d2c38584ece6..d48dfed6d3db 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -16,6 +16,7 @@
# AArch64, PARISC ports by Kyle McMartin
# 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>
#
# Usage:
# objdump -d vmlinux | scripts/checkstack.pl [arch]
@@ -108,6 +109,9 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack);
} elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
# f0019d10: 9d e3 bf 90 save %sp, -112, %sp
$re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
+ } elsif ($arch =~ /^riscv(64)?$/) {
+ #ffffffff8036e868: c2010113 addi sp,sp,-992
+ $re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
} else {
print("wrong or unknown architecture \"$arch\"\n");
exit