aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2012-01-13 17:20:15 +0200
committerPekka Enberg <penberg@kernel.org>2012-01-13 17:23:01 +0200
commit02b74cfc656c21563dccd564d66097dd7a939c85 (patch)
tree0cb6ef0ea77a4f4aa973762f5ce711d94d001d4a
parent15dacee29e048dbc0d6de81574dbabb0adeb715e (diff)
downloadjato-02b74cfc656c21563dccd564d66097dd7a939c85.tar.gz
x86-32: Fix stack frame size in generated prolog
The frame_locals_size() function returns stack frame size in bytes so just use the returned value in emit_prolog(). This fixes unnecessary large stack frames on x86-32. Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r--arch/x86/emit-code.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index 878d5819..c56cbfea 100644
--- a/arch/x86/emit-code.c
+++ b/arch/x86/emit-code.c
@@ -665,7 +665,7 @@ static void emit_test_imm_memdisp(struct insn *insn, struct buffer *buf, struct
}
void emit_prolog(struct buffer *buf, struct stack_frame *frame,
- unsigned long nr_locals)
+ unsigned long frame_size)
{
/* Unconditionally push callee-saved registers */
__emit_push_reg(buf, MACH_REG_EDI);
@@ -675,8 +675,8 @@ void emit_prolog(struct buffer *buf, struct stack_frame *frame,
__emit_push_reg(buf, MACH_REG_EBP);
__emit_mov_reg_reg(buf, MACH_REG_ESP, MACH_REG_EBP);
- if (nr_locals)
- __emit_sub_imm_reg(buf, nr_locals * sizeof(unsigned long), MACH_REG_ESP);
+ if (frame_size)
+ __emit_sub_imm_reg(buf, frame_size, MACH_REG_ESP);
}
void emit_epilog(struct buffer *buf)