From b9938cb1d8b7a3baa03964dd62d2a3fc2ce5e703 Mon Sep 17 00:00:00 2001 From: IndecisiveTurtle <47210458+raphaelthegreat@users.noreply.github.com> Date: Wed, 7 Aug 2024 21:02:27 +0300 Subject: [PATCH] fix build --- src/video_core/amdgpu/liverpool.h | 2 +- src/video_core/page_manager.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/video_core/amdgpu/liverpool.h b/src/video_core/amdgpu/liverpool.h index 400af031..3ebd9a97 100644 --- a/src/video_core/amdgpu/liverpool.h +++ b/src/video_core/amdgpu/liverpool.h @@ -496,7 +496,7 @@ struct Liverpool { template T Address() const { - return reinterpret_cast((base_addr_lo & ~1U) | u64(base_addr_hi) << 32); + return std::bit_cast((base_addr_lo & ~1U) | u64(base_addr_hi) << 32); } }; diff --git a/src/video_core/page_manager.cpp b/src/video_core/page_manager.cpp index 10a2e5ff..a7fcaab4 100644 --- a/src/video_core/page_manager.cpp +++ b/src/video_core/page_manager.cpp @@ -15,6 +15,8 @@ #include #include #include +#else +#include #endif namespace VideoCore { @@ -36,9 +38,9 @@ struct PageManager::Impl { void OnUnmap(VAddr address, size_t size) {} void Protect(VAddr address, size_t size, bool allow_write) { - DWORD prot = PROT_READ | (allow_write ? PROT_WRITE : 0); + DWORD prot = allow_write ? PAGE_READWRITE : PAGE_READONLY; DWORD old_prot{}; - BOOL result = VirtualProtect(std::bit_cast(address), len, prot, &old_prot); + BOOL result = VirtualProtect(std::bit_cast(address), size, prot, &old_prot); ASSERT_MSG(result != 0, "Region protection failed"); }