mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 05:25:31 +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
|
@ -2377,9 +2377,8 @@ static inline uint32_t address_space_ldl_internal(AddressSpace *as, hwaddr addr,
|
||||||
} else {
|
} else {
|
||||||
/* RAM case */
|
/* RAM case */
|
||||||
ptr = qemu_get_ram_ptr(as->uc, mr->ram_block,
|
ptr = qemu_get_ram_ptr(as->uc, mr->ram_block,
|
||||||
(memory_region_get_ram_addr(mr)
|
memory_region_get_ram_addr(mr) + addr1);
|
||||||
& TARGET_PAGE_MASK)
|
|
||||||
+ addr1);
|
|
||||||
switch (endian) {
|
switch (endian) {
|
||||||
case DEVICE_LITTLE_ENDIAN:
|
case DEVICE_LITTLE_ENDIAN:
|
||||||
val = ldl_le_p(ptr);
|
val = ldl_le_p(ptr);
|
||||||
|
|
|
@ -1353,8 +1353,7 @@ void *memory_region_get_ram_ptr(MemoryRegion *mr)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(mr->ram_block);
|
assert(mr->ram_block);
|
||||||
ptr = qemu_get_ram_ptr(mr->uc, mr->ram_block,
|
ptr = qemu_get_ram_ptr(mr->uc, mr->ram_block, memory_region_get_ram_addr(mr));
|
||||||
memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK);
|
|
||||||
// Unicorn: commented out
|
// Unicorn: commented out
|
||||||
//rcu_read_unlock();
|
//rcu_read_unlock();
|
||||||
|
|
||||||
|
|
|
@ -1662,8 +1662,7 @@ void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr)
|
||||||
|| memory_region_is_romd(mr))) {
|
|| memory_region_is_romd(mr))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ram_addr = (ram_addr_t)((memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK)
|
ram_addr = memory_region_get_ram_addr(mr) + addr;
|
||||||
+ addr);
|
|
||||||
tb_invalidate_phys_page_range(as->uc, ram_addr, ram_addr + 1, 0);
|
tb_invalidate_phys_page_range(as->uc, ram_addr, ram_addr + 1, 0);
|
||||||
}
|
}
|
||||||
#endif /* !defined(CONFIG_USER_ONLY) */
|
#endif /* !defined(CONFIG_USER_ONLY) */
|
||||||
|
|
Loading…
Reference in a new issue