[D3D12] Shared memory typo fix and improvements

This commit is contained in:
Triang3l
2018-08-01 01:09:33 +03:00
parent 8fadd7a242
commit db625892ea
5 changed files with 31 additions and 31 deletions

View File

@@ -222,7 +222,8 @@ void MMIOHandler::SetGlobalPhysicalAccessWatch(
}
void MMIOHandler::ProtectPhysicalMemory(uint32_t physical_address,
uint32_t length, WatchType type) {
uint32_t length, WatchType type,
bool protect_host_access) {
uint32_t base_address = physical_address & 0x1FFFFFFF;
// Can only protect sizes matching system page size.
@@ -250,9 +251,11 @@ void MMIOHandler::ProtectPhysicalMemory(uint32_t physical_address,
break;
}
// Protect the range under all address spaces
memory::Protect(physical_membase_ + base_address, length, page_access,
nullptr);
// Protect the range under all address spaces.
if (protect_host_access) {
memory::Protect(physical_membase_ + base_address, length, page_access,
nullptr);
}
memory::Protect(virtual_membase_ + 0xA0000000 + base_address, length,
page_access, nullptr);
memory::Protect(virtual_membase_ + 0xC0000000 + base_address, length,
@@ -262,8 +265,10 @@ void MMIOHandler::ProtectPhysicalMemory(uint32_t physical_address,
}
void MMIOHandler::UnprotectPhysicalMemory(uint32_t physical_address,
uint32_t length) {
ProtectPhysicalMemory(physical_address, length, kWatchInvalid);
uint32_t length,
bool unprotect_host_access) {
ProtectPhysicalMemory(physical_address, length, kWatchInvalid,
unprotect_host_access);
}
void MMIOHandler::InvalidateRange(uint32_t physical_address, size_t length) {

View File

@@ -78,8 +78,9 @@ class MMIOHandler {
void SetGlobalPhysicalAccessWatch(GlobalAccessWatchCallback callback,
void* callback_context);
void ProtectPhysicalMemory(uint32_t physical_address, uint32_t length,
WatchType type);
void UnprotectPhysicalMemory(uint32_t physical_address, uint32_t length);
WatchType type, bool protect_host_access);
void UnprotectPhysicalMemory(uint32_t physical_address, uint32_t length,
bool unprotect_host_access);
// Fires and clears any access watches that overlap this range.
void InvalidateRange(uint32_t physical_address, size_t length);