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.

Backports commit bcae01e468d961ad9afaf4148329147e4be209ab from qemu
This commit is contained in:
Peter Crosthwaite 2018-02-15 15:36:15 -05:00 committed by Lioncash
parent 2b15db6e12
commit afb48e9fc5
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
3 changed files with 4 additions and 4 deletions

View file

@ -159,8 +159,9 @@ void cpu_tlb_reset_dirty_all(struct uc_struct *uc,
/* update the TLB corresponding to virtual page vaddr
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 mmu_idx;

View file

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

View file

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