mirror of https://github.com/PCSX2/pcsx2.git
Common: Make __pagesize unsigned
This commit is contained in:
parent
9191e8ce91
commit
eae29bb1f2
|
@ -78,6 +78,7 @@ namespace Common
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static constexpr T PageAlign(T size)
|
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);
|
return Common::AlignUpPow2(size, __pagesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,8 @@ static void SysPageFaultSignalFilter(int signal, siginfo_t* siginfo, void* ctx)
|
||||||
void* const exception_pc = nullptr;
|
void* const exception_pc = nullptr;
|
||||||
#endif
|
#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;
|
s_in_exception_handler = true;
|
||||||
|
|
||||||
|
|
|
@ -81,10 +81,9 @@
|
||||||
|
|
||||||
// Defines the memory page size for the target platform at compilation. All supported platforms
|
// Defines the memory page size for the target platform at compilation. All supported platforms
|
||||||
// (which means Intel only right now) have a 4k granularity.
|
// (which means Intel only right now) have a 4k granularity.
|
||||||
#define PCSX2_PAGESIZE 0x1000
|
static constexpr unsigned int __pagesize = 0x1000;
|
||||||
static constexpr int __pagesize = PCSX2_PAGESIZE;
|
static constexpr unsigned int __pageshift = 12;
|
||||||
static constexpr int __pageshift = 12;
|
static constexpr unsigned int __pagemask = __pagesize - 1;
|
||||||
static constexpr size_t __pagemask = PCSX2_PAGESIZE - 1;
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
// Microsoft Visual Studio
|
// Microsoft Visual Studio
|
||||||
|
|
Loading…
Reference in New Issue