Skip to content

Commit

Permalink
Merge pull request #4039 from Sonicadvance1/move_customir_entry
Browse files Browse the repository at this point in the history
FEXCore: Move `CustomIRResult` to internal header
  • Loading branch information
Sonicadvance1 authored Sep 6, 2024
2 parents b75efc4 + 48fd827 commit 29f0e9b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
17 changes: 17 additions & 0 deletions FEXCore/Source/Interface/Context/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,23 @@ struct ExitFunctionLinkData {
uint64_t GuestRIP;
};

struct CustomIRResult {
void* Creator;
void* Data;

explicit operator bool() const noexcept {
return !lock;
}

CustomIRResult(std::unique_lock<std::shared_mutex>&& lock, void* Creator, void* Data)
: Creator(Creator)
, Data(Data)
, lock(std::move(lock)) {}

private:
std::unique_lock<std::shared_mutex> lock;
};

using BlockDelinkerFunc = void (*)(FEXCore::Core::CpuStateFrame* Frame, FEXCore::Context::ExitFunctionLinkData* Record);
constexpr uint32_t TSC_SCALE_MAXIMUM = 1'000'000'000; ///< 1Ghz

Expand Down
19 changes: 0 additions & 19 deletions FEXCore/include/FEXCore/Core/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

#include <istream>
#include <ostream>
#include <mutex>
#include <shared_mutex>
#include <span>

namespace FEXCore {
Expand Down Expand Up @@ -59,23 +57,6 @@ enum OperatingMode {
MODE_64BIT,
};

struct CustomIRResult {
void* Creator;
void* Data;

explicit operator bool() const noexcept {
return !lock;
}

CustomIRResult(std::unique_lock<std::shared_mutex>&& lock, void* Creator, void* Data)
: Creator(Creator)
, Data(Data)
, lock(std::move(lock)) {}

private:
std::unique_lock<std::shared_mutex> lock;
};

/**
* @brief IR Serialization handler class.
*/
Expand Down

0 comments on commit 29f0e9b

Please sign in to comment.