fix build

This commit is contained in:
IndecisiveTurtle 2024-08-07 21:02:27 +03:00
parent f3fd02812e
commit b9938cb1d8
2 changed files with 5 additions and 3 deletions

View File

@ -496,7 +496,7 @@ struct Liverpool {
template <typename T = VAddr> template <typename T = VAddr>
T Address() const { T Address() const {
return reinterpret_cast<T>((base_addr_lo & ~1U) | u64(base_addr_hi) << 32); return std::bit_cast<T>((base_addr_lo & ~1U) | u64(base_addr_hi) << 32);
} }
}; };

View File

@ -15,6 +15,8 @@
#include <signal.h> #include <signal.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#else
#include <windows.h>
#endif #endif
namespace VideoCore { namespace VideoCore {
@ -36,9 +38,9 @@ struct PageManager::Impl {
void OnUnmap(VAddr address, size_t size) {} void OnUnmap(VAddr address, size_t size) {}
void Protect(VAddr address, size_t size, bool allow_write) { 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{}; DWORD old_prot{};
BOOL result = VirtualProtect(std::bit_cast<LPVOID>(address), len, prot, &old_prot); BOOL result = VirtualProtect(std::bit_cast<LPVOID>(address), size, prot, &old_prot);
ASSERT_MSG(result != 0, "Region protection failed"); ASSERT_MSG(result != 0, "Region protection failed");
} }