Common: Make __pagesize unsigned

This commit is contained in:
Stenzek authored and Connor McLaughlin committed 2023-07-23 21:52:36 +10:00
1 parent 9191e8ce91
commit eae29bb1f2
3 files changed
+6 -5

No files matched your search

+1
View File
@@ -78,6 +78,7 @@ namespace Common
template <typename T>
static constexpr T PageAlign(T size)
{
static_assert(std::has_single_bit(__pagesize), "Page size is a power of 2");
return Common::AlignUpPow2(size, __pagesize);
}
+2 -1
View File
@@ -108,7 +108,8 @@ static void SysPageFaultSignalFilter(int signal, siginfo_t* siginfo, void* ctx)
void* const exception_pc = nullptr;
#endif
const PageFaultInfo pfi{(uptr)exception_pc, (uptr)siginfo->si_addr & ~__pagemask};
const PageFaultInfo pfi{
reinterpret_cast<uptr>(exception_pc), reinterpret_cast<uptr>(siginfo->si_addr) & ~static_cast<uptr>(__pagemask)};
s_in_exception_handler = true;
+3 -4
View File
@@ -81,10 +81,9 @@
// Defines the memory page size for the target platform at compilation. All supported platforms
// (which means Intel only right now) have a 4k granularity.
#define PCSX2_PAGESIZE 0x1000
static constexpr int __pagesize = PCSX2_PAGESIZE;
static constexpr int __pageshift = 12;
static constexpr size_t __pagemask = PCSX2_PAGESIZE - 1;
static constexpr unsigned int __pagesize = 0x1000;
static constexpr unsigned int __pageshift = 12;
static constexpr unsigned int __pagemask = __pagesize - 1;
// --------------------------------------------------------------------------------------
// Microsoft Visual Studio