sceKernelThread: Make a bunch of globals static

This commit is contained in:
Henrik Rydgård committed 2025-05-25 12:40:16 +02:00
1 parent 709c86c076
commit 15d24806bb
1 file changed
+25 -25
+25 -25
View File
@@ -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<ThreadCallback> 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<ThreadCallback> threadEndListeners;
typedef std::vector<SceUID> ThreadEventHandlerList;
static std::map<SceUID, ThreadEventHandlerList> threadEventHandlers;
static std::vector<SceUID> pendingDeleteThreads;
// Lists all thread ids that aren't deleted/etc.
std::vector<SceUID> threadqueue;
static std::vector<SceUID> 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<SceUID, u64> pausedDelays;
static std::map<SceUID, u64> 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;