summary refs log tree commit diff stats
path: root/tcg/tcg.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-01-31 23:29:26 -1000
committerRichard Henderson <richard.henderson@linaro.org>2021-03-06 11:45:21 -0800
commitdb6b7d0c6936cd209e3e8d95aea61ad29ceef5e6 (patch)
tree14cc41a3a5d5ac30e14a28cd0e26988963523e9c /tcg/tcg.c
parentdc09f047eddec8f4a1991c4f5f4a428d7aa3f2c0 (diff)
downloadfocaccia-qemu-db6b7d0c6936cd209e3e8d95aea61ad29ceef5e6.tar.gz
focaccia-qemu-db6b7d0c6936cd209e3e8d95aea61ad29ceef5e6.zip
tcg: Split out tcg_raise_tb_overflow
Allow other places in tcg to restart with a smaller tb.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r--tcg/tcg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 63a12b197b..bbe3dcee03 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -346,6 +346,12 @@ static void set_jmp_reset_offset(TCGContext *s, int which)
     s->tb_jmp_reset_offset[which] = tcg_current_code_size(s);
 }
 
+/* Signal overflow, starting over with fewer guest insns. */
+static void QEMU_NORETURN tcg_raise_tb_overflow(TCGContext *s)
+{
+    siglongjmp(s->jmp_trans, -2);
+}
+
 #define C_PFX1(P, A)                    P##A
 #define C_PFX2(P, A, B)                 P##A##_##B
 #define C_PFX3(P, A, B, C)              P##A##_##B##_##C
@@ -1310,8 +1316,7 @@ static TCGTemp *tcg_temp_alloc(TCGContext *s)
     int n = s->nb_temps++;
 
     if (n >= TCG_MAX_TEMPS) {
-        /* Signal overflow, starting over with fewer guest insns. */
-        siglongjmp(s->jmp_trans, -2);
+        tcg_raise_tb_overflow(s);
     }
     return memset(&s->temps[n], 0, sizeof(TCGTemp));
 }