Commit 8449a4cb authored by Breno Leitao's avatar Breno Leitao Committed by Michael Ellerman

scripts: Add ppc64le support for checkstack.pl

64-bit ELF v2 ABI specification for POWER describes, on section "General
Stack Frame Requirements", that the stack should use the following
instructions when compiled with backchain:

  mflr r0
  std  r0, 16(r1)
  stdu r1, -XX(r1)

Where XX is the frame size for that function, and this is the value
checkstack.pl will find the stack size for each function.

This patch also simplifies the entire Powerpc section, since just two
type of instructions are used, 'stdu' for 64 bits and 'stwu' for 32 bits
platform.
Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 8272f598
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# M68k port by Geert Uytterhoeven and Andreas Schwab # M68k port by Geert Uytterhoeven and Andreas Schwab
# AArch64, PARISC ports by Kyle McMartin # AArch64, PARISC ports by Kyle McMartin
# sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk> # sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
# ppc64le port by Breno Leitao <leitao@debian.org>
# #
# Usage: # Usage:
# objdump -d vmlinux | scripts/checkstack.pl [arch] # objdump -d vmlinux | scripts/checkstack.pl [arch]
...@@ -78,13 +79,9 @@ my (@stack, $re, $dre, $x, $xs, $funcre); ...@@ -78,13 +79,9 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
$re = qr/.*l\.addi.*r1,r1,-(([0-9]{2}|[3-9])[0-9]{2})/o; $re = qr/.*l\.addi.*r1,r1,-(([0-9]{2}|[3-9])[0-9]{2})/o;
} elsif ($arch eq 'parisc' || $arch eq 'parisc64') { } elsif ($arch eq 'parisc' || $arch eq 'parisc64') {
$re = qr/.*ldo ($x{1,8})\(sp\),sp/o; $re = qr/.*ldo ($x{1,8})\(sp\),sp/o;
} elsif ($arch eq 'ppc') { } elsif ($arch eq 'powerpc' || $arch =~ /^ppc(64)?(le)?$/ ) {
#c00029f4: 94 21 ff 30 stwu r1,-208(r1) # powerpc : 94 21 ff 30 stwu r1,-208(r1)
$re = qr/.*stwu.*r1,-($x{1,8})\(r1\)/o; # ppc64(le) : 81 ff 21 f8 stdu r1,-128(r1)
} elsif ($arch eq 'ppc64') {
#XXX
$re = qr/.*stdu.*r1,-($x{1,8})\(r1\)/o;
} elsif ($arch eq 'powerpc') {
$re = qr/.*st[dw]u.*r1,-($x{1,8})\(r1\)/o; $re = qr/.*st[dw]u.*r1,-($x{1,8})\(r1\)/o;
} elsif ($arch =~ /^s390x?$/) { } elsif ($arch =~ /^s390x?$/) {
# 11160: a7 fb ff 60 aghi %r15,-160 # 11160: a7 fb ff 60 aghi %r15,-160
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment