Skip to content

Commit

Permalink
memory: s/dirty/clean/ in cpu_physical_memory_is_dirty()
Browse files Browse the repository at this point in the history
All uses except one really want the other meaning.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Orit Wasserman <[email protected]>
  • Loading branch information
Juan Quintela committed Jan 13, 2014
1 parent a461e38 commit a2cd8c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cputlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr,
/* Write access calls the I/O callback. */
te->addr_write = address | TLB_MMIO;
} else if (memory_region_is_ram(section->mr)
&& !cpu_physical_memory_is_dirty(section->mr->ram_addr + xlat)) {
&& cpu_physical_memory_is_clean(section->mr->ram_addr
+ xlat)) {
te->addr_write = address | TLB_NOTDIRTY;
} else {
te->addr_write = address;
Expand Down
6 changes: 3 additions & 3 deletions exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ static void notdirty_mem_write(void *opaque, hwaddr ram_addr,
cpu_physical_memory_set_dirty_flag(ram_addr, DIRTY_MEMORY_VGA);
/* we remove the notdirty callback only if the code has been
flushed */
if (cpu_physical_memory_is_dirty(ram_addr)) {
if (!cpu_physical_memory_is_clean(ram_addr)) {
CPUArchState *env = current_cpu->env_ptr;
tlb_set_dirty(env, env->mem_io_vaddr);
}
Expand Down Expand Up @@ -1917,7 +1917,7 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
static void invalidate_and_set_dirty(hwaddr addr,
hwaddr length)
{
if (!cpu_physical_memory_is_dirty(addr)) {
if (cpu_physical_memory_is_clean(addr)) {
/* invalidate code */
tb_invalidate_phys_page_range(addr, addr + length, 0);
/* set dirty bit */
Expand Down Expand Up @@ -2533,7 +2533,7 @@ void stl_phys_notdirty(hwaddr addr, uint32_t val)
stl_p(ptr, val);

if (unlikely(in_migration)) {
if (!cpu_physical_memory_is_dirty(addr1)) {
if (cpu_physical_memory_is_clean(addr1)) {
/* invalidate code */
tb_invalidate_phys_page_range(addr1, addr1 + 4, 0);
/* set dirty bit */
Expand Down
5 changes: 2 additions & 3 deletions include/exec/memory-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,13 @@ static inline bool cpu_physical_memory_get_dirty_flag(ram_addr_t addr,
return cpu_physical_memory_get_dirty(addr, 1, client);
}

/* read dirty bit (return 0 or 1) */
static inline bool cpu_physical_memory_is_dirty(ram_addr_t addr)
static inline bool cpu_physical_memory_is_clean(ram_addr_t addr)
{
bool vga = cpu_physical_memory_get_dirty_flag(addr, DIRTY_MEMORY_VGA);
bool code = cpu_physical_memory_get_dirty_flag(addr, DIRTY_MEMORY_CODE);
bool migration =
cpu_physical_memory_get_dirty_flag(addr, DIRTY_MEMORY_MIGRATION);
return vga && code && migration;
return !(vga && code && migration);
}

static inline void cpu_physical_memory_set_dirty_flag(ram_addr_t addr,
Expand Down

0 comments on commit a2cd8c8

Please sign in to comment.