mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-11 15:00:41 +02:00
We weren't adjusting the guest stack size when using clone3. If the clone comes from CLONE3 then we need to offset the RSP by the provided stack size. This also translates to fork/vfork through clone, so make sure to adjust stack in that case as well. Fixes Ender Lilies crashing with Ubuntu 22.04 rootfs
21 lines
740 B
C++
21 lines
740 B
C++
/*
|
|
$info$
|
|
tags: LinuxSyscalls|syscalls-shared
|
|
$end_info$
|
|
*/
|
|
|
|
#pragma once
|
|
#include <stdint.h>
|
|
#include <sys/types.h>
|
|
|
|
namespace FEXCore::Core {
|
|
struct InternalThreadState;
|
|
struct CPUState;
|
|
}
|
|
|
|
namespace FEX::HLE {
|
|
FEXCore::Core::InternalThreadState *CreateNewThread(FEXCore::Context::Context *CTX, FEXCore::Core::CpuStateFrame *Frame, FEX::HLE::clone3_args *args);
|
|
uint64_t HandleNewClone(FEXCore::Core::InternalThreadState *Thread, FEXCore::Context::Context *CTX, FEXCore::Core::CpuStateFrame *Frame, FEX::HLE::clone3_args *GuestArgs);
|
|
uint64_t ForkGuest(FEXCore::Core::InternalThreadState *Thread, FEXCore::Core::CpuStateFrame *Frame, uint32_t flags, void *stack, size_t StackSize, pid_t *parent_tid, pid_t *child_tid, void *tls);
|
|
}
|