dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0062-tcg-mips-use-stack-for-TCG-temps.patch

5544c1
From c914ae50df4dc2f2ab589c87c0cd2ce2f14d9639 Mon Sep 17 00:00:00 2001
5544c1
From: Aurelien Jarno <aurelien@aurel32.net>
5544c1
Date: Fri, 21 Sep 2012 18:20:26 +0200
5544c1
Subject: [PATCH] tcg/mips: use stack for TCG temps
5544c1
5544c1
Use stack instead of temp_buf array in CPUState for TCG
5544c1
temps.
5544c1
5544c1
Reviewed-by: Richard Henderson <rth@twiddle.net>
5544c1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1
---
5544c1
 tcg/mips/tcg-target.c | 10 ++++++----
5544c1
 1 file changed, 6 insertions(+), 4 deletions(-)
5544c1
5544c1
diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c
5544c1
index 0ea6a76..c05169f 100644
5544c1
--- a/tcg/mips/tcg-target.c
5544c1
+++ b/tcg/mips/tcg-target.c
5544c1
@@ -1538,11 +1538,15 @@ static void tcg_target_qemu_prologue(TCGContext *s)
5544c1
 {
5544c1
     int i, frame_size;
5544c1
 
5544c1
-    /* reserve some stack space */
5544c1
+    /* reserve some stack space, also for TCG temps. */
5544c1
     frame_size = ARRAY_SIZE(tcg_target_callee_save_regs) * 4
5544c1
-                 + TCG_STATIC_CALL_ARGS_SIZE;
5544c1
+                 + TCG_STATIC_CALL_ARGS_SIZE
5544c1
+                 + CPU_TEMP_BUF_NLONGS * sizeof(long);
5544c1
     frame_size = (frame_size + TCG_TARGET_STACK_ALIGN - 1) &
5544c1
                  ~(TCG_TARGET_STACK_ALIGN - 1);
5544c1
+    tcg_set_frame(s, TCG_REG_SP, ARRAY_SIZE(tcg_target_callee_save_regs) * 4
5544c1
+                  + TCG_STATIC_CALL_ARGS_SIZE,
5544c1
+                  CPU_TEMP_BUF_NLONGS * sizeof(long));
5544c1
 
5544c1
     /* TB prologue */
5544c1
     tcg_out_addi(s, TCG_REG_SP, -frame_size);
5544c1
@@ -1597,6 +1601,4 @@ static void tcg_target_init(TCGContext *s)
5544c1
     tcg_regset_set_reg(s->reserved_regs, TCG_REG_GP);   /* global pointer */
5544c1
 
5544c1
     tcg_add_target_add_op_defs(mips_op_defs);
5544c1
-    tcg_set_frame(s, TCG_AREG0, offsetof(CPUArchState, temp_buf),
5544c1
-                  CPU_TEMP_BUF_NLONGS * sizeof(long));
5544c1
 }
5544c1
-- 
5544c1
1.7.12.1
5544c1