From 17c14ac4b9efe00c889c3a5727c841f9fe9499f1 Mon Sep 17 00:00:00 2001 From: Merry Date: Sun, 11 Dec 2022 00:52:42 +0000 Subject: [PATCH] MachineContext: Fix USE_SIGACTION_ON_APPLE on arm64 --- Source/Core/Core/MachineContext.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/Core/Core/MachineContext.h b/Source/Core/Core/MachineContext.h index 7e27d7a908..9d20c51ef3 100644 --- a/Source/Core/Core/MachineContext.h +++ b/Source/Core/Core/MachineContext.h @@ -78,6 +78,7 @@ typedef arm_thread_state64_t SContext; #elif defined(__APPLE__) #include typedef _STRUCT_MCONTEXT64 SContext; +#if _M_X86_64 #define CTX_RAX __ss.__rax #define CTX_RBX __ss.__rbx #define CTX_RCX __ss.__rcx @@ -95,6 +96,14 @@ typedef _STRUCT_MCONTEXT64 SContext; #define CTX_R14 __ss.__r14 #define CTX_R15 __ss.__r15 #define CTX_RIP __ss.__rip +#elif _M_ARM_64 +#define CTX_REG(x) __ss.__x[x] +#define CTX_LR __ss.__lr +#define CTX_SP __ss.__sp +#define CTX_PC __ss.__pc +#else +#error No context definition for architecture +#endif #elif defined(__linux__) #include