mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
Refactoring (#6143)
Prefer vm::ptr<>::ptr over vm::get_addr. Prefer vm::_ptr/base over vm::g_base_addr with offset. Added methods atomic_t<>::bts and atomic_t<>::btr . Removed obsolute rsx:🧵:Read/WriteIO32 methods. Removed wrong check in semaphore_release. Added handling for PUTRx commands for RawSPU MFC proxy. Prefer overloaded methods of v128 instead of _mm_... in VPKSHUS ppu interpreter precise. Fixed more potential overflows that may result in wrong behaviour. Added io/size alignment check for sys_rsx_context_iounmap. Added rsx::constants::local_mem_base which represents RSX local memory base address. Removed obsolute rsx:🧵:main_mem_addr/ioSize/ioAddress members.
This commit is contained in:
parent
e043412be4
commit
1ee7b91646
20 changed files with 64 additions and 81 deletions
|
@ -310,7 +310,7 @@ namespace vm
|
|||
{
|
||||
for (u64 i = 0;; i++)
|
||||
{
|
||||
if (LIKELY(!atomic_storage<u64>::bts(res.raw(), 0)))
|
||||
if (LIKELY(!res.bts(0)))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -750,7 +750,7 @@ namespace vm
|
|||
const u32 size = ::align(orig_size, min_page_size);
|
||||
|
||||
// return if addr or size is invalid
|
||||
if (!size || size > this->size || addr < this->addr || addr + size - 1 > this->addr + this->size - 1 || flags & 0x10)
|
||||
if (!size || addr < this->addr || addr + u64{size} > this->addr + this->size || flags & 0x10)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -823,7 +823,7 @@ namespace vm
|
|||
|
||||
std::pair<u32, std::shared_ptr<utils::shm>> block_t::get(u32 addr, u32 size)
|
||||
{
|
||||
if (addr < this->addr || std::max<u32>(size, addr - this->addr + size) >= this->size)
|
||||
if (addr < this->addr || addr + u64{size} > this->addr + this->size)
|
||||
{
|
||||
return {addr, nullptr};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue