diff options
Diffstat (limited to 'accel/tcg/internal.h')
-rw-r--r-- | accel/tcg/internal.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index 7bb0fdbe14..24f225cac7 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -64,6 +64,15 @@ static inline target_ulong log_pc(CPUState *cpu, const TranslationBlock *tb) } } +/* + * Return true if CS is not running in parallel with other cpus, either + * because there are no other cpus or we are within an exclusive context. + */ +static inline bool cpu_in_serial_context(CPUState *cs) +{ + return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs); +} + extern int64_t max_delay; extern int64_t max_advance; |