aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-03 23:35:10 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-03 23:35:10 +0000
commitee8b7021da823e11e3c6ea9063ebb2ab50406a3e (patch)
tree91b71a0497d72e147a40d26dbed74c9b7d2347ad /exec.c
parent625976dac8a2233233c7a5943d2b970ac29ef8ad (diff)
downloadqemu-ee8b7021da823e11e3c6ea9063ebb2ab50406a3e.zip
qemu-ee8b7021da823e11e3c6ea9063ebb2ab50406a3e.tar.gz
qemu-ee8b7021da823e11e3c6ea9063ebb2ab50406a3e.tar.bz2
temporary interrupt locking fix (need rework)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@598 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/exec.c b/exec.c
index 9104efb..4bf87e3 100644
--- a/exec.c
+++ b/exec.c
@@ -260,10 +260,6 @@ void tb_flush(CPUState *env)
nb_tbs,
nb_tbs > 0 ? (code_gen_ptr - code_gen_buffer) / nb_tbs : 0);
#endif
- /* must reset current TB so that interrupts cannot modify the
- links while we are modifying them */
- env->current_tb = NULL;
-
nb_tbs = 0;
for(i = 0;i < CODE_GEN_HASH_SIZE; i++)
tb_hash[i] = NULL;
@@ -970,13 +966,16 @@ void cpu_set_log_filename(const char *filename)
void cpu_interrupt(CPUState *env, int mask)
{
TranslationBlock *tb;
+ static int interrupt_lock;
env->interrupt_request |= mask;
/* if the cpu is currently executing code, we must unlink it and
all the potentially executing TB */
tb = env->current_tb;
- if (tb) {
+ if (tb && !testandset(&interrupt_lock)) {
+ env->current_tb = NULL;
tb_reset_jump_recursive(tb);
+ interrupt_lock = 0;
}
}
@@ -998,7 +997,9 @@ void cpu_abort(CPUState *env, const char *fmt, ...)
#if !defined(CONFIG_USER_ONLY)
-void tlb_flush(CPUState *env)
+/* NOTE: if flush_global is true, also flush global entries (not
+ implemented yet) */
+void tlb_flush(CPUState *env, int flush_global)
{
int i;
@@ -1293,7 +1294,7 @@ int page_unprotect(unsigned long addr)
#else
-void tlb_flush(CPUState *env)
+void tlb_flush(CPUState *env, int flush_global)
{
}