aboutsummaryrefslogtreecommitdiff
path: root/tcg/tci/tcg-target.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-03-28 05:37:55 +0000
committerStefan Weil <sw@weilnetz.de>2013-04-11 19:58:21 +0200
commitee79c356ffe18eea90ea4bbde2057cebe6bb654f (patch)
treea7666d3485225c6a5bd9378b464bbf91fff2a983 /tcg/tci/tcg-target.c
parent4699ca6dbf335b0c38e291a530c6ad85e599253d (diff)
tci: Make tcg temporaries local to tcg_qemu_tb_exec
We're moving away from the temporaries stored in env. Make sure we can differentiate between temp stores and possibly bogus stores for extra call arguments. Move TCG_AREG0 and TCG_REG_CALL_STACK out of the way of the parameter passing registers. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'tcg/tci/tcg-target.c')
-rw-r--r--tcg/tci/tcg-target.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tcg/tci/tcg-target.c b/tcg/tci/tcg-target.c
index b096a84805..d1241b5692 100644
--- a/tcg/tci/tcg-target.c
+++ b/tcg/tci/tcg-target.c
@@ -40,11 +40,6 @@
/* Bitfield n...m (in 32 bit value). */
#define BITS(n, m) (((0xffffffffU << (31 - n)) >> (31 - n + m)) << m)
-/* Used for function call generation. */
-#define TCG_REG_CALL_STACK TCG_REG_R4
-#define TCG_TARGET_STACK_ALIGN 16
-#define TCG_TARGET_CALL_STACK_OFFSET 0
-
/* Macros used in tcg_target_op_defs. */
#define R "r"
#define RI "ri"
@@ -901,10 +896,15 @@ static void tcg_target_init(TCGContext *s)
/* TODO: Which registers should be set here? */
tcg_regset_set32(tcg_target_call_clobber_regs, 0,
BIT(TCG_TARGET_NB_REGS) - 1);
+
tcg_regset_clear(s->reserved_regs);
tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK);
tcg_add_target_add_op_defs(tcg_target_op_defs);
- tcg_set_frame(s, TCG_AREG0, offsetof(CPUArchState, temp_buf),
+
+ /* We use negative offsets from "sp" so that we can distinguish
+ stores that might pretend to be call arguments. */
+ tcg_set_frame(s, TCG_REG_CALL_STACK,
+ -CPU_TEMP_BUF_NLONGS * sizeof(long),
CPU_TEMP_BUF_NLONGS * sizeof(long));
}