mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-25 03:18:08 +00:00
memory: remove unnecessary masking of MemoryRegion ram_addr
mr->ram_block->offset is already aligned to both host and target size (see qemu_ram_alloc_internal). Remove further masking as it is unnecessary. Backports commit e4e697940dff612b789b0858270c20a8b680f78d from qemu
This commit is contained in:
parent
74962feee1
commit
77305ce4ee
3 changed files with 4 additions and 7 deletions
|
@ -2377,9 +2377,8 @@ static inline uint32_t address_space_ldl_internal(AddressSpace *as, hwaddr addr,
|
|||
} else {
|
||||
/* RAM case */
|
||||
ptr = qemu_get_ram_ptr(as->uc, mr->ram_block,
|
||||
(memory_region_get_ram_addr(mr)
|
||||
& TARGET_PAGE_MASK)
|
||||
+ addr1);
|
||||
memory_region_get_ram_addr(mr) + addr1);
|
||||
|
||||
switch (endian) {
|
||||
case DEVICE_LITTLE_ENDIAN:
|
||||
val = ldl_le_p(ptr);
|
||||
|
|
|
@ -1353,8 +1353,7 @@ void *memory_region_get_ram_ptr(MemoryRegion *mr)
|
|||
}
|
||||
|
||||
assert(mr->ram_block);
|
||||
ptr = qemu_get_ram_ptr(mr->uc, mr->ram_block,
|
||||
memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK);
|
||||
ptr = qemu_get_ram_ptr(mr->uc, mr->ram_block, memory_region_get_ram_addr(mr));
|
||||
// Unicorn: commented out
|
||||
//rcu_read_unlock();
|
||||
|
||||
|
|
|
@ -1662,8 +1662,7 @@ void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr)
|
|||
|| memory_region_is_romd(mr))) {
|
||||
return;
|
||||
}
|
||||
ram_addr = (ram_addr_t)((memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK)
|
||||
+ addr);
|
||||
ram_addr = memory_region_get_ram_addr(mr) + addr;
|
||||
tb_invalidate_phys_page_range(as->uc, ram_addr, ram_addr + 1, 0);
|
||||
}
|
||||
#endif /* !defined(CONFIG_USER_ONLY) */
|
||||
|
|
Loading…
Reference in a new issue