Skip to content

Commit

Permalink
Merge pull request #3298 from Sonicadvance1/remove_initializecontext
Browse files Browse the repository at this point in the history
FEXCore: Removes InitializeContext API
  • Loading branch information
Sonicadvance1 committed Dec 1, 2023
2 parents 250ffb6 + f090700 commit b35fadf
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 24 deletions.
6 changes: 0 additions & 6 deletions FEXCore/Source/Interface/Context/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ namespace FEXCore::Context {
return fextl::make_unique<FEXCore::Context::ContextImpl>();
}

bool FEXCore::Context::ContextImpl::InitializeContext() {
// This should be used for generating things that are shared between threads
CPUID.Init(this);
return true;
}

void FEXCore::Context::ContextImpl::SetExitHandler(ExitHandler handler) {
CustomExitHandler = std::move(handler);
}
Expand Down
2 changes: 0 additions & 2 deletions FEXCore/Source/Interface/Context/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ namespace FEXCore::Context {
class ContextImpl final : public FEXCore::Context::Context {
public:
// Context base class implementation.
bool InitializeContext() override;

FEXCore::Core::InternalThreadState* InitCore(uint64_t InitialRIP, uint64_t StackPointer) override;

void SetExitHandler(ExitHandler handler) override;
Expand Down
2 changes: 2 additions & 0 deletions FEXCore/Source/Interface/Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ namespace FEXCore::Context {

// Track atomic TSO emulation configuration.
UpdateAtomicTSOEmulationConfig();

CPUID.Init(this);
}

ContextImpl::~ContextImpl() {
Expand Down
10 changes: 0 additions & 10 deletions FEXCore/include/FEXCore/Core/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,6 @@ namespace FEXCore::Context {
*/
FEX_DEFAULT_VISIBILITY static fextl::unique_ptr<FEXCore::Context::Context> CreateNewContext();

/**
* @brief Post creation context initialization
* Once configurations have been set, do the post-creation initialization with that configuration
*
* @param CTX The context that we created
*
* @return true if we managed to initialize correctly
*/
FEX_DEFAULT_VISIBILITY virtual bool InitializeContext() = 0;

/**
* @brief Allows setting up in memory code and other things prior to launchign code execution
*
Expand Down
1 change: 0 additions & 1 deletion Source/Tools/CodeSizeValidation/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ int main(int argc, char **argv, char **const envp) {
// Create FEXCore context.
auto CTX = FEXCore::Context::Context::CreateNewContext();

CTX->InitializeContext();
auto SignalDelegation = FEX::DummyHandlers::CreateSignalDelegator();
auto SyscallHandler = FEX::DummyHandlers::CreateSyscallHandler();

Expand Down
1 change: 0 additions & 1 deletion Source/Tools/FEXLoader/FEXLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ int main(int argc, char **argv, char **const envp) {
FEXCore::Context::InitializeStaticTables(Loader.Is64BitMode() ? FEXCore::Context::MODE_64BIT : FEXCore::Context::MODE_32BIT);

auto CTX = FEXCore::Context::Context::CreateNewContext();
CTX->InitializeContext();

// Setup TSO hardware emulation immediately after initializing the context.
FEX::TSO::SetupTSOEmulation(CTX.get());
Expand Down
1 change: 0 additions & 1 deletion Source/Tools/FEXLoader/IRLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ int main(int argc, char **argv, char **const envp)

FEXCore::Context::InitializeStaticTables();
auto CTX = FEXCore::Context::Context::CreateNewContext();
CTX->InitializeContext();

auto SignalDelegation = FEX::HLE::CreateSignalDelegator(CTX.get(), {});

Expand Down
2 changes: 0 additions & 2 deletions Source/Tools/FEXLoader/TestHarnessRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ int main(int argc, char **argv, char **const envp) {

auto CTX = FEXCore::Context::Context::CreateNewContext();

CTX->InitializeContext();

#ifndef _WIN32
auto SignalDelegation = FEX::HLE::CreateSignalDelegator(CTX.get(), {});
#else
Expand Down
1 change: 0 additions & 1 deletion Source/Windows/WOW64/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,6 @@ void BTCpuProcessInit() {
SyscallHandler = fextl::make_unique<WowSyscallHandler>();

CTX = FEXCore::Context::Context::CreateNewContext();
CTX->InitializeContext();
CTX->SetSignalDelegator(SignalDelegator.get());
CTX->SetSyscallHandler(SyscallHandler.get());
CTX->InitCore(0, 0);
Expand Down

0 comments on commit b35fadf

Please sign in to comment.