From: Sergey Fedorov <serge.f...@gmail.com> Signed-off-by: Sergey Fedorov <serge.f...@gmail.com> Signed-off-by: Sergey Fedorov <sergey.fedo...@linaro.org> --- tcg/tcg.h | 1 + translate-all.c | 9 +++++++++ 2 files changed, 10 insertions(+)
diff --git a/tcg/tcg.h b/tcg/tcg.h index 66d7fc01c53c..ca9329d99f90 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -648,6 +648,7 @@ void tcg_pool_delete(TCGContext *s); void tb_lock(void); void tb_unlock(void); +bool tb_lock_locked(void); void tb_lock_reset(void); static inline void *tcg_malloc(int size) diff --git a/translate-all.c b/translate-all.c index 97e834a84503..0dfcf9bc3430 100644 --- a/translate-all.c +++ b/translate-all.c @@ -143,6 +143,15 @@ void tb_unlock(void) #endif } +bool tb_lock_locked(void) +{ +#ifdef CONFIG_USER_ONLY + return have_tb_lock; +#else + return true; +#endif +} + void tb_lock_reset(void) { #ifdef CONFIG_USER_ONLY -- 1.9.1