From c07a79741edb461ad2c250c8b3dfa8a39d696b58 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Sat, 16 May 2009 19:45:30 +0000 Subject: [PATCH] Linux: Added a console log regarding page protection, based on a hunch I have for what's causing Issue 220. [need a linux person to check it and see if the console logs the new error or not] git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1205 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Linux/LnxSysExec.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pcsx2/Linux/LnxSysExec.cpp b/pcsx2/Linux/LnxSysExec.cpp index 5ce58e3b1c..b0536465d8 100644 --- a/pcsx2/Linux/LnxSysExec.cpp +++ b/pcsx2/Linux/LnxSysExec.cpp @@ -382,10 +382,18 @@ namespace HostSys void MemProtect( void* baseaddr, size_t size, PageProtectionMode mode, bool allowExecution ) { + // Breakpoint this to trap potentially inappropriate use of page protection, which would + // be caused by failed aligned directives on global vars (dunno if it's happening or not yet) + Console::Error( + "*PCSX2/Linux Warning* Inappropriate use of page protection detected.\n" + "\tbaseaddr not page aligned: 0x%08X", params (uptr)baseaddr + ); + int lnxmode = 0; - // make sure size is aligned to the system page size: + // make sure base and size are aligned to the system page size: size = (size + m_pagemask) & ~m_pagemask; + baseaddr = (void*)( ((uptr)baseaddr) & ~mpagemask ); switch( mode ) {