From 15d24806bbe26d5f2641328fb6e2dcbdfa6ad15c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 25 May 2025 12:40:16 +0200 Subject: [PATCH] sceKernelThread: Make a bunch of globals static --- Core/HLE/sceKernelThread.cpp | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 4ad49ab66a..cc08a798dc 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -483,49 +483,49 @@ bool __KernelCheckThreadCallbacks(PSPThread *thread, bool force); ////////////////////////////////////////////////////////////////////////// //STATE BEGIN ////////////////////////////////////////////////////////////////////////// -int g_inCbCount = 0; +static int g_inCbCount = 0; // Normally, the same as currentThread. In an interrupt, remembers the callback's thread id. -SceUID currentCallbackThreadID = 0; -int readyCallbacksCount = 0; -SceUID currentThread; -PSPThread *currentThreadPtr; -u32 idleThreadHackAddr; -u32 threadReturnHackAddr; -u32 hleReturnHackAddr; -u32 cbReturnHackAddr; -u32 intReturnHackAddr; -u32 extendReturnHackAddr; -u32 moduleReturnHackAddr; -std::vector threadEndListeners; +static SceUID currentCallbackThreadID = 0; +static int readyCallbacksCount = 0; +static SceUID currentThread; +static PSPThread *currentThreadPtr; +static u32 idleThreadHackAddr; +static u32 threadReturnHackAddr; +static u32 hleReturnHackAddr; +static u32 cbReturnHackAddr; +static u32 intReturnHackAddr; +static u32 extendReturnHackAddr; +static u32 moduleReturnHackAddr; +static std::vector threadEndListeners; typedef std::vector ThreadEventHandlerList; static std::map threadEventHandlers; static std::vector pendingDeleteThreads; // Lists all thread ids that aren't deleted/etc. -std::vector threadqueue; +static std::vector threadqueue; // Only for debugger, so not needed to read, just write. -std::mutex threadqueueLock; +static std::mutex threadqueueLock; // Lists only ready thread ids. -ThreadQueueList threadReadyQueue; +static ThreadQueueList threadReadyQueue; -SceUID threadIdleID[2]; +static SceUID threadIdleID[2]; -int eventScheduledWakeup; -int eventThreadEndTimeout; +static int eventScheduledWakeup; +static int eventThreadEndTimeout; -bool dispatchEnabled = true; +static bool dispatchEnabled = true; -MipsCallManager mipsCalls; -int actionAfterCallback; -int actionAfterMipsCall; +static MipsCallManager mipsCalls; +static int actionAfterCallback; +static int actionAfterMipsCall; // When inside a callback, delays are "paused", and rechecked after the callback returns. -std::map pausedDelays; +static std::map pausedDelays; // Doesn't need state saving. -WaitTypeFuncs waitTypeFuncs[NUM_WAITTYPES]; +static WaitTypeFuncs waitTypeFuncs[NUM_WAITTYPES]; // Doesn't really need state saving, just for logging purposes. static u64 lastSwitchCycles = 0;