Commit 3fc9272d authored by Paul Mundt's avatar Paul Mundt Committed by Linus Torvalds

[PATCH] sh64: Initial checkstack port

This provides a port of checkstack for sh64 for the simple frames
allocated as an immediate with a single instruction.

Stack frame creation on sh64 happens in a couple of different ways,
when the frame size is less than 511 bytes an addi or addi.l is
typically used, generally along the lines of something like:

	addi{,.l}	r15, -IMM_FRAME_SIZE, r15

For larger frames, this ends up getting split up into a
movi/sub pair:

	movi	IMM_FRAME_SIZE, rX
	sub	r15, rX, r15

We currently don't handle the split pair case, as basically
any register can be used, and there is no easy way to determine
what happens without scanning the prologue multiple times and
using some sort of register cache (we already do something
similar for the sh64 stack unwinder, but it would be preferable
not to do this in perl..).

This does have limited usefulness in that we are not easily able
to check for huge frames without manual inspection, but this is
still useful enough in the general case to be worth doing for
the addi/addi.l case as long as people are aware of this caveat.

It may be worth revisiting at a later point to try and catch the
larger users though.
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 99e68e9c
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
# Mips port by Juan Quintela <quintela@mandrakesoft.com> # Mips port by Juan Quintela <quintela@mandrakesoft.com>
# IA64 port via Andreas Dilger # IA64 port via Andreas Dilger
# Arm port by Holger Schurig # Arm port by Holger Schurig
# sh64 port by Paul Mundt
# Random bits by Matt Mackall <mpm@selenic.com> # Random bits by Matt Mackall <mpm@selenic.com>
# M68k port by Geert Uytterhoeven and Andreas Schwab # M68k port by Geert Uytterhoeven and Andreas Schwab
# #
...@@ -64,6 +65,12 @@ my (@stack, $re, $x, $xs); ...@@ -64,6 +65,12 @@ my (@stack, $re, $x, $xs);
} elsif ($arch =~ /^s390x?$/) { } elsif ($arch =~ /^s390x?$/) {
# 11160: a7 fb ff 60 aghi %r15,-160 # 11160: a7 fb ff 60 aghi %r15,-160
$re = qr/.*ag?hi.*\%r15,-(([0-9]{2}|[3-9])[0-9]{2})/o; $re = qr/.*ag?hi.*\%r15,-(([0-9]{2}|[3-9])[0-9]{2})/o;
} elsif ($arch =~ /^sh64$/) {
#XXX: we only check for the immediate case presently,
# though we will want to check for the movi/sub
# pair for larger users. -- PFM.
#a00048e0: d4fc40f0 addi.l r15,-240,r15
$re = qr/.*addi\.l.*r15,-(([0-9]{2}|[3-9])[0-9]{2}),r15/o;
} else { } else {
print("wrong or unknown architecture\n"); print("wrong or unknown architecture\n");
exit exit
......
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