mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 14:25:37 +00:00
Common/PageFaultHandler: Hook SIGBUS as well as SIGSEGV on AArch64
Apparently this happens too?
This commit is contained in:
parent
34a808c258
commit
bde271566b
|
@ -105,7 +105,7 @@ static LONG ExceptionHandler(PEXCEPTION_POINTERS exi)
|
||||||
#elif defined(USE_SIGSEGV)
|
#elif defined(USE_SIGSEGV)
|
||||||
|
|
||||||
static struct sigaction s_old_sigsegv_action;
|
static struct sigaction s_old_sigsegv_action;
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) || defined(__aarch64__)
|
||||||
static struct sigaction s_old_sigbus_action;
|
static struct sigaction s_old_sigbus_action;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ static void SIGSEGVHandler(int sig, siginfo_t* info, void* ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// call old signal handler
|
// call old signal handler
|
||||||
#ifndef __APPLE__
|
#if !defined(__APPLE__) && !defined(__aarch64__)
|
||||||
const struct sigaction& sa = s_old_sigsegv_action;
|
const struct sigaction& sa = s_old_sigsegv_action;
|
||||||
#else
|
#else
|
||||||
const struct sigaction& sa = (sig == SIGBUS) ? s_old_sigbus_action : s_old_sigsegv_action;
|
const struct sigaction& sa = (sig == SIGBUS) ? s_old_sigbus_action : s_old_sigsegv_action;
|
||||||
|
@ -218,7 +218,7 @@ bool InstallHandler(void* owner, Callback callback)
|
||||||
Log_ErrorPrintf("sigaction(SIGSEGV) failed: %d", errno);
|
Log_ErrorPrintf("sigaction(SIGSEGV) failed: %d", errno);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) || defined(__aarch64__)
|
||||||
if (sigaction(SIGBUS, &sa, &s_old_sigbus_action) < 0)
|
if (sigaction(SIGBUS, &sa, &s_old_sigbus_action) < 0)
|
||||||
{
|
{
|
||||||
Log_ErrorPrintf("sigaction(SIGBUS) failed: %d", errno);
|
Log_ErrorPrintf("sigaction(SIGBUS) failed: %d", errno);
|
||||||
|
@ -251,7 +251,7 @@ bool RemoveHandler(void* owner)
|
||||||
s_veh_handle = nullptr;
|
s_veh_handle = nullptr;
|
||||||
#else
|
#else
|
||||||
// restore old signal handler
|
// restore old signal handler
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) || defined(__aarch64__)
|
||||||
if (sigaction(SIGBUS, &s_old_sigbus_action, nullptr) < 0)
|
if (sigaction(SIGBUS, &s_old_sigbus_action, nullptr) < 0)
|
||||||
{
|
{
|
||||||
Log_ErrorPrintf("sigaction(SIGBUS) failed: %d", errno);
|
Log_ErrorPrintf("sigaction(SIGBUS) failed: %d", errno);
|
||||||
|
|
Loading…
Reference in a new issue