summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--accel/stubs/tcg-stub.c6
-rw-r--r--disas/m68k.c14
-rw-r--r--exec.c2
-rw-r--r--hw/audio/hda-codec.c31
-rw-r--r--include/exec/exec-all.h13
5 files changed, 45 insertions, 21 deletions
diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c
index 76ae461749..8ee85ed665 100644
--- a/accel/stubs/tcg-stub.c
+++ b/accel/stubs/tcg-stub.c
@@ -16,6 +16,7 @@
 #include "tcg/tcg.h"
 #include "exec/cpu-common.h"
 #include "exec/exec-all.h"
+#include "translate-all.h"
 
 void tb_flush(CPUState *cpu)
 {
@@ -24,3 +25,8 @@ void tb_flush(CPUState *cpu)
 void tlb_set_dirty(CPUState *cpu, target_ulong vaddr)
 {
 }
+
+void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
+                                   int is_cpu_write_access)
+{
+}
diff --git a/disas/m68k.c b/disas/m68k.c
index 61b689ef3e..a687df437c 100644
--- a/disas/m68k.c
+++ b/disas/m68k.c
@@ -2017,6 +2017,20 @@ print_insn_m68k (bfd_vma memaddr, disassemble_info *info)
 		}
 	    }
 
+          /* Don't match FPU insns with non-default coprocessor ID.  */
+          if (*d == '\0')
+            {
+              for (d = opc->args; *d; d += 2)
+                {
+                  if (d[0] == 'I')
+                    {
+                      val = fetch_arg (buffer, 'd', 3, info);
+                      if (val != 1)
+                        break;
+                    }
+                }
+            }
+
 	  if (*d == '\0')
 	    if ((val = match_insn_m68k (memaddr, info, opc, & priv)))
 	      return val;
diff --git a/exec.c b/exec.c
index cdcf769daa..ee726888a5 100644
--- a/exec.c
+++ b/exec.c
@@ -1027,7 +1027,7 @@ const char *parse_cpu_model(const char *cpu_model)
     return cpu_type;
 }
 
-#if defined(CONFIG_USER_ONLY)
+#if defined(CONFIG_USER_ONLY) || !defined(CONFIG_TCG)
 void tb_invalidate_phys_addr(target_ulong addr)
 {
     mmap_lock();
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index fc4945086b..31c66d4255 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -18,7 +18,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu/atomic.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "intel-hda.h"
@@ -209,7 +208,7 @@ static inline void hda_timer_sync_adjust(HDAAudioStream *st, int64_t target_pos)
     }
 
     trace_hda_audio_adjust(st->node->name, target_pos);
-    atomic_fetch_add(&st->buft_start, corr);
+    st->buft_start += corr;
 }
 
 static void hda_audio_input_timer(void *opaque)
@@ -218,9 +217,9 @@ static void hda_audio_input_timer(void *opaque)
 
     int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
 
-    int64_t buft_start = atomic_fetch_add(&st->buft_start, 0);
-    int64_t wpos = atomic_fetch_add(&st->wpos, 0);
-    int64_t rpos = atomic_fetch_add(&st->rpos, 0);
+    int64_t buft_start = st->buft_start;
+    int64_t wpos = st->wpos;
+    int64_t rpos = st->rpos;
 
     int64_t wanted_rpos = hda_bytes_per_second(st) * (now - buft_start)
                           / NANOSECONDS_PER_SECOND;
@@ -242,7 +241,7 @@ static void hda_audio_input_timer(void *opaque)
         }
         rpos += chunk;
         to_transfer -= chunk;
-        atomic_fetch_add(&st->rpos, chunk);
+        st->rpos += chunk;
     }
 
 out_timer:
