Browse Source

cputlb: Change tlb_set_dirty() arg to cpu

Change tlb_set_dirty() to accept a CPU instead of an env pointer. This
allows for removal of another CPUArchState usage from prototypes that
need to be QOMified.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Message-Id: <d2b1dcbe7945112989861d8ba7369449c11cc273.1441614289.git.crosthwaite.peter@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Peter Crosthwaite 10 years ago
parent
commit
bcae01e468
3 changed files with 4 additions and 4 deletions
  1. 2 1
      cputlb.c
  2. 1 2
      exec.c
  3. 1 1
      include/exec/cputlb.h

+ 2 - 1
cputlb.c

@@ -293,8 +293,9 @@ static inline void tlb_set_dirty1(CPUTLBEntry *tlb_entry, target_ulong vaddr)
 
 
 /* update the TLB corresponding to virtual page vaddr
 /* update the TLB corresponding to virtual page vaddr
    so that it is no longer dirty */
    so that it is no longer dirty */
-void tlb_set_dirty(CPUArchState *env, target_ulong vaddr)
+void tlb_set_dirty(CPUState *cpu, target_ulong vaddr)
 {
 {
+    CPUArchState *env = cpu->env_ptr;
     int i;
     int i;
     int mmu_idx;
     int mmu_idx;
 
 

+ 1 - 2
exec.c

@@ -1922,8 +1922,7 @@ static void notdirty_mem_write(void *opaque, hwaddr ram_addr,
     /* we remove the notdirty callback only if the code has been
     /* we remove the notdirty callback only if the code has been
        flushed */
        flushed */
     if (!cpu_physical_memory_is_clean(ram_addr)) {
     if (!cpu_physical_memory_is_clean(ram_addr)) {
-        CPUArchState *env = current_cpu->env_ptr;
-        tlb_set_dirty(env, current_cpu->mem_io_vaddr);
+        tlb_set_dirty(current_cpu, current_cpu->mem_io_vaddr);
     }
     }
 }
 }
 
 

+ 1 - 1
include/exec/cputlb.h

@@ -26,7 +26,7 @@ void tlb_unprotect_code(ram_addr_t ram_addr);
 void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry, uintptr_t start,
 void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry, uintptr_t start,
                            uintptr_t length);
                            uintptr_t length);
 void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length);
 void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length);
-void tlb_set_dirty(CPUArchState *env, target_ulong vaddr);
+void tlb_set_dirty(CPUState *cpu, target_ulong vaddr);
 extern int tlb_flush_count;
 extern int tlb_flush_count;
 
 
 /* exec.c */
 /* exec.c */