summaryrefslogtreecommitdiffstats
path: root/src/core/arm/arm_interface.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-03-02 05:46:10 +0100
committerbunnei <bunneidev@gmail.com>2020-03-03 03:51:57 +0100
commitc083ea7d7846ee40cfc889ed1d415f73ec78364c (patch)
treec58a597921953ad17f5b233c7e23996f78c2521b /src/core/arm/arm_interface.h
parentcore: loader: Remove check for 32-bit. (diff)
downloadyuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.gz
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.bz2
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.lz
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.xz
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.zst
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.zip
Diffstat (limited to 'src/core/arm/arm_interface.h')
-rw-r--r--src/core/arm/arm_interface.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h
index 47b964eb7..57eae839e 100644
--- a/src/core/arm/arm_interface.h
+++ b/src/core/arm/arm_interface.h
@@ -25,7 +25,20 @@ public:
explicit ARM_Interface(System& system_) : system{system_} {}
virtual ~ARM_Interface() = default;
- struct ThreadContext {
+ struct ThreadContext32 {
+ std::array<u32, 16> cpu_registers;
+ u32 cpsr;
+ std::array<u8, 4> padding;
+ std::array<u64, 32> fprs;
+ u32 fpscr;
+ u32 fpexc;
+ u32 tpidr;
+ };
+ // Internally within the kernel, it expects the AArch32 version of the
+ // thread context to be 344 bytes in size.
+ static_assert(sizeof(ThreadContext32) == 0x158);
+
+ struct ThreadContext64 {
std::array<u64, 31> cpu_registers;
u64 sp;
u64 pc;
@@ -38,7 +51,7 @@ public:
};
// Internally within the kernel, it expects the AArch64 version of the
// thread context to be 800 bytes in size.
- static_assert(sizeof(ThreadContext) == 0x320);
+ static_assert(sizeof(ThreadContext64) == 0x320);
/// Runs the CPU until an event happens
virtual void Run() = 0;
@@ -130,17 +143,10 @@ public:
*/
virtual void SetTPIDR_EL0(u64 value) = 0;
- /**
- * Saves the current CPU context
- * @param ctx Thread context to save
- */
- virtual void SaveContext(ThreadContext& ctx) = 0;
-
- /**
- * Loads a CPU context
- * @param ctx Thread context to load
- */
- virtual void LoadContext(const ThreadContext& ctx) = 0;
+ virtual void SaveContext(ThreadContext32& ctx) = 0;
+ virtual void SaveContext(ThreadContext64& ctx) = 0;
+ virtual void LoadContext(const ThreadContext32& ctx) = 0;
+ virtual void LoadContext(const ThreadContext64& ctx) = 0;
/// Clears the exclusive monitor's state.
virtual void ClearExclusiveState() = 0;