@@ -256,8 +255,8 @@ static void hda_audio_input_cb(void *opaque, int avail)
 {
     HDAAudioStream *st = opaque;
 
-    int64_t wpos = atomic_fetch_add(&st->wpos, 0);
-    int64_t rpos = atomic_fetch_add(&st->rpos, 0);
+    int64_t wpos = st->wpos;
+    int64_t rpos = st->rpos;
 
     int64_t to_transfer = audio_MIN(B_SIZE - (wpos - rpos), avail);
 
@@ -269,7 +268,7 @@ static void hda_audio_input_cb(void *opaque, int avail)
         uint32_t read = AUD_read(st->voice.in, st->buf + start, chunk);
         wpos += read;
         to_transfer -= read;
-        atomic_fetch_add(&st->wpos, read);
+        st->wpos += read;
         if (chunk != read) {
             break;
         }
@@ -282,9 +281,9 @@ static void hda_audio_output_timer(void *opaque)
 
     int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
 
-    int64_t buft_start = atomic_fetch_add(&st->buft_start, 0);
-    int64_t wpos = atomic_fetch_add(&st->wpos, 0);
-    int64_t rpos = atomic_fetch_add(&st->rpos, 0);
+    int64_t buft_start = st->buft_start;
+    int64_t wpos = st->wpos;
+    int64_t rpos = st->rpos;
 
     int64_t wanted_wpos = hda_bytes_per_second(st) * (now - buft_start)
                           / NANOSECONDS_PER_SECOND;
@@ -306,7 +305,7 @@ static void hda_audio_output_timer(void *opaque)
         }
         wpos += chunk;
         to_transfer -= chunk;
-        atomic_fetch_add(&st->wpos, chunk);
+        st->wpos += chunk;
     }
 
 out_timer:
@@ -320,8 +319,8 @@ static void hda_audio_output_cb(void *opaque, int avail)
 {
     HDAAudioStream *st = opaque;
 
-    int64_t wpos = atomic_fetch_add(&st->wpos, 0);
-    int64_t rpos = atomic_fetch_add(&st->rpos, 0);
+    int64_t wpos = st->wpos;
+    int64_t rpos = st->rpos;
 
     int64_t to_transfer = audio_MIN(wpos - rpos, avail);
 
@@ -342,7 +341,7 @@ static void hda_audio_output_cb(void *opaque, int avail)
         uint32_t written = AUD_write(st->voice.out, st->buf + start, chunk);
         rpos += written;
         to_transfer -= written;
-        atomic_fetch_add(&st->rpos, written);
+        st->rpos += written;
         if (chunk != written) {
             break;
         }
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 6a7e7a866e..cb497dee0b 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -255,7 +255,6 @@ void tlb_set_page_with_attrs(CPUState *cpu, target_ulong vaddr,
 void tlb_set_page(CPUState *cpu, target_ulong vaddr,
                   hwaddr paddr, int prot,
                   int mmu_idx, target_ulong size);
-void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs attrs);
 void probe_write(CPUArchState *env, target_ulong addr, int size, int mmu_idx,
                  uintptr_t retaddr);
 #else
@@ -304,9 +303,6 @@ static inline void tlb_flush_by_mmuidx_all_cpus_synced(CPUState *cpu,
                                                        uint16_t idxmap)
 {
 }
-
-void tb_invalidate_phys_addr(target_ulong addr);
-void tb_invalidate_phys_range(target_ulong start, target_ulong end);
 #endif
 
 #define CODE_GEN_ALIGN           16 /* must be >= of the size of a icache line */
@@ -415,6 +411,15 @@ static inline uint32_t curr_cflags(void)
          | (use_icount ? CF_USE_ICOUNT : 0);
 }
 
+/* TranslationBlock invalidate API */
+#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
+void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs attrs);
+#else
+void tb_invalidate_phys_addr(target_ulong addr);
+#endif
+#if defined(CONFIG_USER_ONLY)
+void tb_invalidate_phys_range(target_ulong start, target_ulong end);
+#endif
 void tb_flush(CPUState *cpu);
 void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
 TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc,