From b8369d77acf3a321aaef2b96067bc9d1999e3aa2 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Mon, 27 Aug 2018 15:28:25 -0500 Subject: [PATCH] Backend/A64: add jitstate_info.h --- src/CMakeLists.txt | 1 + src/backend/A64/jitstate_info.h | 48 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/backend/A64/jitstate_info.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fff58456..60fb7cdc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -328,6 +328,7 @@ elseif(ARCHITECTURE_Aarch64) backend/A64/emitter/a64_emitter.h backend/A64/emitter/arm_common.h backend/A64/emitter/code_block.h + backend/A64/jitstate_info.h ) else() message(FATAL_ERROR "Unsupported architecture") diff --git a/src/backend/A64/jitstate_info.h b/src/backend/A64/jitstate_info.h new file mode 100644 index 00000000..f1e192f9 --- /dev/null +++ b/src/backend/A64/jitstate_info.h @@ -0,0 +1,48 @@ +/* This file is part of the dynarmic project. + * Copyright (c) 2018 MerryMage + * This software may be used and distributed according to the terms of the GNU + * General Public License version 2 or any later version. + */ + +#pragma once + +#include + +#include "common/common_types.h" + +namespace Dynarmic::BackendA64 { + +struct JitStateInfo { + template + JitStateInfo(const JitStateType&) + : offsetof_cycles_remaining(offsetof(JitStateType, cycles_remaining)) + , offsetof_cycles_to_run(offsetof(JitStateType, cycles_to_run)) + , offsetof_save_host_MXCSR(offsetof(JitStateType, save_host_MXCSR)) + , offsetof_guest_MXCSR(offsetof(JitStateType, guest_MXCSR)) + , offsetof_rsb_ptr(offsetof(JitStateType, rsb_ptr)) + , rsb_ptr_mask(JitStateType::RSBPtrMask) + , offsetof_rsb_location_descriptors(offsetof(JitStateType, rsb_location_descriptors)) + , offsetof_rsb_codeptrs(offsetof(JitStateType, rsb_codeptrs)) + , offsetof_CPSR_nzcv(offsetof(JitStateType, CPSR_nzcv)) + , offsetof_FPSCR_IDC(offsetof(JitStateType, FPSCR_IDC)) + , offsetof_FPSCR_UFC(offsetof(JitStateType, FPSCR_UFC)) + , offsetof_fpsr_exc(offsetof(JitStateType, fpsr_exc)) + , offsetof_fpsr_qc(offsetof(JitStateType, fpsr_qc)) + {} + + const size_t offsetof_cycles_remaining; + const size_t offsetof_cycles_to_run; + const size_t offsetof_save_host_MXCSR; + const size_t offsetof_guest_MXCSR; + const size_t offsetof_rsb_ptr; + const size_t rsb_ptr_mask; + const size_t offsetof_rsb_location_descriptors; + const size_t offsetof_rsb_codeptrs; + const size_t offsetof_CPSR_nzcv; + const size_t offsetof_FPSCR_IDC; + const size_t offsetof_FPSCR_UFC; + const size_t offsetof_fpsr_exc; + const size_t offsetof_fpsr_qc; +}; + +} // namespace Dynarmic::BackendA64