Skip to content

Commit

Permalink
Merge pull request #3342 from Sonicadvance1/fix_proton_3
Browse files Browse the repository at this point in the history
Fixes Proton again
  • Loading branch information
Sonicadvance1 committed Dec 21, 2023
2 parents 00669a1 + 362cccc commit b1c3737
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ struct StackFrameData {
FEXCore::Context::Context *CTX{};
FEXCore::Core::CpuStateFrame NewFrame{};
FEX::HLE::clone3_args GuestArgs{};
size_t StackSize;
};

struct StackFramePlusRet {
Expand Down Expand Up @@ -469,7 +468,7 @@ static uint64_t Clone2Handler(FEXCore::Core::CpuStateFrame *Frame, FEX::HLE::clo
uint64_t Flags = args->args.flags & ~INVALID_FOR_HOST;
uint64_t Result = ::clone(
Clone2HandlerRet, // To be called function
(void*)((uint64_t)args->NewStack + Data->StackSize), // Stack
(void*)((uint64_t)args->NewStack + args->StackSize), // Stack
Flags, //Flags
Data, //Argument
(pid_t*)args->args.parent_tid, // parent_tid
Expand Down
6 changes: 0 additions & 6 deletions Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ namespace FEX::HLE {
memcpy(&NewThreadState, Frame, sizeof(FEXCore::Core::CPUState));

NewThreadState.gregs[FEXCore::X86State::REG_RAX] = 0;
NewThreadState.gregs[FEXCore::X86State::REG_RBX] = 0;
NewThreadState.gregs[FEXCore::X86State::REG_RBP] = 0;
if (args->Type == TYPE_CLONE3) {
// stack pointer points to the lowest address to the stack
// set RSP to stack + size
Expand Down Expand Up @@ -156,8 +154,6 @@ namespace FEX::HLE {
memcpy(&NewThreadState, Frame, sizeof(FEXCore::Core::CPUState));

NewThreadState.gregs[FEXCore::X86State::REG_RAX] = 0;
NewThreadState.gregs[FEXCore::X86State::REG_RBX] = 0;
NewThreadState.gregs[FEXCore::X86State::REG_RBP] = 0;
if (GuestArgs->stack == 0) {
// Copies in the original thread's stack
}
Expand All @@ -182,8 +178,6 @@ namespace FEX::HLE {
::syscall(SYS_rt_sigprocmask, SIG_SETMASK, &CloneArgs->SignalMask, nullptr, sizeof(CloneArgs->SignalMask));

Thread->CurrentFrame->State.gregs[FEXCore::X86State::REG_RAX] = 0;
Thread->CurrentFrame->State.gregs[FEXCore::X86State::REG_RBX] = 0;
Thread->CurrentFrame->State.gregs[FEXCore::X86State::REG_RBP] = 0;
if (GuestArgs->stack == 0) {
// Copies in the original thread's stack
}
Expand Down

0 comments on commit b1c3737

Please sign in to comment.