mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 00:12:40 +00:00
kernel: use per-thread signal stacks for guest stack faults
This commit is contained in:
1 parent
6ae5cb7b64
commit
211242452b
4 files changed
+128
-2
No files matched your search
@@ -4,6 +4,7 @@
|
||||
#include "common/common.h"
|
||||
#include "common/dateTime.h"
|
||||
#include "common/emulatorConfig.h"
|
||||
#include "common/hostException.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/singleton.h"
|
||||
#include "common/stringUtils.h"
|
||||
@@ -1061,6 +1062,12 @@ void PthreadDeleteStaticObjects(Loader::Program* program) {
|
||||
void PthreadInitSelfForMainThread() {
|
||||
EXIT_IF(g_pthread_self != nullptr);
|
||||
|
||||
#if KYTY_PLATFORM == KYTY_PLATFORM_LINUX
|
||||
if (!Common::HostException::InitializeThreadSignalStack()) {
|
||||
EXIT("Failed to initialize the thread signal stack\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
g_pthread_self = new PthreadPrivate {};
|
||||
PthreadAttrInit(&g_pthread_self->attr);
|
||||
UpdateCurrentThreadStackAttr(&g_pthread_self->attr);
|
||||
@@ -3382,6 +3389,13 @@ static void CleanupThread(void* arg) {
|
||||
}
|
||||
|
||||
static void* RunThread(void* arg) {
|
||||
|
||||
#if KYTY_PLATFORM == KYTY_PLATFORM_LINUX
|
||||
if (!Common::HostException::InitializeThreadSignalStack()) {
|
||||
EXIT("Failed to initialize the thread signal stack\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
auto* thread = static_cast<Pthread>(arg);
|
||||
void* ret = nullptr;
|
||||
|
||||
|
||||
Reference in new issue
Block a user