diff options
author | Avi Kivity <avi@redhat.com> | 2012-01-01 21:15:42 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-01-04 13:34:49 +0200 |
commit | 1d393fa2d1c16021c840e5d37f7ff74341b7c884 (patch) | |
tree | 2209ca1ed0e7db577731df5d6390b22a53dfe524 /memory.c | |
parent | 2774c6d0ae20d32d75f77e7ed063ddbb854ca4c5 (diff) |
Avoid range comparisons on io index types
The code sometimes uses range comparisons on io indexes (e.g.
index =< IO_MEM_ROM). Avoid these as they make moving to objects harder.
Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -312,7 +312,8 @@ static void as_memory_range_add(AddressSpace *as, FlatRange *fr) /* cpu_register_physical_memory_log() wants region_offset for * mmio, but prefers offseting phys_offset for RAM. Humour it. */ - if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM) { + if ((phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM + || (phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_ROM) { phys_offset += region_offset; region_offset = 0; } |