diff options
author | Liam <byteslice@airmail.cc> | 2023-11-17 22:44:53 +0100 |
---|---|---|
committer | t895 <clombardo169@gmail.com> | 2023-11-25 06:46:47 +0100 |
commit | 9f91ba1f7357c61dd2c7c3b437ea203d467fd400 (patch) | |
tree | 3cfe55acf5d2f8a0d75373934b4c22a4e9bb2a09 /src/core/arm/nce/guest_context.h | |
parent | device_memory: Enable direct mapped addresses for nce (diff) | |
download | yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar.gz yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar.bz2 yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar.lz yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar.xz yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.tar.zst yuzu-9f91ba1f7357c61dd2c7c3b437ea203d467fd400.zip |
Diffstat (limited to 'src/core/arm/nce/guest_context.h')
-rw-r--r-- | src/core/arm/nce/guest_context.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/core/arm/nce/guest_context.h b/src/core/arm/nce/guest_context.h new file mode 100644 index 000000000..0767a0337 --- /dev/null +++ b/src/core/arm/nce/guest_context.h @@ -0,0 +1,50 @@ +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "common/common_funcs.h" +#include "common/common_types.h" +#include "core/arm/arm_interface.h" +#include "core/arm/nce/arm_nce_asm_definitions.h" + +namespace Core { + +class ARM_NCE; +class System; + +struct HostContext { + alignas(16) std::array<u64, 12> host_saved_regs{}; + alignas(16) std::array<u128, 8> host_saved_vregs{}; + u64 host_sp{}; + void* host_tpidr_el0{}; +}; + +struct GuestContext { + std::array<u64, 31> cpu_registers{}; + u64 sp{}; + u64 pc{}; + u32 fpcr{}; + u32 fpsr{}; + std::array<u128, 32> vector_registers{}; + u32 pstate{}; + alignas(16) HostContext host_ctx{}; + u64 tpidrro_el0{}; + u64 tpidr_el0{}; + std::atomic<u64> esr_el1{}; + u32 nzcv{}; + u32 svc_swi{}; + System* system{}; + ARM_NCE* parent{}; +}; + +// Verify assembly offsets. +static_assert(offsetof(GuestContext, sp) == GuestContextSp); +static_assert(offsetof(GuestContext, host_ctx) == GuestContextHostContext); +static_assert(offsetof(HostContext, host_sp) == HostContextSpTpidrEl0); +static_assert(offsetof(HostContext, host_tpidr_el0) - 8 == HostContextSpTpidrEl0); +static_assert(offsetof(HostContext, host_tpidr_el0) == HostContextTpidrEl0); +static_assert(offsetof(HostContext, host_saved_regs) == HostContextRegs); +static_assert(offsetof(HostContext, host_saved_vregs) == HostContextVregs); + +} // namespace Core |