mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
vm: respect initial protection for allocation mapping
Unused yet.
This commit is contained in:
parent
ea5f5aea5f
commit
d7e1cf7dd2
1 changed files with 8 additions and 2 deletions
|
@ -733,11 +733,17 @@ namespace vm
|
|||
rsxthr->on_notify_memory_mapped(addr, size);
|
||||
}
|
||||
|
||||
auto prot = utils::protection::rw;
|
||||
if (~flags & page_writable)
|
||||
prot = utils::protection::ro;
|
||||
if (~flags & page_readable)
|
||||
prot = utils::protection::no;
|
||||
|
||||
if (!shm)
|
||||
{
|
||||
utils::memory_protect(g_base_addr + addr, size, utils::protection::rw);
|
||||
utils::memory_protect(g_base_addr + addr, size, prot);
|
||||
}
|
||||
else if (shm->map_critical(g_base_addr + addr) != g_base_addr + addr || shm->map_critical(g_sudo_addr + addr) != g_sudo_addr + addr)
|
||||
else if (shm->map_critical(g_base_addr + addr, prot) != g_base_addr + addr || shm->map_critical(g_sudo_addr + addr) != g_sudo_addr + addr)
|
||||
{
|
||||
fmt::throw_exception("Memory mapping failed - blame Windows (addr=0x%x, size=0x%x, flags=0x%x)", addr, size, flags);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue