2020-04-08 11:57:53 +01:00
|
|
|
/* This file is part of the dynarmic project.
|
|
|
|
* Copyright (c) 2020 MerryMage
|
2020-04-23 15:25:11 +01:00
|
|
|
* SPDX-License-Identifier: 0BSD
|
2020-04-08 11:57:53 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-04-08 16:56:57 +01:00
|
|
|
#include <functional>
|
2020-04-08 11:57:53 +01:00
|
|
|
#include <memory>
|
|
|
|
|
2020-04-08 16:56:57 +01:00
|
|
|
#include "common/common_types.h"
|
|
|
|
|
2020-04-08 11:57:53 +01:00
|
|
|
namespace Dynarmic::Backend::X64 {
|
|
|
|
|
|
|
|
class BlockOfCode;
|
|
|
|
|
2020-04-08 16:56:57 +01:00
|
|
|
struct FakeCall {
|
|
|
|
u64 call_rip;
|
|
|
|
u64 ret_rip;
|
|
|
|
};
|
|
|
|
|
2020-04-08 11:57:53 +01:00
|
|
|
class ExceptionHandler final {
|
|
|
|
public:
|
|
|
|
ExceptionHandler();
|
|
|
|
~ExceptionHandler();
|
|
|
|
|
|
|
|
void Register(BlockOfCode& code);
|
2020-04-08 16:56:57 +01:00
|
|
|
|
|
|
|
bool SupportsFastmem() const noexcept;
|
|
|
|
void SetFastmemCallback(std::function<FakeCall(u64)> cb);
|
|
|
|
|
2020-04-08 11:57:53 +01:00
|
|
|
private:
|
|
|
|
struct Impl;
|
|
|
|
std::unique_ptr<Impl> impl;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Dynarmic::Backend::X64
|