mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Remove global module id var hacks.
Nothing needs them anymore.
This commit is contained in:
parent
acac847af2
commit
5aceceecd3
3 changed files with 5 additions and 17 deletions
|
@ -234,7 +234,6 @@ struct SceKernelSMOption {
|
|||
//////////////////////////////////////////////////////////////////////////
|
||||
// STATE BEGIN
|
||||
static int actionAfterModule;
|
||||
static SceUID mainModuleID; // hack
|
||||
// STATE END
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -245,7 +244,6 @@ void __KernelModuleInit()
|
|||
|
||||
void __KernelModuleDoState(PointerWrap &p)
|
||||
{
|
||||
p.Do(mainModuleID);
|
||||
p.Do(actionAfterModule);
|
||||
__KernelRestoreActionType(actionAfterModule, AfterModuleEntryCall::Create);
|
||||
p.DoMarker("sceKernelModule");
|
||||
|
@ -657,7 +655,6 @@ void __KernelStartModule(Module *m, int args, const char *argp, SceKernelSMOptio
|
|||
}
|
||||
|
||||
__KernelSetupRootThread(m->GetUID(), args, argp, options->priority, options->stacksize, options->attribute);
|
||||
mainModuleID = m->GetUID();
|
||||
//TODO: if current thread, put it in wait state, waiting for the new thread
|
||||
}
|
||||
|
||||
|
@ -725,7 +722,7 @@ bool __KernelLoadExec(const char *filename, SceKernelLoadExecParam *param, std::
|
|||
|
||||
__KernelStartModule(module, (u32)strlen(filename) + 1, filename, &option);
|
||||
|
||||
__KernelStartIdleThreads();
|
||||
__KernelStartIdleThreads(module->GetUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -722,9 +722,6 @@ MipsCallManager mipsCalls;
|
|||
int actionAfterCallback;
|
||||
int actionAfterMipsCall;
|
||||
|
||||
// This seems nasty
|
||||
SceUID curModule;
|
||||
|
||||
// Doesn't need state saving.
|
||||
WaitTypeFuncs waitTypeFuncs[NUM_WAITTYPES];
|
||||
|
||||
|
@ -869,7 +866,6 @@ void __KernelThreadingDoState(PointerWrap &p)
|
|||
p.Do(threadqueue, dv);
|
||||
p.DoArray(threadIdleID, ARRAY_SIZE(threadIdleID));
|
||||
p.Do(dispatchEnabled);
|
||||
p.Do(curModule);
|
||||
|
||||
p.Do(threadReadyQueue);
|
||||
|
||||
|
@ -948,13 +944,13 @@ void __KernelChangeReadyState(SceUID threadID, bool ready)
|
|||
WARN_LOG(HLE, "Trying to change the ready state of an unknown thread?");
|
||||
}
|
||||
|
||||
void __KernelStartIdleThreads()
|
||||
void __KernelStartIdleThreads(SceUID moduleId)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
u32 error;
|
||||
Thread *t = kernelObjects.Get<Thread>(threadIdleID[i], error);
|
||||
t->nt.gpreg = __KernelGetModuleGP(curModule);
|
||||
t->nt.gpreg = __KernelGetModuleGP(moduleId);
|
||||
t->context.r[MIPS_REG_GP] = t->nt.gpreg;
|
||||
//t->context.pc += 4; // ADJUSTPC
|
||||
threadReadyQueue.prepare(t->nt.currentPriority);
|
||||
|
@ -1063,7 +1059,6 @@ void __KernelThreadingShutdown()
|
|||
cbReturnHackAddr = 0;
|
||||
currentThread = 0;
|
||||
intReturnHackAddr = 0;
|
||||
curModule = 0;
|
||||
hleCurrentThreadName = NULL;
|
||||
}
|
||||
|
||||
|
@ -1701,7 +1696,6 @@ Thread *__KernelCreateThread(SceUID &id, SceUID moduleId, const char *name, u32
|
|||
|
||||
void __KernelSetupRootThread(SceUID moduleID, int args, const char *argp, int prio, int stacksize, int attr)
|
||||
{
|
||||
curModule = moduleID;
|
||||
//grab mips regs
|
||||
SceUID id;
|
||||
Thread *thread = __KernelCreateThread(id, moduleID, "root", currentMIPS->pc, prio, stacksize, attr);
|
||||
|
@ -1758,10 +1752,7 @@ int __KernelCreateThread(const char *threadName, SceUID moduleID, u32 entry, u32
|
|||
|
||||
int sceKernelCreateThread(const char *threadName, u32 entry, u32 prio, int stacksize, u32 attr, u32 optionAddr)
|
||||
{
|
||||
SceUID moduleId = curModule;
|
||||
if (__GetCurrentThread())
|
||||
moduleId = __GetCurrentThread()->moduleId;
|
||||
return __KernelCreateThread(threadName, moduleId, entry, prio, stacksize, attr, optionAddr);
|
||||
return __KernelCreateThread(threadName, __KernelGetCurThreadModuleId(), entry, prio, stacksize, attr, optionAddr);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ u32 __KernelNotifyCallbackType(RegisteredCallbackType type, SceUID cbId, int not
|
|||
SceUID __KernelGetCurThread();
|
||||
SceUID __KernelGetCurThreadModuleId();
|
||||
void __KernelSetupRootThread(SceUID moduleId, int args, const char *argp, int prio, int stacksize, int attr); //represents the real PSP elf loader, run before execution
|
||||
void __KernelStartIdleThreads();
|
||||
void __KernelStartIdleThreads(SceUID moduleId);
|
||||
void __KernelReturnFromThread(); // Called as HLE function
|
||||
u32 __KernelGetThreadPrio(SceUID id);
|
||||
bool __KernelThreadSortPriority(SceUID thread1, SceUID thread2);
|
||||
|
|
Loading…
Add table
Reference in a new issue