Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/emulators/fbsd-duckstation/files/patch-src-util-page_fault_handler.cpp
16462 views
1
Fix build on arm64
2
3
--- src/util/page_fault_handler.cpp.orig 2024-06-14 05:59:32 UTC
4
+++ src/util/page_fault_handler.cpp
5
@@ -188,8 +188,8 @@ void PageFaultHandler::SignalHandler(int sig, siginfo_
6
void* const exception_pc = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext.mc_rip);
7
const bool is_write = (static_cast<ucontext_t*>(ctx)->uc_mcontext.mc_err & 2) != 0;
8
#elif defined(CPU_ARCH_ARM64)
9
- void* const exception_address = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext->__es.__far);
10
- void* const exception_pc = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext->__ss.__pc);
11
+ void* const exception_address = reinterpret_cast<void*>(info->si_addr);
12
+ void* const exception_pc = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext.mc_gpregs.gp_elr);
13
const bool is_write = IsStoreInstruction(exception_pc);
14
#else
15
void* const exception_address = reinterpret_cast<void*>(info->si_addr);
16
17