[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 05/29] tcg: Split out tcg_region_initial_alloc
From: |
Richard Henderson |
Subject: |
[PATCH v2 05/29] tcg: Split out tcg_region_initial_alloc |
Date: |
Sun, 14 Mar 2021 15:27:00 -0600 |
This has only one user, and currently needs an ifdef,
but will make more sense after some code motion.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/tcg.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 2b631fccdf..3316a22bde 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -726,6 +726,15 @@ static void tcg_region_initial_alloc__locked(TCGContext *s)
g_assert(!err);
}
+#ifndef CONFIG_USER_ONLY
+static void tcg_region_initial_alloc(TCGContext *s)
+{
+ qemu_mutex_lock(®ion.lock);
+ tcg_region_initial_alloc__locked(s);
+ qemu_mutex_unlock(®ion.lock);
+}
+#endif
+
/* Call from a safe-work context */
void tcg_region_reset_all(void)
{
@@ -957,9 +966,7 @@ void tcg_register_thread(void)
}
tcg_ctx = s;
- qemu_mutex_lock(®ion.lock);
- tcg_region_initial_alloc__locked(s);
- qemu_mutex_unlock(®ion.lock);
+ tcg_region_initial_alloc(s);
}
#endif /* !CONFIG_USER_ONLY */
--
2.25.1
- [PATCH v2 00/29] tcg: Workaround macOS 11.2 mprotect bug, Richard Henderson, 2021/03/14
- [PATCH v2 01/29] meson: Split out tcg/meson.build, Richard Henderson, 2021/03/14
- [PATCH v2 03/29] tcg: Re-order tcg_region_init vs tcg_prologue_init, Richard Henderson, 2021/03/14
- [PATCH v2 02/29] meson: Split out fpu/meson.build, Richard Henderson, 2021/03/14
- [PATCH v2 04/29] tcg: Remove error return from tcg_region_initial_alloc__locked, Richard Henderson, 2021/03/14
- [PATCH v2 05/29] tcg: Split out tcg_region_initial_alloc,
Richard Henderson <=
- [PATCH v2 06/29] tcg: Split out tcg_region_prologue_set, Richard Henderson, 2021/03/14
- [PATCH v2 08/29] accel/tcg: Inline cpu_gen_init, Richard Henderson, 2021/03/14
- [PATCH v2 07/29] tcg: Split out region.c, Richard Henderson, 2021/03/14
- [PATCH v2 09/29] accel/tcg: Move alloc_code_gen_buffer to tcg/region.c, Richard Henderson, 2021/03/14
- [PATCH v2 11/29] tcg: Create tcg_init, Richard Henderson, 2021/03/14
- [PATCH v2 12/29] accel/tcg: Merge tcg_exec_init into tcg_init_machine, Richard Henderson, 2021/03/14
- [PATCH v2 10/29] accel/tcg: Rename tcg_init to tcg_init_machine, Richard Henderson, 2021/03/14
- [PATCH v2 13/29] accel/tcg: Pass down max_cpus to tcg_init, Richard Henderson, 2021/03/14
- [PATCH v2 14/29] tcg: Introduce tcg_max_ctxs, Richard Henderson, 2021/03/14
- [PATCH v2 15/29] tcg: Move MAX_CODE_GEN_BUFFER_SIZE to tcg-target.h, Richard Henderson, 2021/03/14