mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-16 19:07:00 +02:00
fixup
This commit is contained in:
parent
214517094a
commit
e6a73ca06e
2 changed files with 31 additions and 13 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
/* This file is part of the dynarmic project.
|
/* This file is part of the dynarmic project.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
@ -34,23 +34,21 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ARCHITECTURE_x86_64
|
#ifdef ARCHITECTURE_arm64
|
||||||
# ifdef __OpenBSD__
|
# ifdef __OpenBSD__
|
||||||
# define CTX_DECLARE(raw_context) ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context);
|
# define CTX_DECLARE(raw_context) ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context);
|
||||||
# else
|
# else
|
||||||
# define CTX_DECLARE(raw_context) \
|
# define CTX_DECLARE(raw_context) ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context); \
|
||||||
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context); \
|
|
||||||
[[maybe_unused]] auto& mctx = ucontext->uc_mcontext;
|
|
||||||
# endif
|
|
||||||
#elif defined(ARCHITECTURE_arm64)
|
|
||||||
# ifdef __OpenBSD__
|
|
||||||
# define CTX_DECLARE(raw_context) ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context);
|
|
||||||
# else
|
|
||||||
# define CTX_DECLARE(raw_context) \
|
|
||||||
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context); \
|
|
||||||
[[maybe_unused]] auto& mctx = ucontext->uc_mcontext; \
|
[[maybe_unused]] auto& mctx = ucontext->uc_mcontext; \
|
||||||
[[maybe_unused]] const auto fpctx = GetFloatingPointState(mctx);
|
[[maybe_unused]] const auto fpctx = GetFloatingPointState(mctx);
|
||||||
# endif
|
# endif
|
||||||
|
#else
|
||||||
|
# ifdef __OpenBSD__
|
||||||
|
# define CTX_DECLARE(raw_context) ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context);
|
||||||
|
# else
|
||||||
|
# define CTX_DECLARE(raw_context) ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context); \
|
||||||
|
[[maybe_unused]] auto& mctx = ucontext->uc_mcontext;
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ARCHITECTURE_x86_64)
|
#if defined(ARCHITECTURE_x86_64)
|
||||||
|
|
@ -67,6 +65,7 @@
|
||||||
# define CTX_RIP (mctx.__gregs[_REG_RIP])
|
# define CTX_RIP (mctx.__gregs[_REG_RIP])
|
||||||
# define CTX_RSP (mctx.__gregs[_REG_RSP])
|
# define CTX_RSP (mctx.__gregs[_REG_RSP])
|
||||||
# elif defined(__OpenBSD__)
|
# elif defined(__OpenBSD__)
|
||||||
|
// https://github.com/openbsd/src/blob/master/sys/arch/x86_64/include/signal.h
|
||||||
# define CTX_RIP (ucontext->sc_rip)
|
# define CTX_RIP (ucontext->sc_rip)
|
||||||
# define CTX_RSP (ucontext->sc_rsp)
|
# define CTX_RSP (ucontext->sc_rsp)
|
||||||
# elif defined(__sun__)
|
# elif defined(__sun__)
|
||||||
|
|
@ -110,6 +109,7 @@
|
||||||
# define CTX_X(i) (mctx.mc_gpregs.gp_x[i])
|
# define CTX_X(i) (mctx.mc_gpregs.gp_x[i])
|
||||||
# define CTX_Q(i) (mctx.mc_fpregs.fp_q[i])
|
# define CTX_Q(i) (mctx.mc_fpregs.fp_q[i])
|
||||||
# elif defined(__OpenBSD__)
|
# elif defined(__OpenBSD__)
|
||||||
|
// https://github.com/openbsd/src/blob/master/sys/arch/arm64/include/signal.h
|
||||||
# define CTX_PC (ucontext->sc_elr)
|
# define CTX_PC (ucontext->sc_elr)
|
||||||
# define CTX_SP (ucontext->sc_sp)
|
# define CTX_SP (ucontext->sc_sp)
|
||||||
# define CTX_LR (ucontext->sc_lr)
|
# define CTX_LR (ucontext->sc_lr)
|
||||||
|
|
@ -126,12 +126,30 @@
|
||||||
# define CTX_SEPC (mctx.__gregs[REG_PC])
|
# define CTX_SEPC (mctx.__gregs[REG_PC])
|
||||||
# define CTX_SP (mctx.__gregs[REG_SP])
|
# define CTX_SP (mctx.__gregs[REG_SP])
|
||||||
# elif defined(__NetBSD__)
|
# elif defined(__NetBSD__)
|
||||||
|
// https://github.com/NetBSD/src/blob/trunk/sys/arch/riscv/include/mcontext.h
|
||||||
# define CTX_SEPC (mctx.__gregs[_REG_PC])
|
# define CTX_SEPC (mctx.__gregs[_REG_PC])
|
||||||
# define CTX_SP (mctx.__gregs[_REG_SP])
|
# define CTX_SP (mctx.__gregs[_REG_SP])
|
||||||
# elif defined(__OpenBSD__)
|
# elif defined(__OpenBSD__)
|
||||||
|
// https://github.com/openbsd/src/blob/master/sys/arch/riscv64/include/signal.h
|
||||||
# define CTX_SEPC (ucontext->sc_sepc)
|
# define CTX_SEPC (ucontext->sc_sepc)
|
||||||
# define CTX_SP (ucontext->sc_sp)
|
# define CTX_SP (ucontext->sc_sp)
|
||||||
# endif
|
# endif
|
||||||
|
#elif defined(ARCHITECTURE_powerpc64)
|
||||||
|
# if defined(__FreeBSD__)
|
||||||
|
# define CTX_PC (mctx.mc_srr0)
|
||||||
|
# define CTX_SP (mctx.mc_gpr[1])
|
||||||
|
# elif defined(__linux__)
|
||||||
|
// https://github.com/lattera/glibc/blob/master/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
|
||||||
|
# define CTX_PC (mctx.uc_regs[REG_PC])
|
||||||
|
# define CTX_SP (mctx.uc_regs[REG_SP])
|
||||||
|
# elif defined(__NetBSD__)
|
||||||
|
# define CTX_PC (mctx.__gregs[_REG_PC])
|
||||||
|
# define CTX_SP (mctx.__gregs[_REG_R1])
|
||||||
|
# elif defined(__OpenBSD__)
|
||||||
|
// https://github.com/openbsd/src/blob/master/sys/arch/powerpc64/include/signal.h
|
||||||
|
# define CTX_PC (ucontext->sc_pc)
|
||||||
|
# define CTX_SP (ucontext->sc_reg[1])
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# error "unimplemented"
|
# error "unimplemented"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue