2014-09-13 00:34:51 +02:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-17 06:38:14 +01:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-11-19 09:49:13 +01:00
|
|
|
// Refer to the license.txt file included.
|
2014-09-13 00:34:51 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include "common/common_types.h"
|
|
|
|
#include "core/arm/arm_interface.h"
|
2015-06-21 16:11:32 +02:00
|
|
|
#include "core/arm/skyeye_common/arm_regformat.h"
|
2015-07-26 03:10:41 +02:00
|
|
|
#include "core/arm/skyeye_common/armstate.h"
|
2015-06-21 16:11:32 +02:00
|
|
|
|
2016-09-02 14:40:49 +02:00
|
|
|
class ARM_DynCom final : public ARM_Interface {
|
2014-09-13 00:34:51 +02:00
|
|
|
public:
|
2017-12-07 01:37:53 +01:00
|
|
|
explicit ARM_DynCom(PrivilegeMode initial_mode);
|
2014-09-13 00:34:51 +02:00
|
|
|
~ARM_DynCom();
|
|
|
|
|
2017-12-03 03:57:08 +01:00
|
|
|
void Run() override;
|
|
|
|
void Step() override;
|
|
|
|
|
2016-06-27 20:38:49 +02:00
|
|
|
void ClearInstructionCache() override;
|
2017-09-11 13:54:14 +02:00
|
|
|
void InvalidateCacheRange(u32 start_address, size_t length) override;
|
2017-09-24 23:44:13 +02:00
|
|
|
void PageTableChanged() override;
|
2016-06-27 20:38:49 +02:00
|
|
|
|
2014-10-26 05:56:13 +01:00
|
|
|
void SetPC(u32 pc) override;
|
2014-12-24 04:45:52 +01:00
|
|
|
u32 GetPC() const override;
|
|
|
|
u32 GetReg(int index) const override;
|
2014-10-26 05:56:13 +01:00
|
|
|
void SetReg(int index, u32 value) override;
|
2015-08-07 03:24:25 +02:00
|
|
|
u32 GetVFPReg(int index) const override;
|
|
|
|
void SetVFPReg(int index, u32 value) override;
|
|
|
|
u32 GetVFPSystemReg(VFPSystemRegister reg) const override;
|
|
|
|
void SetVFPSystemReg(VFPSystemRegister reg, u32 value) override;
|
2014-12-24 04:45:52 +01:00
|
|
|
u32 GetCPSR() const override;
|
2014-10-26 05:56:13 +01:00
|
|
|
void SetCPSR(u32 cpsr) override;
|
2015-04-06 18:57:49 +02:00
|
|
|
u32 GetCP15Register(CP15Register reg) override;
|
|
|
|
void SetCP15Register(CP15Register reg, u32 value) override;
|
2014-09-13 00:34:51 +02:00
|
|
|
|
2017-12-12 20:12:03 +01:00
|
|
|
std::unique_ptr<ThreadContext> NewContext() const override;
|
|
|
|
void SaveContext(const std::unique_ptr<ThreadContext>& arg) override;
|
|
|
|
void LoadContext(const std::unique_ptr<ThreadContext>& arg) override;
|
2014-09-13 00:34:51 +02:00
|
|
|
|
2014-10-26 05:56:13 +01:00
|
|
|
void PrepareReschedule() override;
|
2014-09-13 00:34:51 +02:00
|
|
|
|
|
|
|
private:
|
2018-07-23 23:08:14 +02:00
|
|
|
void ExecuteInstructions(u64 num_instructions);
|
2017-12-03 03:57:08 +01:00
|
|
|
|
2014-09-13 00:34:51 +02:00
|
|
|
std::unique_ptr<ARMul_State> state;
|
|
|
|
};
|