diff --git a/Source/Core/Common/ArmCPUDetect.cpp b/Source/Core/Common/ArmCPUDetect.cpp index 53026bf5d2..7fb0ef6765 100644 --- a/Source/Core/Common/ArmCPUDetect.cpp +++ b/Source/Core/Common/ArmCPUDetect.cpp @@ -9,7 +9,9 @@ #include #ifndef _WIN32 +#ifndef __FreeBSD__ #include +#endif #include #include #endif @@ -87,7 +89,12 @@ void CPUInfo::Detect() num_cores = sysconf(_SC_NPROCESSORS_CONF); strncpy(cpu_string, GetCPUString().c_str(), sizeof(cpu_string)); +#ifdef __FreeBSD__ + u_long hwcaps = 0; + elf_aux_info(AT_HWCAP, &hwcaps, sizeof(u_long)); +#else unsigned long hwcaps = getauxval(AT_HWCAP); +#endif bFP = hwcaps & HWCAP_FP; bASIMD = hwcaps & HWCAP_ASIMD; bAES = hwcaps & HWCAP_AES; diff --git a/Source/Core/Core/MachineContext.h b/Source/Core/Core/MachineContext.h index af077cf813..1ae0a1cc48 100644 --- a/Source/Core/Core/MachineContext.h +++ b/Source/Core/Core/MachineContext.h @@ -35,6 +35,7 @@ typedef CONTEXT SContext; #define CTX_RIP Rip #elif _M_ARM64 #define CTX_REG(x) X[x] +#define CTX_LR X[30] #define CTX_SP Sp #define CTX_PC Pc #else @@ -115,6 +116,7 @@ typedef mcontext_t SContext; #define CTX_RIP gregs[REG_RIP] #elif _M_ARM_64 #define CTX_REG(x) regs[x] +#define CTX_LR regs[30] #define CTX_SP sp #define CTX_PC pc #else @@ -189,6 +191,11 @@ typedef mcontext_t SContext; #define CTX_R14 mc_r14 #define CTX_R15 mc_r15 #define CTX_RIP mc_rip +#elif _M_ARM_64 +#define CTX_REG(x) mc_gpregs.gp_x[x] +#define CTX_LR mc_gpregs.gp_lr +#define CTX_SP mc_gpregs.gp_sp +#define CTX_PC mc_gpregs.gp_elr #else #error No context definition for architecture #endif diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_BackPatch.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_BackPatch.cpp index 3d02c96316..8ce9182783 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_BackPatch.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_BackPatch.cpp @@ -27,7 +27,7 @@ void JitArm64::DoBacktrace(uintptr_t access_address, SContext* ctx) ERROR_LOG(DYNA_REC, "R%d: 0x%016llx\tR%d: 0x%016llx", i, ctx->CTX_REG(i), i + 1, ctx->CTX_REG(i + 1)); - ERROR_LOG(DYNA_REC, "R30: 0x%016llx\tSP: 0x%016llx", ctx->CTX_REG(30), ctx->CTX_SP); + ERROR_LOG(DYNA_REC, "R30: 0x%016llx\tSP: 0x%016llx", ctx->CTX_LR, ctx->CTX_SP); ERROR_LOG(DYNA_REC, "Access Address: 0x%016lx", access_address); ERROR_LOG(DYNA_REC, "PC: 0x%016llx", ctx->CTX_PC);